set - $$VERS ; \
MAJOR="$$1"; MINOR="$$2"; \
NEW=`echo $$MINOR + 1 | bc` ; \
+ NEW=`echo $$NEW | sed 's/^\([0-9]\)$$/0\1/'` ; \
D=`date '+%d-%b-%y'`; \
if [ ! -f xscreensaver-$$MAJOR.$$MINOR.tar.gz ]; then \
echo "WARNING: xscreensaver-$$MAJOR.$$MINOR.tar.gz does not exist."; \
echo --------------------------------------------------------------- ; \
( cd utils; gmake ) ; \
( cd driver; gmake ) ; \
+ ( cd driver; gmake xscreensaver-demo-Xaw ) ; \
echo --------------------------------------------------------------- ); \
\
( cd BIN/lesstif ; \
echo --------------------------------------------------------------- ; \
( cd utils; gmake ) ; \
( cd driver; gmake ) ; \
+ ( cd driver; gmake xscreensaver-demo-Xaw ) ; \
echo --------------------------------------------------------------- ); \
\
- chmod -R u+w . ; \
+ chmod -R u+w .
www::
\
(cd ..; $(MAKE) xscreensaver/changelog.html ); \
cvs diff -u0 changelog.html ; \
+ set +x ; \
\
echo -n "Ok? "; \
read line; \
To build on VMS, see README.VMS.
+If you are upgrading, you might want to delete your ~/.xscreensaver file.
+If you don't, you might not see the new graphics modes. If you are upgrading
+from version 2.* to version 3.*, definitely do delete your .xscreensaver file.
+
If you think you've found a bug, please let me know! No bug report is too
small. But first, please read the enclosed `README.debugging' file to find
out what kind of information would be most helpful to include in your bug
============
+Changes since 3.00: * Some fixes to `reflect'.
+ * Configure tweaks.
+ * Made it log unsuccessful attempts to unlock the screen
+ to syslog.
+ * Fixed a bug where `xscreensaver-demo' could be seeing
+ a different programs list than `xscreensaver' did.
+Changes since 2.34: * The xscreensaver daemon no longer links against Motif
+ or Athena: demo-mode and the preferences panel are no
+ longer built in to the daemon, but are now handled by
+ an external program, `xscreensaver-demo'.
+ (I decided that this, along with the recent addition
+ of the `.xscreensaver' config file, justified bumping
+ the version number to 3.00, since this is a fairly
+ major architectural change.)
+ * Lines in the `*programs' resource may now begin with
+ the character "-", meaning "don't run this hack."
+ In this way, it's possible to disable a hack without
+ throwing away the information about it (making it
+ easier to change your mind later.) Eventually the
+ preferences/demo mode GUI should represent this as a
+ checkbox or something.
+ * Fixed a short race condition where it was possible for
+ xscreensaver to die with a BadWindow error if it was
+ blanking the screen just as another window was being
+ deleted.
+ * Made it possible to disable specific modes in `bsod'.
Changes since 2.33: * Fixed a bug that was making `pipes' generate way too
many valves. Made the viewpoint in `pipes' be selected
randomly instead of always being -10 degrees.
* What platform are you running on? What does the included
`./config.guess' shell script print?
- * Is the problem in the driver, or in the graphics hacks?
+ * Is the problem in the driver (`xscreensaver'), the GUI
+ (`xscreensaver-demo'), or in the graphics hacks?
- * If the problem is in the driver, was the driver built using
+ * If the problem is in the GUI, was the it built using
Motif, Lesstif, or Athena? Which version?
* If the problem is in one (or more) of the hacks, which ones?
- If you're not sure, try
-
- xscreensaver-command -demo
-
- to go through the list of them and see which work and which
- don't.
+ If you're not sure, try running `xscreensaver-demo' to go
+ through the list of them and see which work and which don't.
* Does the problem occur when running that hack by hand, in
its own window (i.e., when started with no command-line args)?
* Start `xscreensaver' with the command-line arguments
- -verbose -no-capture-stderr
+ -verbose -no-capture
This will cause it to write a lot of debugging info to the stderr
of the xscreensaver process (the `-verbose' option turns on the
- diagnostics; the `-no-capture-stderr' option prevents the data
- from being displayed on the screensaver window as well.)
+ diagnostics; the `-no-capture' option prevents the data from being
+ displayed on the screensaver window as well.)
You also might want to use the `-timestamp' option, which will
cause the xscreensaver messages to include the time at which
you could start it from your login script like this (csh syntax):
( cd ~/src/xscreensaver/ ; \
- xscreensaver -sync -verbose -timestamp -no-capture-stderr \
+ xscreensaver -sync -verbose -timestamp -no-capture \
>>&LOG & )
* Hackers only: If you're feeling adventurous enough to run gdb
#undef HAVE_VT_LOCKSWITCH
+/* Define this if you the openlog(), syslog(), and closelog() functions.
+ This is used for logging failed login attempts.
+ */
+#undef HAVE_SYSLOG
+
+
/* *************************************************************************
OTHER C ENVIRONMENT JUNK
************************************************************************* */
+echo -n "current directory: "
+pwd
+echo "command line was: $0 $@"
+
+
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:657: checking host system type" >&5
+echo "configure:662: 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:681: checking for $ac_word" >&5
+echo "configure:686: 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:710: checking for $ac_word" >&5
+echo "configure:715: 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:758: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:763: 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 768 "configure"
+#line 773 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:777: \"$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:792: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:797: 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:797: checking whether we are using GNU C" >&5
+echo "configure:802: 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:806: \"$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:811: \"$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:821: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:826: 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:851: checking how to request ANSI compilation" >&5
+echo "configure:856: 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:875: checking whether the compiler works on ANSI C" >&5
+echo "configure:880: 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 880 "configure"
+#line 885 "configure"
#include "confdefs.h"
main(int ac, char **av) { return 0; }
EOF
-if { (eval echo configure:884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:889: \"$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:933: checking how to run the C preprocessor" >&5
+echo "configure:938: 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 948 "configure"
+#line 953 "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:954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:959: \"$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 965 "configure"
+#line 970 "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:971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:976: \"$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:1004: checking for a BSD compatible install" >&5
+echo "configure:1009: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
INSTALL_DIRS='${INSTALL} -d'
echo $ac_n "checking whether \"\${INSTALL} -d\" creates intermediate directories""... $ac_c" 1>&6
-echo "configure:1055: checking whether \"\${INSTALL} -d\" creates intermediate directories" >&5
+echo "configure:1060: checking whether \"\${INSTALL} -d\" creates intermediate directories" >&5
rm -rf conftestdir
if mkdir conftestdir; then
cd conftestdir >&-
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking whether \"mkdir -p\" creates intermediate directories""... $ac_c" 1>&6
-echo "configure:1066: checking whether \"mkdir -p\" creates intermediate directories" >&5
+echo "configure:1071: checking whether \"mkdir -p\" creates intermediate directories" >&5
rm -rf dir1
mkdir -p dir1/dir2 >&- 2>&-
if test -d dir1/dir2/. ; then
fi
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1081: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1086: 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:1109: checking for working const" >&5
+echo "configure:1114: 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 1114 "configure"
+#line 1119 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1168: \"$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:1184: checking for inline" >&5
+echo "configure:1189: 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 1191 "configure"
+#line 1196 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1198: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1203: \"$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:1225: checking for ANSI C header files" >&5
+echo "configure:1230: 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 1230 "configure"
+#line 1235 "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:1238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1243: \"$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 1255 "configure"
+#line 1260 "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 1273 "configure"
+#line 1278 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
:
else
cat > conftest.$ac_ext <<EOF
-#line 1294 "configure"
+#line 1299 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
exit (0); }
EOF
-if { (eval echo configure:1305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1310: \"$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:1329: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1334: 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 1334 "configure"
+#line 1339 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:1343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1348: \"$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:1364: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1369: 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 1369 "configure"
+#line 1374 "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:1385: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1390: \"$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:1410: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1415: 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 1415 "configure"
+#line 1420 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:1423: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1428: \"$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:1448: checking for opendir in -ldir" >&5
+echo "configure:1453: 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 1456 "configure"
+#line 1461 "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:1467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1472: \"$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:1489: checking for opendir in -lx" >&5
+echo "configure:1494: 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 1497 "configure"
+#line 1502 "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:1508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1513: \"$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:1532: checking for mode_t" >&5
+echo "configure:1537: 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 1537 "configure"
+#line 1542 "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:1565: checking for pid_t" >&5
+echo "configure:1570: 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 1570 "configure"
+#line 1575 "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:1598: checking for size_t" >&5
+echo "configure:1603: 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 1603 "configure"
+#line 1608 "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:1631: checking return type of signal handlers" >&5
+echo "configure:1636: 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 1636 "configure"
+#line 1641 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
int i;
; return 0; }
EOF
-if { (eval echo configure:1653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1658: \"$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:1673: checking how to call gettimeofday" >&5
+echo "configure:1678: 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 1678 "configure"
+#line 1683 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <sys/time.h>
gettimeofday(&tv, &tzp);
; return 0; }
EOF
-if { (eval echo configure:1687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_gettimeofday_args=2
else
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 1695 "configure"
+#line 1700 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <sys/time.h>
struct timeval tv; gettimeofday(&tv);
; return 0; }
EOF
-if { (eval echo configure:1703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_gettimeofday_args=1
else
fi
ac_gettimeofday_args=$ac_cv_gettimeofday_args
-if test $ac_gettimeofday_args = 1 ; then
+if test "$ac_gettimeofday_args" = 1 ; then
cat >> confdefs.h <<\EOF
#define HAVE_GETTIMEOFDAY 1
EOF
echo "$ac_t""one argument" 1>&6
-elif test $ac_gettimeofday_args = 2 ; then
+elif test "$ac_gettimeofday_args" = 2 ; then
cat >> confdefs.h <<\EOF
#define HAVE_GETTIMEOFDAY 1
EOF
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:1743: checking for $ac_func" >&5
+echo "configure:1748: 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 1748 "configure"
+#line 1753 "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:1771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
fi
done
-for ac_func in sigaction
+for ac_func in sigaction syslog
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1798: checking for $ac_func" >&5
+echo "configure:1803: 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 1803 "configure"
+#line 1808 "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:1826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1831: \"$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:1855: checking for $ac_hdr" >&5
+echo "configure:1860: 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 1860 "configure"
+#line 1865 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1865: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:1924: checking for X" >&5
+echo "configure:1929: 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 1986 "configure"
+#line 1991 "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:1991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1996: \"$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 2060 "configure"
+#line 2065 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:2067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2072: \"$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:2173: checking whether -R must be followed by a space" >&5
+echo "configure:2178: 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 2176 "configure"
+#line 2181 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2188: \"$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 2199 "configure"
+#line 2204 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2211: \"$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:2238: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:2243: 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 2246 "configure"
+#line 2251 "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:2257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2262: \"$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:2279: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:2284: 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 2287 "configure"
+#line 2292 "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:2298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2303: \"$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:2327: checking for gethostbyname" >&5
+echo "configure:2332: 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 2332 "configure"
+#line 2337 "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:2355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2360: \"$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:2376: checking for gethostbyname in -lnsl" >&5
+echo "configure:2381: 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 2384 "configure"
+#line 2389 "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:2395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2400: \"$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:2425: checking for connect" >&5
+echo "configure:2430: 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 2430 "configure"
+#line 2435 "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:2453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2458: \"$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:2474: checking for connect in -lsocket" >&5
+echo "configure:2479: 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 2482 "configure"
+#line 2487 "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:2493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2498: \"$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:2517: checking for remove" >&5
+echo "configure:2522: 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 2522 "configure"
+#line 2527 "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:2545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2550: \"$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:2566: checking for remove in -lposix" >&5
+echo "configure:2571: 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 2574 "configure"
+#line 2579 "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:2585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2590: \"$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:2609: checking for shmat" >&5
+echo "configure:2614: 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 2614 "configure"
+#line 2619 "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:2637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2642: \"$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:2658: checking for shmat in -lipc" >&5
+echo "configure:2663: 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 2666 "configure"
+#line 2671 "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:2677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2682: \"$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:2710: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:2715: 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 2718 "configure"
+#line 2723 "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:2729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2734: \"$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:2766: checking for X app-defaults directory" >&5
+echo "configure:2771: 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 2913 "configure"
+#line 2918 "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:2934: checking for XPointer" >&5
+echo "configure:2939: 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 2945 "configure"
+#line 2950 "configure"
#include "confdefs.h"
#include <X11/Xlib.h>
int main() {
XPointer foo = (XPointer) 0;
; return 0; }
EOF
-if { (eval echo configure:2952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2957: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_xpointer=yes
else
fi
echo "$ac_t""$ac_cv_xpointer" 1>&6
-if test $ac_cv_xpointer != yes; then
+if test "$ac_cv_xpointer" != yes; then
cat >> confdefs.h <<\EOF
#define XPointer char*
EOF
# 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:3086: checking for regcmp in -lgen" >&5
+echo "configure:3091: 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 3094 "configure"
+#line 3099 "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:3105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3110: \"$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:3142: checking for X11/Xmu/Error.h" >&5
+echo "configure:3147: 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 3147 "configure"
+#line 3152 "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:3152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3157: \"$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="$ac_save_CPPFLAGS"
-if test $have_xmu = no ; then
+if test "$have_xmu" = no ; then
XMU_SRCS='$(UTILS_SRC)/xmu.c'
XMU_OBJS='$(UTILS_BIN)/xmu.o'
else
# See comp.windows.x FAQ question 124 about _get_wmShellWidgetClass on 4.1.x.
# The right fix is to get OpenWindows 3.0 patches 100512-02 and 100573-03.
#
-if test $have_xmu = yes ; then
+if test "$have_xmu" = yes ; then
case "$host" in
*-sunos4*)
echo $ac_n "checking for the SunOS 4.1.x _get_wmShellWidgetClass bug""... $ac_c" 1>&6
-echo "configure:3196: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5
+echo "configure:3201: 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 3209 "configure"
+#line 3214 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:3216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_sunos_xmu_bug=no
else
fi
echo "$ac_t""$ac_cv_sunos_xmu_bug" 1>&6
- if test $ac_cv_sunos_xmu_bug = yes ; then
+ if test "$ac_cv_sunos_xmu_bug" = yes ; then
echo $ac_n "checking whether the compiler understands -static""... $ac_c" 1>&6
-echo "configure:3232: checking whether the compiler understands -static" >&5
+echo "configure:3237: 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 3239 "configure"
+#line 3244 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:3246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_ld_static=yes
else
fi
echo "$ac_t""$ac_cv_ld_static" 1>&6
- if test $ac_cv_ld_static = yes ; then
+ if test "$ac_cv_ld_static" = yes ; then
LDFLAGS="$LDFLAGS -static"
else
LDFLAGS="$LDFLAGS -Bstatic"
/*)
echo $ac_n "checking for SGI SCREEN_SAVER headers""... $ac_c" 1>&6
-echo "configure:3291: checking for SGI SCREEN_SAVER headers" >&5
+echo "configure:3296: checking for SGI SCREEN_SAVER headers" >&5
d=$with_sgi/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for SGI SCREEN_SAVER libs""... $ac_c" 1>&6
-echo "configure:3301: checking for SGI SCREEN_SAVER libs" >&5
+echo "configure:3306: checking for SGI SCREEN_SAVER libs" >&5
d=$with_sgi/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
withval=
-if test $with_sgi = yes; then
+if test "$with_sgi" = yes; then
ac_save_CPPFLAGS="$CPPFLAGS"
if test \! -z "$includedir" ; then
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/XScreenSaver.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/XScreenSaver.h""... $ac_c" 1>&6
-echo "configure:3339: checking for X11/extensions/XScreenSaver.h" >&5
+echo "configure:3344: 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 3344 "configure"
+#line 3349 "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:3349: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3354: \"$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"
-elif test $with_sgi != no; then
+elif test "$with_sgi" != no; then
echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
exit 1
fi
/*)
echo $ac_n "checking for MIT-SCREEN-SAVER headers""... $ac_c" 1>&6
-echo "configure:3402: checking for MIT-SCREEN-SAVER headers" >&5
+echo "configure:3407: checking for MIT-SCREEN-SAVER headers" >&5
d=$with_mit/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for MIT-SCREEN-SAVER libs""... $ac_c" 1>&6
-echo "configure:3412: checking for MIT-SCREEN-SAVER libs" >&5
+echo "configure:3417: checking for MIT-SCREEN-SAVER libs" >&5
d=$with_mit/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
withval=
-if test $have_sgi != yes; then
- if test $with_mit = yes; then
+if test "$have_sgi" != yes; then
+ if test "$with_mit" = yes; then
ac_save_CPPFLAGS="$CPPFLAGS"
if test \! -z "$includedir" ; then
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6
-echo "configure:3451: checking for X11/extensions/scrnsaver.h" >&5
+echo "configure:3456: 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 3456 "configure"
+#line 3461 "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:3461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3466: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
# Now check to see if it's really in the library; XF86Free-3.3 ships
# scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
#
- if test $have_mit = yes; then
+ if test "$have_mit" = yes; then
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
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
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
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS"
+
echo $ac_n "checking for XScreenSaverRegister in -lXext""... $ac_c" 1>&6
-echo "configure:3505: checking for XScreenSaverRegister in -lXext" >&5
+echo "configure:3510: 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 3513 "configure"
+#line 3518 "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:3524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3529: \"$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="$ac_save_CPPFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
- if test $have_mit = no; then
+ if test "$have_mit" = no; then
# Fuck! Looks like XF86Free-3.3 actually puts it in XExExt instead
# of in Xext. Thank you master, may I have another.
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
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
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
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS"
+
echo $ac_n "checking for XScreenSaverRegister in -lXExExt""... $ac_c" 1>&6
-echo "configure:3575: checking for XScreenSaverRegister in -lXExExt" >&5
+echo "configure:3580: 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 3583 "configure"
+#line 3588 "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:3594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3599: \"$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="$ac_save_LDFLAGS"
fi
- if test $have_mit = no; then
+ if test "$have_mit" = no; then
# Double fuck! Looks like some versions of XFree86 (whichever version
# it is that comes with RedHat Linux 2.0 -- I can't find a version
# number) put this garbage in Xss instead of Xext. Thank you master,
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
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
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
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS"
+
echo $ac_n "checking for XScreenSaverRegister in -lXss""... $ac_c" 1>&6
-echo "configure:3640: checking for XScreenSaverRegister in -lXss" >&5
+echo "configure:3645: 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 3648 "configure"
+#line 3653 "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:3659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3664: \"$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="$ac_save_LDFLAGS"
fi
- if test $have_mit = yes; then
+ if test "$have_mit" = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_MIT_SAVER_EXTENSION 1
EOF
fi
- elif test $with_mit != no; then
+ elif test "$with_mit" != no; then
echo "error: must be yes or no: --with-mit-ext=$with_mit"
exit 1
fi
/*)
echo $ac_n "checking for XIDLE headers""... $ac_c" 1>&6
-echo "configure:3719: checking for XIDLE headers" >&5
+echo "configure:3724: checking for XIDLE headers" >&5
d=$with_xidle/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for XIDLE libs""... $ac_c" 1>&6
-echo "configure:3729: checking for XIDLE libs" >&5
+echo "configure:3734: checking for XIDLE libs" >&5
d=$with_xidle/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
withval=
-if test $with_xidle = yes; then
+if test "$with_xidle" = yes; then
ac_save_CPPFLAGS="$CPPFLAGS"
if test \! -z "$includedir" ; then
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/xidle.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/xidle.h""... $ac_c" 1>&6
-echo "configure:3767: checking for X11/extensions/xidle.h" >&5
+echo "configure:3772: 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 3772 "configure"
+#line 3777 "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:3777: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3782: \"$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="$ac_save_CPPFLAGS"
-elif test $with_xidle != no; then
+elif test "$with_xidle" != no; then
echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
exit 1
fi
/*)
echo $ac_n "checking for XSHM headers""... $ac_c" 1>&6
-echo "configure:3829: checking for XSHM headers" >&5
+echo "configure:3834: checking for XSHM headers" >&5
d=$with_xshm/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for XSHM libs""... $ac_c" 1>&6
-echo "configure:3839: checking for XSHM libs" >&5
+echo "configure:3844: checking for XSHM libs" >&5
d=$with_xshm/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
withval=
-if test $with_xshm = yes; then
+if test "$with_xshm" = yes; then
# first check for Xshm.h.
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:3879: checking for X11/extensions/XShm.h" >&5
+echo "configure:3884: 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 3884 "configure"
+#line 3889 "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:3889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3894: \"$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"
# if that succeeded, then check for sys/ipc.h.
- if test $have_xshm = yes; then
+ if test "$have_xshm" = yes; then
have_xshm=no
ac_save_CPPFLAGS="$CPPFLAGS"
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:3923: checking for sys/ipc.h" >&5
+echo "configure:3928: 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 3928 "configure"
+#line 3933 "configure"
#include "confdefs.h"
#include <sys/ipc.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3938: \"$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 that succeeded, then check for sys/shm.h.
- if test $have_xshm = yes; then
+ if test "$have_xshm" = yes; then
have_xshm=no
ac_save_CPPFLAGS="$CPPFLAGS"
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:3968: checking for sys/shm.h" >&5
+echo "configure:3973: 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 3973 "configure"
+#line 3978 "configure"
#include "confdefs.h"
#include <sys/shm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3983: \"$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_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
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
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
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS"
+
echo $ac_n "checking for XShmQueryExtension in -lXextSam""... $ac_c" 1>&6
-echo "configure:4027: checking for XShmQueryExtension in -lXextSam" >&5
+echo "configure:4032: checking for XShmQueryExtension in -lXextSam" >&5
ac_lib_var=`echo XextSam'_'XShmQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXextSam -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4035 "configure"
+#line 4040 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
XShmQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:4046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4051: \"$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
esac
# if that succeeded, then we've really got it.
- if test $have_xshm = yes; then
+ if test "$have_xshm" = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_XSHM_EXTENSION 1
EOF
fi
-elif test $with_xshm != no; then
+elif test "$with_xshm" != no; then
echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
exit 1
fi
/*)
echo $ac_n "checking for SGI-VIDEO-CONTROL headers""... $ac_c" 1>&6
-echo "configure:4105: checking for SGI-VIDEO-CONTROL headers" >&5
+echo "configure:4110: checking for SGI-VIDEO-CONTROL headers" >&5
d=$with_sgivc/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for SGI-VIDEO-CONTROL libs""... $ac_c" 1>&6
-echo "configure:4115: checking for SGI-VIDEO-CONTROL libs" >&5
+echo "configure:4120: checking for SGI-VIDEO-CONTROL libs" >&5
d=$with_sgivc/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
withval=
-if test $with_sgivc = yes; then
+if test "$with_sgivc" = yes; then
# first check for XSGIvc.h
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:4155: checking for X11/extensions/XSGIvc.h" >&5
+echo "configure:4160: 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 4160 "configure"
+#line 4165 "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:4165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4170: \"$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"
# if that succeeded, then check for the -lXsgivc
- if test $have_sgivc = yes; then
+ if test "$have_sgivc" = yes; then
have_sgivc=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
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
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
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS"
+
echo $ac_n "checking for XSGIvcQueryGammaMap in -lXsgivc""... $ac_c" 1>&6
-echo "configure:4208: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5
+echo "configure:4213: 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 4216 "configure"
+#line 4221 "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:4227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4232: \"$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
# if that succeeded, then we've really got it.
- if test $have_sgivc = yes; then
+ if test "$have_sgivc" = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_SGI_VC_EXTENSION 1
EOF
fi
-elif test $with_sgivc != no; then
+elif test "$with_sgivc" != no; then
echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
exit 1
fi
/*)
echo $ac_n "checking for DPMS headers""... $ac_c" 1>&6
-echo "configure:4285: checking for DPMS headers" >&5
+echo "configure:4290: checking for DPMS headers" >&5
d=$with_dpms/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for DPMS libs""... $ac_c" 1>&6
-echo "configure:4295: checking for DPMS libs" >&5
+echo "configure:4300: checking for DPMS libs" >&5
d=$with_dpms/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
withval=
-if test $with_dpms = yes; then
+if test "$with_dpms" = yes; then
# first check for dpms.h
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:4335: checking for X11/extensions/dpms.h" >&5
+echo "configure:4340: 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 4340 "configure"
+#line 4345 "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:4345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4350: \"$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"
# if that succeeded, then check for the -lXdpms
- if test $have_dpms = yes; then
+ 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
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
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
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS"
+
echo $ac_n "checking for DPMSInfo in -lXdpms""... $ac_c" 1>&6
-echo "configure:4388: checking for DPMSInfo in -lXdpms" >&5
+echo "configure:4393: checking for DPMSInfo in -lXdpms" >&5
ac_lib_var=`echo Xdpms'_'DPMSInfo | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXdpms -lXext -lX11 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4396 "configure"
+#line 4401 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
DPMSInfo()
; return 0; }
EOF
-if { (eval echo configure:4407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4412: \"$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
# if that succeeded, then we've really got it.
- if test $have_dpms = yes; then
+ if test "$have_dpms" = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_DPMS_EXTENSION 1
EOF
fi
-elif test $with_dpms != no; then
+elif test "$with_dpms" != no; then
echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
exit 1
fi
/*)
echo $ac_n "checking for Motif headers""... $ac_c" 1>&6
-echo "configure:4470: checking for Motif headers" >&5
+echo "configure:4475: checking for Motif headers" >&5
d=$with_motif/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for Motif libs""... $ac_c" 1>&6
-echo "configure:4480: checking for Motif libs" >&5
+echo "configure:4485: checking for Motif libs" >&5
d=$with_motif/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
/*)
echo $ac_n "checking for Athena headers""... $ac_c" 1>&6
-echo "configure:4525: checking for Athena headers" >&5
+echo "configure:4530: checking for Athena headers" >&5
d=$with_athena/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for Athena libs""... $ac_c" 1>&6
-echo "configure:4535: checking for Athena libs" >&5
+echo "configure:4540: checking for Athena libs" >&5
d=$with_athena/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
withval=
-if test $with_motif != yes -a $with_motif != no ; then
+if test "$with_motif" != yes -a "$with_motif" != no ; then
echo "error: must be yes or no: --with-motif=$with_motif"
exit 1
fi
-if test $with_athena != yes -a $with_athena != no ; then
+if test "$with_athena" != yes -a "$with_athena" != no ; then
echo "error: must be yes or no: --with-athena=$with_athena"
exit 1
fi
# Saying --without-motif is the same as saying --with-athena.
-if test $with_motif_req = no ; then
+if test "$with_motif_req" = no ; then
with_athena_req=yes
with_athena=yes
fi
# Saying --without-athena is the same as saying --with-motif.
-if test $with_athena_req = no ; then
+if test "$with_athena_req" = no ; then
with_motif_req=yes
with_motif=yes
fi
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:4598: checking for Xm/Xm.h" >&5
+echo "configure:4603: 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 4603 "configure"
+#line 4608 "configure"
#include "confdefs.h"
#include <Xm/Xm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4613: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
#define HAVE_MOTIF 1
EOF
- SAVER_LIBS="-lXm $SAVER_LIBS"
+ TOOLKIT_LIBS="-lXm $TOOLKIT_LIBS"
else
echo "$ac_t""no" 1>&6
fi
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:4648: checking for X11/Xaw/Dialog.h" >&5
+echo "configure:4653: 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 4653 "configure"
+#line 4658 "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:4658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4663: \"$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="$ac_save_CPPFLAGS"
-
+ if test "$have_athena" = yes; then
+
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
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
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
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS"
+
echo $ac_n "checking for Xaw3dComputeTopShadowRGB in -lXaw3d""... $ac_c" 1>&6
-echo "configure:4697: checking for Xaw3dComputeTopShadowRGB in -lXaw3d" >&5
+echo "configure:4703: checking for Xaw3dComputeTopShadowRGB in -lXaw3d" >&5
ac_lib_var=`echo Xaw3d'_'Xaw3dComputeTopShadowRGB | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXaw3d -lXt -lXmu -lXext -lX11 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4705 "configure"
+#line 4711 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
Xaw3dComputeTopShadowRGB()
; return 0; }
EOF
-if { (eval echo configure:4716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4722: \"$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="$ac_save_CPPFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
+ fi
- if test $have_athena3d = yes; then
- SAVER_LIBS="-lXaw3d $SAVER_LIBS"
- elif test $have_athena = yes; then
- SAVER_LIBS="-lXaw $SAVER_LIBS"
+ if test "$have_athena3d" = yes; then
+ TOOLKIT_LIBS="-lXaw3d $TOOLKIT_LIBS"
+ elif test "$have_athena" = yes; then
+ TOOLKIT_LIBS="-lXaw $TOOLKIT_LIBS"
fi
}
# If they asked for neither, check motif then athena.
proselytize_motif=yes
-if test $with_motif = yes; then
+if test "$with_motif" = yes; then
# asked for both, or for motif only
check_motif
- if test $have_motif = yes; then
+ if test "$have_motif" = yes; then
with_athena=no
with_athena_req=no
else
check_athena
fi
-elif test $with_athena = yes; then
+elif test "$with_athena" = yes; then
# asked for athena only
check_athena
- if test $have_athena = yes; then
+ if test "$have_athena" = yes; then
with_motif=no
proselytize_motif=no
else
else
# asked for neither
check_motif
- if test $have_motif = yes; then
+ if test "$have_motif" = yes; then
with_athena=no
else
check_athena
fi
-if test $have_motif = yes; then
+if test "$have_motif" = yes; then
proselytize_motif=no
fi
# If we have Athena, check whether it's a version that includes
# XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.)
-if test $have_athena = yes ; then
+if test "$have_athena" = yes ; then
echo $ac_n "checking for XawViewportSetCoordinates in Viewport.h""... $ac_c" 1>&6
-echo "configure:4792: checking for XawViewportSetCoordinates in Viewport.h" >&5
+echo "configure:4799: 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 4804 "configure"
+#line 4811 "configure"
#include "confdefs.h"
#include <X11/Xaw/Viewport.h>
EOF
fi
echo "$ac_t""$ac_cv_have_XawViewportSetCoordinates" 1>&6
- if test $ac_cv_have_XawViewportSetCoordinates = yes ; then
+ if test "$ac_cv_have_XawViewportSetCoordinates" = yes ; then
cat >> confdefs.h <<\EOF
#define HAVE_XawViewportSetCoordinates 1
EOF
# If we have Motif, check whether it's really LessTif.
#
have_lesstif=no
-if test $have_motif = yes ; then
+if test "$have_motif" = yes ; then
echo $ac_n "checking whether Motif is really LessTif""... $ac_c" 1>&6
-echo "configure:4833: checking whether Motif is really LessTif" >&5
+echo "configure:4840: 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 4844 "configure"
+#line 4851 "configure"
#include "confdefs.h"
#include <Xm/Xm.h>
int main() {
long vers = LesstifVersion;
; return 0; }
EOF
-if { (eval echo configure:4851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_have_lesstif=yes
else
lesstif_version=unknown
lesstif_version_string=unknown
-if test $have_lesstif = yes ; then
+if test "$have_lesstif" = yes ; then
ltv=unknown
echo unknown > conftest-lt
echo $ac_n "checking LessTif version number""... $ac_c" 1>&6
-echo "configure:4879: checking LessTif version number" >&5
+echo "configure:4886: checking LessTif version number" >&5
if eval "test \"`echo '$''{'ac_cv_lesstif_version_string'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_lesstif_version_string=unknown
else
cat > conftest.$ac_ext <<EOF
-#line 4894 "configure"
+#line 4901 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <Xm/Xm.h>
exit(0);
}
EOF
-if { (eval echo configure:4907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ltv=`cat conftest-lt`
ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
# I have no idea.
#
have_xp_ext=no
-if test $have_motif = yes ; then
+if test "$have_motif" = yes ; then
have_xp_ext=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
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
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
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS"
+
echo $ac_n "checking for XpQueryExtension in -lXp""... $ac_c" 1>&6
-echo "configure:4957: checking for XpQueryExtension in -lXp" >&5
+echo "configure:4964: 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 4965 "configure"
+#line 4972 "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:4976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4983: \"$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
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- have_xp_ext=yes; SAVER_LIBS="$SAVER_LIBS -lXp"
+ have_xp_ext=yes; TOOLKIT_LIBS="$TOOLKIT_LIBS -lXp"
else
echo "$ac_t""no" 1>&6
fi
/*)
echo $ac_n "checking for XPM headers""... $ac_c" 1>&6
-echo "configure:5021: checking for XPM headers" >&5
+echo "configure:5028: checking for XPM headers" >&5
d=$with_xpm/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for XPM libs""... $ac_c" 1>&6
-echo "configure:5031: checking for XPM libs" >&5
+echo "configure:5038: checking for XPM libs" >&5
d=$with_xpm/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
withval=
-if test $with_xpm = yes; then
+if test "$with_xpm" = yes; then
ac_save_CPPFLAGS="$CPPFLAGS"
if test \! -z "$includedir" ; then
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6
-echo "configure:5069: checking for X11/xpm.h" >&5
+echo "configure:5076: 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 5074 "configure"
+#line 5081 "configure"
#include "confdefs.h"
#include <X11/xpm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5086: \"$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="$ac_save_CPPFLAGS"
-elif test $with_xpm != no; then
+elif test "$with_xpm" != no; then
echo "error: must be yes or no: --with-xpm=$with_xpm"
exit 1
fi
/*)
echo $ac_n "checking for GL headers""... $ac_c" 1>&6
-echo "configure:5133: checking for GL headers" >&5
+echo "configure:5140: checking for GL headers" >&5
d=$with_gl/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for GL libs""... $ac_c" 1>&6
-echo "configure:5143: checking for GL libs" >&5
+echo "configure:5150: checking for GL libs" >&5
d=$with_gl/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
ac_mesagl_version=unknown
ac_mesagl_version_string=unknown
-if test $with_gl = yes; then
+if test "$with_gl" = yes; then
ac_save_CPPFLAGS="$CPPFLAGS"
if test \! -z "$includedir" ; then
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6
-echo "configure:5184: checking for GL/gl.h" >&5
+echo "configure:5191: 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 5189 "configure"
+#line 5196 "configure"
#include "confdefs.h"
#include <GL/gl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5201: \"$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="$ac_save_CPPFLAGS"
- if test $have_gl = yes ; then
+ if test "$have_gl" = yes ; then
ac_save_CPPFLAGS="$CPPFLAGS"
if test \! -z "$includedir" ; then
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:5225: checking for GL/glx.h" >&5
+echo "configure:5232: 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 5230 "configure"
+#line 5237 "configure"
#include "confdefs.h"
#include <GL/glx.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5242: \"$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 we have the headers, try and figure out which vendor it's from.
#
- if test $have_gl = yes ; then
+ if test "$have_gl" = yes ; then
cat >> confdefs.h <<\EOF
#define HAVE_GL 1
# to link against.
#
echo $ac_n "checking whether GL is really MesaGL""... $ac_c" 1>&6
-echo "configure:5272: checking whether GL is really MesaGL" >&5
+echo "configure:5279: checking whether GL is really MesaGL" >&5
if eval "test \"`echo '$''{'ac_cv_have_mesa_gl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 5284 "configure"
+#line 5291 "configure"
#include "confdefs.h"
#include <GL/glx.h>
EOF
ac_have_mesa_gl=$ac_cv_have_mesa_gl
echo "$ac_t""$ac_have_mesa_gl" 1>&6
- if test $ac_have_mesa_gl = no ; then
+ if test "$ac_have_mesa_gl" = no ; then
gl_lib_1="GL"
GL_LIBS="-lGL -lGLU"
else
# If it's MesaGL, we'd like to issue a warning if the version number
# is less than or equal to 2.6, because that version had a security bug.
#
- if test $ac_have_mesa_gl = yes; then
+ if test "$ac_have_mesa_gl" = yes; then
# don't cache these.
unset ac_cv_mesagl_version
unset ac_cv_mesagl_version_string
echo $ac_n "checking MesaGL version number""... $ac_c" 1>&6
-echo "configure:5325: checking MesaGL version number" >&5
+echo "configure:5332: checking MesaGL version number" >&5
if eval "test \"`echo '$''{'ac_cv_mesagl_version_string'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5330 "configure"
+#line 5337 "configure"
#include "confdefs.h"
#include <GL/gl.h>
#configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
EOF
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | sed -n \
's/^#configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
+ rm -f conftest.$ac_ext
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+
if test "$mglv" = ""; then
ac_mesagl_version=unknown
ac_mesagl_version_string=unknown
maj=`echo $mglv | sed -n 's/\..*//p'`
min=`echo $mglv | sed -n 's/.*\.//p'`
ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
+ if test -z "$ac_mesagl_version"; then
+ ac_mesagl_version=unknown
+ ac_mesagl_version_string=unknown
+ fi
fi
ac_cv_mesagl_version=$ac_mesagl_version
ac_cv_mesagl_version_string=$ac_mesagl_version_string
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
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
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
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS"
+
echo $ac_n "checking for glBindTexture in -l$gl_lib_1""... $ac_c" 1>&6
-echo "configure:5377: checking for glBindTexture in -l$gl_lib_1" >&5
+echo "configure:5398: checking for glBindTexture in -l$gl_lib_1" >&5
ac_lib_var=`echo $gl_lib_1'_'glBindTexture | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5385 "configure"
+#line 5406 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
glBindTexture()
; return 0; }
EOF
-if { (eval echo configure:5396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5417: \"$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
-elif test $with_gl != no; then
+elif test "$with_gl" != no; then
echo "error: must be yes or no: --with-gl=$with_gl"
exit 1
fi
/*)
echo $ac_n "checking for XReadDisplay headers""... $ac_c" 1>&6
-echo "configure:5450: checking for XReadDisplay headers" >&5
+echo "configure:5471: checking for XReadDisplay headers" >&5
d=$with_readdisplay/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for XReadDisplay libs""... $ac_c" 1>&6
-echo "configure:5460: checking for XReadDisplay libs" >&5
+echo "configure:5481: checking for XReadDisplay libs" >&5
d=$with_readdisplay/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
withval=
-if test $with_readdisplay = yes; then
+if test "$with_readdisplay" = yes; then
ac_save_CPPFLAGS="$CPPFLAGS"
if test \! -z "$includedir" ; then
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6
-echo "configure:5498: checking for X11/extensions/readdisplay.h" >&5
+echo "configure:5519: 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 5503 "configure"
+#line 5524 "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:5508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5529: \"$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="$ac_save_CPPFLAGS"
-elif test $with_readdisplay != no; then
+elif test "$with_readdisplay" != no; then
echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
exit 1
fi
/*)
echo $ac_n "checking for Iris Video headers""... $ac_c" 1>&6
-echo "configure:5559: checking for Iris Video headers" >&5
+echo "configure:5580: checking for Iris Video headers" >&5
d=$with_sgivideo/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for Iris Video libs""... $ac_c" 1>&6
-echo "configure:5569: checking for Iris Video libs" >&5
+echo "configure:5590: checking for Iris Video libs" >&5
d=$with_sgivideo/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
withval=
-if test $with_sgivideo = yes; then
+if test "$with_sgivideo" = yes; then
ac_save_CPPFLAGS="$CPPFLAGS"
if test \! -z "$includedir" ; then
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:5607: checking for dmedia/vl.h" >&5
+echo "configure:5628: 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 5612 "configure"
+#line 5633 "configure"
#include "confdefs.h"
#include <dmedia/vl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5638: \"$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="$ac_save_CPPFLAGS"
- if test $have_sgivideo = yes; then
+ if test "$have_sgivideo" = yes; then
have_sgivideo=no
echo $ac_n "checking for vlOpenVideo in -lvl""... $ac_c" 1>&6
-echo "configure:5642: checking for vlOpenVideo in -lvl" >&5
+echo "configure:5663: 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 5650 "configure"
+#line 5671 "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:5661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5682: \"$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
fi
- if test $have_sgivideo = yes; then
+ if test "$have_sgivideo" = yes; then
SGI_VIDEO_OBJS="$(UTILS_BIN)/sgivideo.o"
SGI_VIDEO_LIBS="-lvl"
cat >> confdefs.h <<\EOF
fi
fi
-elif test $with_sgivideo != no; then
+elif test "$with_sgivideo" != no; then
echo "error: must be yes or no: --with-sgivideo=$with_sgivideo"
exit 1
fi
case "$with_zippy_req" in
/*)
echo $ac_n "checking for $with_zippy_req""... $ac_c" 1>&6
-echo "configure:5729: checking for $with_zippy_req" >&5
+echo "configure:5750: 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:5743: checking for $ac_word" >&5
+echo "configure:5764: 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:5789: checking for $ac_word" >&5
+echo "configure:5810: 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:5822: checking for $ac_word" >&5
+echo "configure:5843: 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:5856: checking for emacs yow" >&5
+echo "configure:5877: checking for emacs yow" >&5
#
# get emacs to tell us where the libexec directory is.
#
#
# try running libexec/yow and see if it exits without error.
#
- if test x"$dir" != x -a -x $dir/yow ; then
+ if test x"$dir" != x -a -x "$dir/yow" ; then
if $dir/yow >&- 2>&- ; then
ac_cv_zippy_program="$dir/yow"
echo "$ac_t""$ac_cv_zippy_program" 1>&6
if test -z "$ac_cv_zippy_program" ; then
echo $ac_n "checking for xemacs yow""... $ac_c" 1>&6
-echo "configure:5878: checking for xemacs yow" >&5
+echo "configure:5899: checking for xemacs yow" >&5
if test -n "$xemacs_exe" ; then
#
# get xemacs to tell us where the libexec directory is.
#
# try running libexec/yow and see if it exits without error.
#
- if test x"$dir" != x -a -x $dir/yow ; then
+ if test x"$dir" != x -a -x "$dir/yow" ; then
if $dir/yow >&- 2>&- ; then
ac_cv_zippy_program="$dir/yow"
echo "$ac_t""$ac_cv_zippy_program" 1>&6
# 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:5924: checking for $ac_word" >&5
+echo "configure:5945: 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:5959: checking for $ac_word" >&5
+echo "configure:5980: 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
enable_locking=yes
fi
-if test $enable_locking = yes; then
+if test "$enable_locking" = yes; then
true
-elif test $enable_locking = no; then
+elif test "$enable_locking" = no; then
cat >> confdefs.h <<\EOF
#define NO_LOCKING 1
EOF
enable_vt_locking=yes
fi
-if test $enable_vt_locking = yes; then
+if test "$enable_vt_locking" = yes; then
- echo $ac_n "checking for VT_LOCKSWITCH ioctl""... $ac_c" 1>&6
-echo "configure:6052: checking for VT_LOCKSWITCH ioctl" >&5
+ echo $ac_n "checking for the VT_LOCKSWITCH ioctl""... $ac_c" 1>&6
+echo "configure:6073: checking for the VT_LOCKSWITCH ioctl" >&5
if eval "test \"`echo '$''{'ac_cv_vt_lockswitch'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6057 "configure"
+#line 6078 "configure"
#include "confdefs.h"
#include <fcntl.h>
#include <sys/ioctl.h>
int x = VT_LOCKSWITCH; int y = VT_UNLOCKSWITCH;
; return 0; }
EOF
-if { (eval echo configure:6066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_vt_lockswitch=yes
else
ac_vt_lockswitch=$ac_cv_vt_lockswitch
echo "$ac_t""$ac_vt_lockswitch" 1>&6
-elif test $enable_locking = no; then
+elif test "$enable_locking" = no; then
true
else
echo "error: must be yes or no: --enable-vt-locking=$enable_vt_locking"
exit 1
fi
-if test $ac_vt_lockswitch = yes; then
+if test "$ac_vt_lockswitch" = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_VT_LOCKSWITCH 1
EOF
# the VT_LOCKSWITCH ioctl can only be used when running as root.
- need_setuid=yes
+ # #### but it doesn't work yet, so don't worry about that for now.
+# need_setuid=yes
fi
-if test $enable_locking = yes; then
+if test "$enable_locking" = yes; then
# Check for Kerberos.
#
/*)
echo $ac_n "checking for Kerberos headers""... $ac_c" 1>&6
-echo "configure:6119: checking for Kerberos headers" >&5
+echo "configure:6141: checking for Kerberos headers" >&5
d=$with_kerberos/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for Kerberos libs""... $ac_c" 1>&6
-echo "configure:6129: checking for Kerberos libs" >&5
+echo "configure:6151: checking for Kerberos libs" >&5
d=$with_kerberos/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
withval=
- if test $with_kerberos = yes; then
+ if test "$with_kerberos" = yes; then
echo $ac_n "checking for Kerberos""... $ac_c" 1>&6
-echo "configure:6160: checking for Kerberos" >&5
+echo "configure:6182: 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 6171 "configure"
+#line 6193 "configure"
#include "confdefs.h"
#include <krb.h>
int main() {
; return 0; }
EOF
-if { (eval echo configure:6178: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6200: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_kerberos=yes
else
fi
echo "$ac_t""$ac_cv_kerberos" 1>&6
- if test $ac_cv_kerberos = yes ; then
+ if test "$ac_cv_kerberos" = yes ; then
have_kerberos=yes
cat >> confdefs.h <<\EOF
#define HAVE_KERBEROS 1
# from Tim Showalter <tjs+@andrew.cmu.edu>
PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes"
echo $ac_n "checking for res_search""... $ac_c" 1>&6
-echo "configure:6202: checking for res_search" >&5
+echo "configure:6224: checking for res_search" >&5
if eval "test \"`echo '$''{'ac_cv_func_res_search'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6207 "configure"
+#line 6229 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char res_search(); below. */
; return 0; }
EOF
-if { (eval echo configure:6230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_res_search=yes"
else
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
-echo "configure:6248: checking for res_search in -lresolv" >&5
+echo "configure:6270: checking for res_search in -lresolv" >&5
ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6256 "configure"
+#line 6278 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
res_search()
; return 0; }
EOF
-if { (eval echo configure:6267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6289: \"$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
- elif test $with_kerberos != no; then
+ elif test "$with_kerberos" != no; then
echo "error: must be yes or no: --with-kerberos=$with_kerberos"
exit 1
fi
/*)
echo $ac_n "checking for shadow password headers""... $ac_c" 1>&6
-echo "configure:6317: checking for shadow password headers" >&5
+echo "configure:6339: checking for shadow password headers" >&5
d=$with_shadow/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for shadow password libs""... $ac_c" 1>&6
-echo "configure:6327: checking for shadow password libs" >&5
+echo "configure:6349: checking for shadow password libs" >&5
d=$with_shadow/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
withval=
- if test $with_shadow = no; then
+ if test "$with_shadow" = no; then
passwd_cruft_done=yes
- elif test $with_shadow != yes; then
+ elif test "$with_shadow" != yes; then
echo "error: must be yes or no: --with-shadow=$with_shadow"
exit 1
fi
# Sun's "adjunct" passwords.
#
- if test $passwd_cruft_done = no ; then
+ if test "$passwd_cruft_done" = no ; then
echo $ac_n "checking for Sun-style shadow passwords""... $ac_c" 1>&6
-echo "configure:6368: checking for Sun-style shadow passwords" >&5
+echo "configure:6390: 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 6379 "configure"
+#line 6401 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
const char *pw = p->pwa_passwd;
; return 0; }
EOF
-if { (eval echo configure:6392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6414: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sun_adjunct=yes
else
fi
echo "$ac_t""$ac_cv_sun_adjunct" 1>&6
- if test $ac_cv_sun_adjunct = yes; then
+ if test "$ac_cv_sun_adjunct" = yes; then
have_shadow=yes
need_setuid=yes
passwd_cruft_done=yes
# DEC and SCO so-called "enhanced" security.
#
- if test $passwd_cruft_done = no ; then
+ if test "$passwd_cruft_done" = no ; then
echo $ac_n "checking for DEC-style shadow passwords""... $ac_c" 1>&6
-echo "configure:6421: checking for DEC-style shadow passwords" >&5
+echo "configure:6443: 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 6432 "configure"
+#line 6454 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
pw = p->ufld.fd_encrypt;
; return 0; }
EOF
-if { (eval echo configure:6449: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6471: \"$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:6475: checking for getprpwnam in -lprot" >&5
+echo "configure:6497: 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 6483 "configure"
+#line 6505 "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:6494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6516: \"$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:6514: checking for getprpwnam in -lsecurity" >&5
+echo "configure:6536: 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 6522 "configure"
+#line 6544 "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:6533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6555: \"$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
# HP's entry in the "Not Invented Here" Sweepstakes.
#
- if test $passwd_cruft_done = no ; then
+ if test "$passwd_cruft_done" = no ; then
echo $ac_n "checking for HP-style shadow passwords""... $ac_c" 1>&6
-echo "configure:6562: checking for HP-style shadow passwords" >&5
+echo "configure:6584: 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 6573 "configure"
+#line 6595 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
const char *pw = p->pw_passwd;
; return 0; }
EOF
-if { (eval echo configure:6586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_hpux_passwd=yes
else
fi
echo "$ac_t""$ac_cv_hpux_passwd" 1>&6
- if test $ac_cv_hpux_passwd = yes; then
+ if test "$ac_cv_hpux_passwd" = yes; then
have_shadow=yes
need_setuid=yes
passwd_cruft_done=yes
# on HPUX, bigcrypt is in -lsec
echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6
-echo "configure:6611: checking for bigcrypt in -lsec" >&5
+echo "configure:6633: 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 6619 "configure"
+#line 6641 "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:6630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6652: \"$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
# Traditional (ha!) shadow passwords.
#
- if test $passwd_cruft_done = no ; then
+ if test "$passwd_cruft_done" = no ; then
echo $ac_n "checking for generic shadow passwords""... $ac_c" 1>&6
-echo "configure:6657: checking for generic shadow passwords" >&5
+echo "configure:6679: 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 6668 "configure"
+#line 6690 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
const char *pw = p->sp_pwdp;
; return 0; }
EOF
-if { (eval echo configure:6680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6702: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_shadow=yes
else
fi
echo "$ac_t""$ac_cv_shadow" 1>&6
- if test $ac_cv_shadow = yes; then
+ if test "$ac_cv_shadow" = yes; then
have_shadow=yes
need_setuid=yes
passwd_cruft_done=yes
# 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:6706: checking for getspnam in -lc" >&5
+echo "configure:6728: 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 6714 "configure"
+#line 6736 "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:6725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6747: \"$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
fi
- if test $have_getspnam = no ; then
+ if test "$have_getspnam" = no ; then
echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
-echo "configure:6747: checking for getspnam in -lgen" >&5
+echo "configure:6769: 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 6755 "configure"
+#line 6777 "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:6766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6788: \"$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
# 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
+ if test "$passwd_cruft_done" = no ; then
echo $ac_n "checking for FreeBSD-style shadow passwords""... $ac_c" 1>&6
-echo "configure:6797: checking for FreeBSD-style shadow passwords" >&5
+echo "configure:6819: 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
fi
echo "$ac_t""$ac_cv_master_passwd" 1>&6
- if test $ac_cv_master_passwd = yes; then
+ if test "$ac_cv_master_passwd" = yes; then
need_setuid=yes
passwd_cruft_done=yes
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:6818: checking for crypt in -lc" >&5
+echo "configure:6840: 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 6826 "configure"
+#line 6848 "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:6837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6859: \"$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
fi
- if test $have_crypt = no ; then
+ if test "$have_crypt" = no ; then
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:6859: checking for crypt in -lcrypt" >&5
+echo "configure:6881: 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 6867 "configure"
+#line 6889 "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:6878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6900: \"$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 they were found. But, on some systems, we need setuid even when
# using plain old vanilla passwords.
#
- if test $need_setuid = no ; then
+ if test "$need_setuid" = no ; then
case "$host" in
*-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
need_setuid=yes
# Done testing things -- now substitute in some stuff for the Makefiles.
#
-if test $have_motif = yes; then
+if test "$have_motif" = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_MOTIF 1
EOF
- DIALOG_SRCS='$(MOTIF_SRCS)'
- DIALOG_OBJS='$(MOTIF_OBJS)'
-elif test $have_athena = yes; then
+ TOOLKIT_SRCS='$(MOTIF_SRCS)'
+ TOOLKIT_OBJS='$(MOTIF_OBJS)'
+elif test "$have_athena" = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_ATHENA 1
EOF
- DIALOG_SRCS='$(ATHENA_SRCS)'
- DIALOG_OBJS='$(ATHENA_OBJS)'
+ TOOLKIT_SRCS='$(ATHENA_SRCS)'
+ TOOLKIT_OBJS='$(ATHENA_OBJS)'
else
- DIALOG_SRCS=''
- DIALOG_OBJS=''
+ TOOLKIT_SRCS=''
+ TOOLKIT_OBJS=''
fi
-if test $have_kerberos = yes; then
+if test "$have_kerberos" = yes; then
PASSWD_SRCS='$(KERBEROS_SRCS)'
PASSWD_OBJS='$(KERBEROS_OBJS)'
else
PASSWD_OBJS='$(PWENT_OBJS)'
fi
-if test $enable_locking = yes; then
+if test "$enable_locking" = yes; then
LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
else
LOCK_OBJS=''
fi
-if test $need_setuid = yes; then
+if test "$need_setuid" = yes; then
NEED_SETUID=yes
INSTALL_SETUID='$(INSTALL) $(SUID_FLAGS)'
else
fi
tab=' '
-if test $have_gl = yes; then
+if test "$have_gl" = yes; then
GL_EXES='$(GL_EXES)'
- GL_KLUDGE_1=${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}' \'
- GL_KLUDGE_2=${tab}
+ GL_KLUDGE=${tab}
else
- GL_KLUDGE_1=${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}'\n'
- GL_KLUDGE_2='!'${tab}
+ GL_KLUDGE=' -'${tab}
fi
warnsep=' #################################################################'
warnpre() {
- if test $warning = no ; then
+ if test "$warning" = no ; then
echo '' ; echo "$warnsep" ; echo ''
warning=yes
fi
warn() {
warnpre
- if test $warning = long ; then echo '' ; fi
+ if test "$warning" = long ; then echo '' ; fi
warning=yes
echo "$warn_prefix $@"
}
was=$warning
warnpre
warning=yes
- if test $was != no ; then echo '' ; fi
+ if test "$was" != no ; then echo '' ; fi
echo "$warn_prefix $@"
}
}
-if test $with_sgi_req = yes -a $have_sgi = no ; then
+if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
warn 'The SGI saver extension was requested, but was not found.'
fi
-if test $with_mit_req = yes -a $have_mit = no ; then
+if test "$with_mit_req" = yes -a "$have_mit" = no ; then
warn 'The MIT saver extension was requested, but was not found.'
fi
-if test $with_xidle_req = yes -a $have_xidle = no ; then
+if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
warn 'The XIdle extension was requested, but was not found.'
fi
-if test $with_xshm_req = yes -a $have_xshm = no ; then
+if test "$with_xshm_req" = yes -a "$have_xshm" = no ; then
warn 'The XSHM extension was requested, but was not found.'
fi
-if test $with_sgivc_req = yes -a $have_sgivc = no ; then
+if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
fi
-if test $with_dpms_req = yes -a $have_dpms = no ; then
+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
+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."
+ warn2 "the \`xscreensaver-demo' program requires one or the"
+ warn2 "other."
proselytize_motif=no
-elif test $with_motif_req = yes -a $have_motif = no ; then
+elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
warnL "Use of Motif was requested, but it wasn't found;"
warn2 "Athena will be used instead."
-elif test $with_athena_req = yes -a $have_athena = no ; then
+elif test "$with_athena_req" = yes -a "$have_athena" = no ; then
warnL "Use of Athena was requested, but it wasn't found;"
warn2 "Motif will be used instead."
fi
-if test $have_motif = yes -a $have_lesstif = yes ; then
+if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
preferred_lesstif=0.86
- if test $lesstif_version = unknown; then
+ if test "$lesstif_version" = unknown; then
warnL "Unable to determine the LessTif version number!"
warn2 "Make sure you are using version $preferred_lesstif or newer."
warn2 "See <http://www.lesstif.org/>."
fi
fi
-if test $proselytize_motif = yes ; then
+if test "$proselytize_motif" = yes ; then
warnL "Athena widgets are being used instead of Motif."
- warn2 "XScreenSaver looks much better with Motif, and has"
- warn2 "a few extra features as well. Wouldn't you rather"
- warn2 "be using Motif? It is shipped by every commercial"
- warn2 "Unix vendor; and there is a free implementation"
- warn2 "available as well: see <http://www.lesstif.org/>."
+ warn2 "The \`xscreensaver-demo' program looks much better"
+ warn2 "with Motif. Wouldn't you rather be using Motif?"
+ warn2 "It is shipped by every commercial Unix vendor;"
+ warn2 "and there is a free implementation available as"
+ warn2 "well: see <http://www.lesstif.org/>."
fi
-if test $have_gl = yes -a $ac_have_mesa_gl = yes ; then
+if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
preferred_mesagl=2.7
- if test $ac_mesagl_version = unknown; then
+ if test "$ac_mesagl_version" = unknown; then
warnL "Unable to determine the MesaGL version number!"
warn2 "Make sure you are using version $preferred_mesagl or newer."
- elif test \! $ac_mesagl_version -gt 2006; then
+ elif test \! "$ac_mesagl_version" -gt 2006; then
warnL "MesaGL version $ac_mesagl_version_string is being used."
warn2 "MesaGL versions 2.6 and earlier have a security bug."
warn2 "It is strongly recommended that you upgrade to at"
fi
-if test $have_xpm = no ; then
- if test $with_xpm_req = yes ; then
+if test "$have_xpm" = no ; then
+ if test "$with_xpm_req" = yes ; then
warnL 'Use of XPM was requested, but it was not found.'
- elif test $with_xpm_req = no ; then
+ elif test "$with_xpm_req" = no ; then
noteL 'The XPM library is not being used.'
else
noteL 'The XPM library was not found.'
warn2 'X11 archive sites, such as <http://sunsite.unc.edu/>.'
fi
-if test $have_gl = no ; then
- if test $with_gl_req = yes ; then
+if test "$have_gl" = no ; then
+ if test "$with_gl_req" = yes ; then
warnL 'Use of GL was requested, but it was not found.'
- elif test $with_gl_req = no ; then
+ elif test "$with_gl_req" = no ; then
noteL 'The OpenGL 3D library is not being used.'
else
noteL 'The OpenGL 3D library was not found.'
fi
-if test $with_readdisplay_req = yes -a $have_readdisplay = no ; then
+if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
warn 'Use of XReadDisplay was requested, but it was not found.'
fi
-if test $with_sgivideo_req = yes -a $have_sgivideo = no ; then
+if test "$with_sgivideo_req" = yes -a "$have_sgivideo" = no ; then
warn 'Use of the Iris Video Library was requested, but it was not found.'
fi
-if test $with_kerberos_req = yes -a $have_kerberos = no ; then
+if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
warn 'Use of Kerberos was requested, but it was not found.'
fi
-if test $with_shadow_req = yes -a $have_shadow = no ; then
+if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
warn 'Use of shadow passwords was requested, but they were not found.'
fi
fi
fi
-if test $warning != no; then
+if test "$warning" != no; then
echo '' ; echo "$warnsep" ; echo ''
fi
s%@fortune@%$fortune%g
s%@INCLUDES@%$INCLUDES%g
s%@SAVER_LIBS@%$SAVER_LIBS%g
+s%@TOOLKIT_LIBS@%$TOOLKIT_LIBS%g
s%@HACK_LIBS@%$HACK_LIBS%g
s%@XPM_LIBS@%$XPM_LIBS%g
s%@GL_LIBS@%$GL_LIBS%g
s%@NEED_SETUID@%$NEED_SETUID%g
s%@SGI_VIDEO_OBJS@%$SGI_VIDEO_OBJS%g
s%@SGI_VIDEO_LIBS@%$SGI_VIDEO_LIBS%g
-s%@DIALOG_SRCS@%$DIALOG_SRCS%g
-s%@DIALOG_OBJS@%$DIALOG_OBJS%g
+s%@TOOLKIT_SRCS@%$TOOLKIT_SRCS%g
+s%@TOOLKIT_OBJS@%$TOOLKIT_OBJS%g
s%@PASSWD_SRCS@%$PASSWD_SRCS%g
s%@PASSWD_OBJS@%$PASSWD_OBJS%g
s%@XMU_SRCS@%$XMU_SRCS%g
s%@LOCK_SRCS@%$LOCK_SRCS%g
s%@LOCK_OBJS@%$LOCK_OBJS%g
s%@GL_EXES@%$GL_EXES%g
-s%@GL_KLUDGE_1@%$GL_KLUDGE_1%g
-s%@GL_KLUDGE_2@%$GL_KLUDGE_2%g
+s%@GL_KLUDGE@%$GL_KLUDGE%g
s%@HACKDIR@%$HACKDIR%g
s%@APPDEFAULTS@%$APPDEFAULTS%g
s%@DEPEND@%$DEPEND%g
echo ""
echo "$warnsep"
echo ""
-echo ' When you run "make install", the "xscreensaver" and'
-echo ' "xscreensaver-command" executables will be installed in'
-echo " ${bindir}."
+echo ' When you run "make install", the "xscreensaver",'
+echo ' "xscreensaver-demo", and "xscreensaver-command" executables'
+echo " will be installed in ${bindir}."
echo ""
echo " The various graphics demos (80+ different executables) will"
echo " be installed in ${HACKDIR}."
#
AC_INIT(driver/subprocs.c)
+
+echo -n "current directory: "
+pwd
+echo "command line was: $0 $@"
+
AC_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
[ac_gettimeofday_args=0])])
ac_cv_gettimeofday_args=$ac_gettimeofday_args])
ac_gettimeofday_args=$ac_cv_gettimeofday_args
-if test $ac_gettimeofday_args = 1 ; then
+if test "$ac_gettimeofday_args" = 1 ; then
AC_DEFINE(HAVE_GETTIMEOFDAY)
AC_MSG_RESULT(one argument)
-elif test $ac_gettimeofday_args = 2 ; then
+elif test "$ac_gettimeofday_args" = 2 ; then
AC_DEFINE(HAVE_GETTIMEOFDAY)
AC_DEFINE(GETTIMEOFDAY_TWO_ARGS)
AC_MSG_RESULT(two arguments)
AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv)
-AC_CHECK_FUNCS(sigaction)
+AC_CHECK_FUNCS(sigaction syslog)
AC_CHECK_HEADERS(unistd.h crypt.h)
AC_DEFUN(AC_CHECK_X_LIB, [
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
+ # note: $X_CFLAGS includes $x_includes
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
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
+ # note: $X_LIBS includes $x_libraries
+ LDFLAGS="$LDFLAGS $X_LIBS"
+
AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5])
CPPFLAGS="$ac_save_CPPFLAGS"
LDFLAGS="$ac_save_LDFLAGS"])
[XPointer foo = (XPointer) 0;],
[ac_cv_xpointer=yes],
[ac_cv_xpointer=no])])
-if test $ac_cv_xpointer != yes; then
+if test "$ac_cv_xpointer" != yes; then
AC_DEFINE(XPointer,[char*])
fi
#
have_xmu=no
AC_CHECK_X_HEADER(X11/Xmu/Error.h, [have_xmu=yes])
-if test $have_xmu = no ; then
+if test "$have_xmu" = no ; then
XMU_SRCS='$(UTILS_SRC)/xmu.c'
XMU_OBJS='$(UTILS_BIN)/xmu.o'
else
# See comp.windows.x FAQ question 124 about _get_wmShellWidgetClass on 4.1.x.
# The right fix is to get OpenWindows 3.0 patches 100512-02 and 100573-03.
#
-if test $have_xmu = yes ; then
+if test "$have_xmu" = yes ; then
case "$host" in
*-sunos4*)
AC_CACHE_CHECK([for the SunOS 4.1.x _get_wmShellWidgetClass bug],
[ac_cv_sunos_xmu_bug=no],
[ac_cv_sunos_xmu_bug=yes])
LDFLAGS="$ac_save_LDFLAGS"])
- if test $ac_cv_sunos_xmu_bug = yes ; then
+ if test "$ac_cv_sunos_xmu_bug" = yes ; then
AC_CACHE_CHECK([whether the compiler understands -static],
ac_cv_ld_static,
[ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -static"
AC_TRY_LINK(,,[ac_cv_ld_static=yes],[ac_cv_ld_static=no])
LDFLAGS="$ac_save_LDFLAGS"])
- if test $ac_cv_ld_static = yes ; then
+ if test "$ac_cv_ld_static" = yes ; then
LDFLAGS="$LDFLAGS -static"
else
LDFLAGS="$LDFLAGS -Bstatic"
HANDLE_X_PATH_ARG(with_sgi, --with-sgi-ext, SGI SCREEN_SAVER)
-if test $with_sgi = yes; then
+if test "$with_sgi" = yes; then
AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h,
[have_sgi=yes
AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)])
-elif test $with_sgi != no; then
+elif test "$with_sgi" != no; then
echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
exit 1
fi
HANDLE_X_PATH_ARG(with_mit, --with-mit-ext, MIT-SCREEN-SAVER)
-if test $have_sgi != yes; then
- if test $with_mit = yes; then
+if test "$have_sgi" != yes; then
+ if test "$with_mit" = yes; then
AC_CHECK_X_HEADER(X11/extensions/scrnsaver.h, [have_mit=yes])
# Now check to see if it's really in the library; XF86Free-3.3 ships
# scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
#
- if test $have_mit = yes; then
+ if test "$have_mit" = yes; then
AC_CHECK_X_LIB(Xext, XScreenSaverRegister, [], [have_mit=no], -lm)
- if test $have_mit = no; then
+ if test "$have_mit" = no; then
# Fuck! Looks like XF86Free-3.3 actually puts it in XExExt instead
# of in Xext. Thank you master, may I have another.
AC_CHECK_X_LIB(XExExt, XScreenSaverRegister,
[], -lX11 -lXext -lm)
fi
- if test $have_mit = no; then
+ if test "$have_mit" = no; then
# Double fuck! Looks like some versions of XFree86 (whichever version
# it is that comes with RedHat Linux 2.0 -- I can't find a version
# number) put this garbage in Xss instead of Xext. Thank you master,
[], -lX11 -lXext -lm)
fi
- if test $have_mit = yes; then
+ if test "$have_mit" = yes; then
AC_DEFINE(HAVE_MIT_SAVER_EXTENSION)
fi
fi
- elif test $with_mit != no; then
+ elif test "$with_mit" != no; then
echo "error: must be yes or no: --with-mit-ext=$with_mit"
exit 1
fi
HANDLE_X_PATH_ARG(with_xidle, --with-xidle-ext, XIDLE)
-if test $with_xidle = yes; then
+if test "$with_xidle" = yes; then
AC_CHECK_X_HEADER(X11/extensions/xidle.h,
[have_xidle=yes
AC_DEFINE(HAVE_XIDLE_EXTENSION)])
-elif test $with_xidle != no; then
+elif test "$with_xidle" != no; then
echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
exit 1
fi
HANDLE_X_PATH_ARG(with_xshm, --with-xshm-ext, XSHM)
-if test $with_xshm = yes; then
+if test "$with_xshm" = yes; then
# first check for Xshm.h.
AC_CHECK_X_HEADER(X11/extensions/XShm.h, [have_xshm=yes])
# if that succeeded, then check for sys/ipc.h.
- if test $have_xshm = yes; then
+ if test "$have_xshm" = yes; then
have_xshm=no
AC_CHECK_X_HEADER(sys/ipc.h, [have_xshm=yes])
fi
# if that succeeded, then check for sys/shm.h.
- if test $have_xshm = yes; then
+ if test "$have_xshm" = yes; then
have_xshm=no
AC_CHECK_X_HEADER(sys/shm.h, [have_xshm=yes])
fi
esac
# if that succeeded, then we've really got it.
- if test $have_xshm = yes; then
+ if test "$have_xshm" = yes; then
AC_DEFINE(HAVE_XSHM_EXTENSION)
fi
-elif test $with_xshm != no; then
+elif test "$with_xshm" != no; then
echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
exit 1
fi
HANDLE_X_PATH_ARG(with_sgivc, --with-sgivc-ext, SGI-VIDEO-CONTROL)
-if test $with_sgivc = yes; then
+if test "$with_sgivc" = yes; then
# first check for XSGIvc.h
AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes])
# if that succeeded, then check for the -lXsgivc
- if test $have_sgivc = yes; then
+ if test "$have_sgivc" = yes; then
have_sgivc=no
AC_CHECK_X_LIB(Xsgivc, XSGIvcQueryGammaMap,
[have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"], [],
fi
# if that succeeded, then we've really got it.
- if test $have_sgivc = yes; then
+ if test "$have_sgivc" = yes; then
AC_DEFINE(HAVE_SGI_VC_EXTENSION)
fi
-elif test $with_sgivc != no; then
+elif test "$with_sgivc" != no; then
echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
exit 1
fi
HANDLE_X_PATH_ARG(with_dpms, --with-dpms-ext, DPMS)
-if test $with_dpms = yes; then
+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
+ if test "$have_dpms" = yes; then
have_dpms=no
AC_CHECK_X_LIB(Xdpms, DPMSInfo,
[have_dpms=yes; SAVER_LIBS="$SAVER_LIBS -lXdpms"], [],
fi
# if that succeeded, then we've really got it.
- if test $have_dpms = yes; then
+ if test "$have_dpms" = yes; then
AC_DEFINE(HAVE_DPMS_EXTENSION)
fi
-elif test $with_dpms != no; then
+elif test "$with_dpms" != no; then
echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
exit 1
fi
HANDLE_X_PATH_ARG(with_athena, --with-athena, Athena)
-if test $with_motif != yes -a $with_motif != no ; then
+if test "$with_motif" != yes -a "$with_motif" != no ; then
echo "error: must be yes or no: --with-motif=$with_motif"
exit 1
fi
-if test $with_athena != yes -a $with_athena != no ; then
+if test "$with_athena" != yes -a "$with_athena" != no ; then
echo "error: must be yes or no: --with-athena=$with_athena"
exit 1
fi
# Saying --without-motif is the same as saying --with-athena.
-if test $with_motif_req = no ; then
+if test "$with_motif_req" = no ; then
with_athena_req=yes
with_athena=yes
fi
# Saying --without-athena is the same as saying --with-motif.
-if test $with_athena_req = no ; then
+if test "$with_athena_req" = no ; then
with_motif_req=yes
with_motif=yes
fi
AC_CHECK_X_HEADER(Xm/Xm.h,
[have_motif=yes
AC_DEFINE(HAVE_MOTIF)
- SAVER_LIBS="-lXm $SAVER_LIBS"])
+ TOOLKIT_LIBS="-lXm $TOOLKIT_LIBS"])
}
check_athena() {
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"
+ if test "$have_athena" = yes; then
+ AC_CHECK_X_LIB(Xaw3d, Xaw3dComputeTopShadowRGB,
+ [have_athena=yes; have_athena3d=yes], [],
+ -lXt -lXmu -lXext -lX11)
+ fi
+
+ if test "$have_athena3d" = yes; then
+ TOOLKIT_LIBS="-lXaw3d $TOOLKIT_LIBS"
+ elif test "$have_athena" = yes; then
+ TOOLKIT_LIBS="-lXaw $TOOLKIT_LIBS"
fi
}
# If they asked for neither, check motif then athena.
proselytize_motif=yes
-if test $with_motif = yes; then
+if test "$with_motif" = yes; then
# asked for both, or for motif only
check_motif
- if test $have_motif = yes; then
+ if test "$have_motif" = yes; then
with_athena=no
with_athena_req=no
else
check_athena
fi
-elif test $with_athena = yes; then
+elif test "$with_athena" = yes; then
# asked for athena only
check_athena
- if test $have_athena = yes; then
+ if test "$have_athena" = yes; then
with_motif=no
proselytize_motif=no
else
else
# asked for neither
check_motif
- if test $have_motif = yes; then
+ if test "$have_motif" = yes; then
with_athena=no
else
check_athena
fi
-if test $have_motif = yes; then
+if test "$have_motif" = yes; then
proselytize_motif=no
fi
# If we have Athena, check whether it's a version that includes
# XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.)
-if test $have_athena = yes ; then
+if test "$have_athena" = yes ; then
AC_CACHE_CHECK([for XawViewportSetCoordinates in Viewport.h],
ac_cv_have_XawViewportSetCoordinates,
[ac_cv_have_XawViewportSetCoordinates=no
AC_EGREP_X_HEADER(XawViewportSetCoordinates,
X11/Xaw/Viewport.h,
ac_cv_have_XawViewportSetCoordinates=yes)])
- if test $ac_cv_have_XawViewportSetCoordinates = yes ; then
+ if test "$ac_cv_have_XawViewportSetCoordinates" = yes ; then
AC_DEFINE(HAVE_XawViewportSetCoordinates)
fi
fi
# If we have Motif, check whether it's really LessTif.
#
have_lesstif=no
-if test $have_motif = yes ; then
+if test "$have_motif" = yes ; then
AC_CACHE_CHECK([whether Motif is really LessTif],
ac_cv_have_lesstif,
[AC_TRY_X_COMPILE([#include <Xm/Xm.h>],
lesstif_version=unknown
lesstif_version_string=unknown
-if test $have_lesstif = yes ; then
+if test "$have_lesstif" = yes ; then
ltv=unknown
echo unknown > conftest-lt
AC_CACHE_CHECK([LessTif version number],
# I have no idea.
#
have_xp_ext=no
-if test $have_motif = yes ; then
+if test "$have_motif" = yes ; then
have_xp_ext=no
AC_CHECK_X_LIB(Xp, XpQueryExtension,
- [have_xp_ext=yes; SAVER_LIBS="$SAVER_LIBS -lXp"],
+ [have_xp_ext=yes; TOOLKIT_LIBS="$TOOLKIT_LIBS -lXp"],
[], -lX11 -lXext -lm)
fi
HANDLE_X_PATH_ARG(with_xpm, --with-xpm, XPM)
-if test $with_xpm = yes; then
+if test "$with_xpm" = yes; then
AC_CHECK_X_HEADER(X11/xpm.h,
[have_xpm=yes
AC_DEFINE(HAVE_XPM)
XPM_LIBS="-lXpm"])
-elif test $with_xpm != no; then
+elif test "$with_xpm" != no; then
echo "error: must be yes or no: --with-xpm=$with_xpm"
exit 1
fi
ac_mesagl_version=unknown
ac_mesagl_version_string=unknown
-if test $with_gl = yes; then
+if test "$with_gl" = yes; then
AC_CHECK_X_HEADER(GL/gl.h, have_gl=yes, have_gl=no)
- if test $have_gl = yes ; then
+ if test "$have_gl" = yes ; then
AC_CHECK_X_HEADER(GL/glx.h, have_gl=yes, have_gl=no)
fi
# If we have the headers, try and figure out which vendor it's from.
#
- if test $have_gl = yes ; then
+ if test "$have_gl" = yes ; then
AC_DEFINE(HAVE_GL)
ac_have_mesa_gl=$ac_cv_have_mesa_gl
AC_MSG_RESULT($ac_have_mesa_gl)
- if test $ac_have_mesa_gl = no ; then
+ if test "$ac_have_mesa_gl" = no ; then
gl_lib_1="GL"
GL_LIBS="-lGL -lGLU"
else
# If it's MesaGL, we'd like to issue a warning if the version number
# is less than or equal to 2.6, because that version had a security bug.
#
- if test $ac_have_mesa_gl = yes; then
+ if test "$ac_have_mesa_gl" = yes; then
# don't cache these.
unset ac_cv_mesagl_version
#configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
EOF
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC | sed -n \
's/^#configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
+ rm -f conftest.$ac_ext
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+
if test "$mglv" = ""; then
ac_mesagl_version=unknown
ac_mesagl_version_string=unknown
maj=`echo $mglv | sed -n 's/\..*//p'`
min=`echo $mglv | sed -n 's/.*\.//p'`
ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
+ if test -z "$ac_mesagl_version"; then
+ ac_mesagl_version=unknown
+ ac_mesagl_version_string=unknown
+ fi
fi
ac_cv_mesagl_version=$ac_mesagl_version
ac_cv_mesagl_version_string=$ac_mesagl_version_string
fi
-elif test $with_gl != no; then
+elif test "$with_gl" != no; then
echo "error: must be yes or no: --with-gl=$with_gl"
exit 1
fi
HANDLE_X_PATH_ARG(with_readdisplay, --with-readdisplay, XReadDisplay)
-if test $with_readdisplay = yes; then
+if test "$with_readdisplay" = yes; then
AC_CHECK_X_HEADER(X11/extensions/readdisplay.h,
AC_DEFINE(HAVE_READ_DISPLAY_EXTENSION))
-elif test $with_readdisplay != no; then
+elif test "$with_readdisplay" != no; then
echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
exit 1
fi
HANDLE_X_PATH_ARG(with_sgivideo, --with-sgivideo, Iris Video)
-if test $with_sgivideo = yes; then
+if test "$with_sgivideo" = yes; then
AC_CHECK_X_HEADER(dmedia/vl.h, have_sgivideo=yes)
- if test $have_sgivideo = yes; then
+ if test "$have_sgivideo" = yes; then
have_sgivideo=no
AC_CHECK_LIB(vl, vlOpenVideo, have_sgivideo=yes)
- if test $have_sgivideo = yes; then
+ if test "$have_sgivideo" = yes; then
SGI_VIDEO_OBJS="$(UTILS_BIN)/sgivideo.o"
SGI_VIDEO_LIBS="-lvl"
AC_DEFINE(HAVE_SGI_VIDEO)
fi
fi
-elif test $with_sgivideo != no; then
+elif test "$with_sgivideo" != no; then
echo "error: must be yes or no: --with-sgivideo=$with_sgivideo"
exit 1
fi
#
# try running libexec/yow and see if it exits without error.
#
- if test x"$dir" != x -a -x $dir/yow ; then
+ if test x"$dir" != x -a -x "$dir/yow" ; then
if $dir/yow >&- 2>&- ; then
ac_cv_zippy_program="$dir/yow"
AC_MSG_RESULT($ac_cv_zippy_program)
#
# try running libexec/yow and see if it exits without error.
#
- if test x"$dir" != x -a -x $dir/yow ; then
+ if test x"$dir" != x -a -x "$dir/yow" ; then
if $dir/yow >&- 2>&- ; then
ac_cv_zippy_program="$dir/yow"
AC_MSG_RESULT($ac_cv_zippy_program)
(this is the default.)
--disable-locking Do not allow locking at all.],
[enable_locking="$enableval"],[enable_locking=yes])
-if test $enable_locking = yes; then
+if test "$enable_locking" = yes; then
true
-elif test $enable_locking = no; then
+elif test "$enable_locking" = no; then
AC_DEFINE(NO_LOCKING)
else
echo "error: must be yes or no: --enable-locking=$enable_locking"
--disable-vt-locking Do not allow locking of VTs, even if locking is
enabled.],
[enable_vt_locking="$enableval"],[enable_vt_locking=yes])
-if test $enable_vt_locking = yes; then
+if test "$enable_vt_locking" = yes; then
- AC_MSG_CHECKING(for VT_LOCKSWITCH ioctl)
+ AC_MSG_CHECKING(for the VT_LOCKSWITCH ioctl)
AC_CACHE_VAL(ac_cv_vt_lockswitch,
[AC_TRY_COMPILE([#include <fcntl.h>
#include <sys/ioctl.h>
ac_vt_lockswitch=$ac_cv_vt_lockswitch
AC_MSG_RESULT($ac_vt_lockswitch)
-elif test $enable_locking = no; then
+elif test "$enable_locking" = no; then
true
else
echo "error: must be yes or no: --enable-vt-locking=$enable_vt_locking"
exit 1
fi
-if test $ac_vt_lockswitch = yes; then
+if test "$ac_vt_lockswitch" = yes; then
AC_DEFINE(HAVE_VT_LOCKSWITCH)
# the VT_LOCKSWITCH ioctl can only be used when running as root.
- need_setuid=yes
+ # #### but it doesn't work yet, so don't worry about that for now.
+# need_setuid=yes
fi
-if test $enable_locking = yes; then
+if test "$enable_locking" = yes; then
# Check for Kerberos.
#
HANDLE_X_PATH_ARG(with_kerberos, --with-kerberos, Kerberos)
- if test $with_kerberos = yes; then
+ if test "$with_kerberos" = yes; then
AC_CACHE_CHECK([for Kerberos], ac_cv_kerberos,
[AC_TRY_X_COMPILE([#include <krb.h>],,
[ac_cv_kerberos=yes],
[ac_cv_kerberos=no])])
- if test $ac_cv_kerberos = yes ; then
+ if test "$ac_cv_kerberos" = yes ; then
have_kerberos=yes
AC_DEFINE(HAVE_KERBEROS)
))
fi
- elif test $with_kerberos != no; then
+ elif test "$with_kerberos" != no; then
echo "error: must be yes or no: --with-kerberos=$with_kerberos"
exit 1
fi
HANDLE_X_PATH_ARG(with_shadow, --with-shadow, shadow password)
- if test $with_shadow = no; then
+ if test "$with_shadow" = no; then
passwd_cruft_done=yes
- elif test $with_shadow != yes; then
+ elif test "$with_shadow" != yes; then
echo "error: must be yes or no: --with-shadow=$with_shadow"
exit 1
fi
# Sun's "adjunct" passwords.
#
- if test $passwd_cruft_done = no ; then
+ if test "$passwd_cruft_done" = no ; then
AC_CACHE_CHECK([for Sun-style shadow passwords], ac_cv_sun_adjunct,
[AC_TRY_X_COMPILE([#include <stdlib.h>
#include <unistd.h>
const char *pw = p->pwa_passwd;],
[ac_cv_sun_adjunct=yes],
[ac_cv_sun_adjunct=no])])
- if test $ac_cv_sun_adjunct = yes; then
+ if test "$ac_cv_sun_adjunct" = yes; then
have_shadow=yes
need_setuid=yes
passwd_cruft_done=yes
# DEC and SCO so-called "enhanced" security.
#
- if test $passwd_cruft_done = no ; then
+ if test "$passwd_cruft_done" = no ; then
AC_CACHE_CHECK([for DEC-style shadow passwords], ac_cv_enhanced_passwd,
[AC_TRY_X_COMPILE([#include <stdlib.h>
#include <unistd.h>
# HP's entry in the "Not Invented Here" Sweepstakes.
#
- if test $passwd_cruft_done = no ; then
+ if test "$passwd_cruft_done" = no ; then
AC_CACHE_CHECK([for HP-style shadow passwords], ac_cv_hpux_passwd,
[AC_TRY_X_COMPILE([#include <stdlib.h>
#include <unistd.h>
const char *pw = p->pw_passwd;],
[ac_cv_hpux_passwd=yes],
[ac_cv_hpux_passwd=no])])
- if test $ac_cv_hpux_passwd = yes; then
+ if test "$ac_cv_hpux_passwd" = yes; then
have_shadow=yes
need_setuid=yes
passwd_cruft_done=yes
# Traditional (ha!) shadow passwords.
#
- if test $passwd_cruft_done = no ; then
+ if test "$passwd_cruft_done" = no ; then
AC_CACHE_CHECK([for generic shadow passwords], ac_cv_shadow,
[AC_TRY_X_COMPILE([#include <stdlib.h>
#include <unistd.h>
const char *pw = p->sp_pwdp;],
[ac_cv_shadow=yes],
[ac_cv_shadow=no])])
- if test $ac_cv_shadow = yes; then
+ if test "$ac_cv_shadow" = yes; then
have_shadow=yes
need_setuid=yes
passwd_cruft_done=yes
# On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
have_getspnam=no
AC_CHECK_LIB(c, getspnam, [have_getspnam=yes])
- if test $have_getspnam = no ; then
+ if test "$have_getspnam" = no ; then
AC_CHECK_LIB(gen, getspnam,
[have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"])
fi
# 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
+ 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
+ if test "$ac_cv_master_passwd" = yes; then
need_setuid=yes
passwd_cruft_done=yes
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])
- if test $have_crypt = no ; then
+ if test "$have_crypt" = no ; then
AC_CHECK_LIB(crypt, crypt,
[have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"])
fi
# if they were found. But, on some systems, we need setuid even when
# using plain old vanilla passwords.
#
- if test $need_setuid = no ; then
+ if test "$need_setuid" = no ; then
case "$host" in
*-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
need_setuid=yes
# Done testing things -- now substitute in some stuff for the Makefiles.
#
-if test $have_motif = yes; then
+if test "$have_motif" = yes; then
AC_DEFINE(HAVE_MOTIF)
- DIALOG_SRCS='$(MOTIF_SRCS)'
- DIALOG_OBJS='$(MOTIF_OBJS)'
-elif test $have_athena = yes; then
+ TOOLKIT_SRCS='$(MOTIF_SRCS)'
+ TOOLKIT_OBJS='$(MOTIF_OBJS)'
+elif test "$have_athena" = yes; then
AC_DEFINE(HAVE_ATHENA)
- DIALOG_SRCS='$(ATHENA_SRCS)'
- DIALOG_OBJS='$(ATHENA_OBJS)'
+ TOOLKIT_SRCS='$(ATHENA_SRCS)'
+ TOOLKIT_OBJS='$(ATHENA_OBJS)'
else
- DIALOG_SRCS=''
- DIALOG_OBJS=''
+ TOOLKIT_SRCS=''
+ TOOLKIT_OBJS=''
fi
-if test $have_kerberos = yes; then
+if test "$have_kerberos" = yes; then
PASSWD_SRCS='$(KERBEROS_SRCS)'
PASSWD_OBJS='$(KERBEROS_OBJS)'
else
PASSWD_OBJS='$(PWENT_OBJS)'
fi
-if test $enable_locking = yes; then
+if test "$enable_locking" = yes; then
LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
else
LOCK_OBJS=''
fi
-if test $need_setuid = yes; then
+if test "$need_setuid" = yes; then
NEED_SETUID=yes
INSTALL_SETUID='$(INSTALL) $(SUID_FLAGS)'
else
fi
tab=' '
-if test $have_gl = yes; then
+if test "$have_gl" = yes; then
GL_EXES='$(GL_EXES)'
- GL_KLUDGE_1=${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}' \'
- GL_KLUDGE_2=${tab}
+ GL_KLUDGE=${tab}
else
- GL_KLUDGE_1=${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}'\n'
- GL_KLUDGE_2='!'${tab}
+ GL_KLUDGE=' -'${tab}
fi
AC_SUBST(INCLUDES)
AC_SUBST(SAVER_LIBS)
+AC_SUBST(TOOLKIT_LIBS)
AC_SUBST(HACK_LIBS)
AC_SUBST(XPM_LIBS)
AC_SUBST(GL_LIBS)
AC_SUBST(SGI_VIDEO_OBJS)
AC_SUBST(SGI_VIDEO_LIBS)
-AC_SUBST(DIALOG_SRCS)
-AC_SUBST(DIALOG_OBJS)
+AC_SUBST(TOOLKIT_SRCS)
+AC_SUBST(TOOLKIT_OBJS)
AC_SUBST(PASSWD_SRCS)
AC_SUBST(PASSWD_OBJS)
AC_SUBST(XMU_SRCS)
AC_SUBST(LOCK_SRCS)
AC_SUBST(LOCK_OBJS)
AC_SUBST(GL_EXES)
-AC_SUBST(GL_KLUDGE_1)
-AC_SUBST(GL_KLUDGE_2)
+AC_SUBST(GL_KLUDGE)
AC_SUBST(HACKDIR)
AC_SUBST(APPDEFAULTS)
warnsep=' #################################################################'
warnpre() {
- if test $warning = no ; then
+ if test "$warning" = no ; then
echo '' ; echo "$warnsep" ; echo ''
warning=yes
fi
warn() {
warnpre
- if test $warning = long ; then echo '' ; fi
+ if test "$warning" = long ; then echo '' ; fi
warning=yes
echo "$warn_prefix $@"
}
was=$warning
warnpre
warning=yes
- if test $was != no ; then echo '' ; fi
+ if test "$was" != no ; then echo '' ; fi
echo "$warn_prefix $@"
}
}
-if test $with_sgi_req = yes -a $have_sgi = no ; then
+if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
warn 'The SGI saver extension was requested, but was not found.'
fi
-if test $with_mit_req = yes -a $have_mit = no ; then
+if test "$with_mit_req" = yes -a "$have_mit" = no ; then
warn 'The MIT saver extension was requested, but was not found.'
fi
-if test $with_xidle_req = yes -a $have_xidle = no ; then
+if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
warn 'The XIdle extension was requested, but was not found.'
fi
-if test $with_xshm_req = yes -a $have_xshm = no ; then
+if test "$with_xshm_req" = yes -a "$have_xshm" = no ; then
warn 'The XSHM extension was requested, but was not found.'
fi
-if test $with_sgivc_req = yes -a $have_sgivc = no ; then
+if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
fi
-if test $with_dpms_req = yes -a $have_dpms = no ; then
+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
+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."
+ warn2 "the \`xscreensaver-demo' program requires one or the"
+ warn2 "other."
proselytize_motif=no
-elif test $with_motif_req = yes -a $have_motif = no ; then
+elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
warnL "Use of Motif was requested, but it wasn't found;"
warn2 "Athena will be used instead."
-elif test $with_athena_req = yes -a $have_athena = no ; then
+elif test "$with_athena_req" = yes -a "$have_athena" = no ; then
warnL "Use of Athena was requested, but it wasn't found;"
warn2 "Motif will be used instead."
fi
-if test $have_motif = yes -a $have_lesstif = yes ; then
+if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
preferred_lesstif=0.86
- if test $lesstif_version = unknown; then
+ if test "$lesstif_version" = unknown; then
warnL "Unable to determine the LessTif version number!"
warn2 "Make sure you are using version $preferred_lesstif or newer."
warn2 "See <http://www.lesstif.org/>."
fi
fi
-if test $proselytize_motif = yes ; then
+if test "$proselytize_motif" = yes ; then
warnL "Athena widgets are being used instead of Motif."
- warn2 "XScreenSaver looks much better with Motif, and has"
- warn2 "a few extra features as well. Wouldn't you rather"
- warn2 "be using Motif? It is shipped by every commercial"
- warn2 "Unix vendor; and there is a free implementation"
- warn2 "available as well: see <http://www.lesstif.org/>."
+ warn2 "The \`xscreensaver-demo' program looks much better"
+ warn2 "with Motif. Wouldn't you rather be using Motif?"
+ warn2 "It is shipped by every commercial Unix vendor;"
+ warn2 "and there is a free implementation available as"
+ warn2 "well: see <http://www.lesstif.org/>."
fi
-if test $have_gl = yes -a $ac_have_mesa_gl = yes ; then
+if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
preferred_mesagl=2.7
- if test $ac_mesagl_version = unknown; then
+ if test "$ac_mesagl_version" = unknown; then
warnL "Unable to determine the MesaGL version number!"
warn2 "Make sure you are using version $preferred_mesagl or newer."
- elif test \! $ac_mesagl_version -gt 2006; then
+ elif test \! "$ac_mesagl_version" -gt 2006; then
warnL "MesaGL version $ac_mesagl_version_string is being used."
warn2 "MesaGL versions 2.6 and earlier have a security bug."
warn2 "It is strongly recommended that you upgrade to at"
fi
-if test $have_xpm = no ; then
- if test $with_xpm_req = yes ; then
+if test "$have_xpm" = no ; then
+ if test "$with_xpm_req" = yes ; then
warnL 'Use of XPM was requested, but it was not found.'
- elif test $with_xpm_req = no ; then
+ elif test "$with_xpm_req" = no ; then
noteL 'The XPM library is not being used.'
else
noteL 'The XPM library was not found.'
warn2 'X11 archive sites, such as <http://sunsite.unc.edu/>.'
fi
-if test $have_gl = no ; then
- if test $with_gl_req = yes ; then
+if test "$have_gl" = no ; then
+ if test "$with_gl_req" = yes ; then
warnL 'Use of GL was requested, but it was not found.'
- elif test $with_gl_req = no ; then
+ elif test "$with_gl_req" = no ; then
noteL 'The OpenGL 3D library is not being used.'
else
noteL 'The OpenGL 3D library was not found.'
fi
-if test $with_readdisplay_req = yes -a $have_readdisplay = no ; then
+if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
warn 'Use of XReadDisplay was requested, but it was not found.'
fi
-if test $with_sgivideo_req = yes -a $have_sgivideo = no ; then
+if test "$with_sgivideo_req" = yes -a "$have_sgivideo" = no ; then
warn 'Use of the Iris Video Library was requested, but it was not found.'
fi
-if test $with_kerberos_req = yes -a $have_kerberos = no ; then
+if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
warn 'Use of Kerberos was requested, but it was not found.'
fi
-if test $with_shadow_req = yes -a $have_shadow = no ; then
+if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
warn 'Use of shadow passwords was requested, but they were not found.'
fi
fi
fi
-if test $warning != no; then
+if test "$warning" != no; then
echo '' ; echo "$warnsep" ; echo ''
fi
echo ""
echo "$warnsep"
echo ""
-echo ' When you run "make install", the "xscreensaver" and'
-echo ' "xscreensaver-command" executables will be installed in'
-echo " ${bindir}."
+echo ' When you run "make install", the "xscreensaver",'
+echo ' "xscreensaver-demo", and "xscreensaver-command" executables'
+echo " will be installed in ${bindir}."
echo ""
echo " The various graphics demos (80+ different executables) will"
echo " be installed in ${HACKDIR}."
INCLUDES = -I. -I$(srcdir) -I$(UTILS_SRC) -I.. @INCLUDES@
-PASSWD_LIBS = @PASSWD_LIBS@
MOTIF_SRCS = dialogs-Xm.c
MOTIF_OBJS = dialogs-Xm.o
TEST_SRCS = test-passwd.c test-uid.c test-xdpms.c
-DIALOG_SRCS = @DIALOG_SRCS@
-DIALOG_OBJS = @DIALOG_OBJS@
+TOOLKIT_SRCS = @TOOLKIT_SRCS@
+TOOLKIT_OBJS = @TOOLKIT_OBJS@
+TOOLKIT_LIBS = @TOOLKIT_LIBS@
+
PASSWD_SRCS = @PASSWD_SRCS@
PASSWD_OBJS = @PASSWD_OBJS@
+PASSWD_LIBS = @PASSWD_LIBS@
+
LOCK_SRCS = @LOCK_SRCS@
LOCK_OBJS = @LOCK_OBJS@
-UTIL_SRCS = $(UTILS_SRC)/fade.c $(UTILS_SRC)/overlay.c \
+SAVER_UTIL_SRCS = $(UTILS_SRC)/fade.c $(UTILS_SRC)/overlay.c \
$(UTILS_SRC)/resources.c $(UTILS_SRC)/usleep.c \
$(UTILS_SRC)/visual.c $(UTILS_SRC)/xroger.c \
- $(UTILS_SRC)/spline.c \
- $(UTILS_SRC)/yarandom.c @XMU_SRCS@
-UTIL_OBJS = $(UTILS_BIN)/fade.o $(UTILS_BIN)/overlay.o \
+ $(UTILS_SRC)/spline.c $(UTILS_SRC)/yarandom.c
+SAVER_UTIL_OBJS = $(UTILS_BIN)/fade.o $(UTILS_BIN)/overlay.o \
$(UTILS_BIN)/resources.o $(UTILS_BIN)/usleep.o \
$(UTILS_BIN)/visual.o $(UTILS_BIN)/xroger.o \
- $(UTILS_BIN)/spline.o \
- $(UTILS_BIN)/yarandom.o @XMU_OBJS@
+ $(UTILS_BIN)/spline.o $(UTILS_BIN)/yarandom.o
+
+DEMO_UTIL_SRCS = $(UTILS_SRC)/resources.c $(UTILS_SRC)/usleep.c \
+ $(UTILS_SRC)/visual.c
+DEMO_UTIL_OBJS = $(UTILS_BIN)/resources.o $(UTILS_BIN)/usleep.o \
+ $(UTILS_BIN)/visual.o
+
+SAVER_SRCS_1 = xscreensaver.c windows.c timers.c subprocs.c \
+ xset.c splash.c setuid.c stderr.c
+SAVER_OBJS_1 = xscreensaver.o windows.o timers.o subprocs.o \
+ xset.o splash.o setuid.o stderr.o
+
+SAVER_SRCS = $(SAVER_SRCS_1) prefs.c $(LOCK_SRCS) \
+ $(SAVER_UTIL_SRCS) @XMU_SRCS@
+SAVER_OBJS = $(SAVER_OBJS_1) prefs.o $(LOCK_OBJS) \
+ $(SAVER_UTIL_OBJS) @XMU_OBJS@
-SAVER_SRCS_1 = demo.c stderr.c subprocs.c setuid.c timers.c windows.c \
- xscreensaver.c splash.c xset.c dotfile.c
-SAVER_OBJS_1 = demo.o stderr.o subprocs.o setuid.o timers.o windows.o \
- xscreensaver.o splash.o xset.o dotfile.o
+CMD_SRCS = remote.c xscreensaver-command.c
+CMD_OBJS = remote.o xscreensaver-command.o
-SAVER_SRCS = $(SAVER_SRCS_1) $(DIALOG_SRCS) $(LOCK_SRCS) $(UTIL_SRCS)
-SAVER_OBJS = $(SAVER_OBJS_1) $(DIALOG_OBJS) $(LOCK_OBJS) $(UTIL_OBJS)
+DEMO_SRCS_1 = demo.c prefs.c
+DEMO_OBJS_1 = demo.o prefs.o
-CMD_SRCS = xscreensaver-command.c
-CMD_OBJS = xscreensaver-command.o
+DEMO_SRCS = $(DEMO_SRCS_1) remote.c \
+ $(TOOLKIT_SRCS) $(DEMO_UTIL_SRCS)
+DEMO_OBJS = $(DEMO_OBJS_1) remote.o \
+ $(TOOLKIT_OBJS) $(DEMO_UTIL_OBJS)
SAVER_LIBS = $(LIBS) $(X_LIBS) @SAVER_LIBS@ \
$(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS) \
$(PASSWD_LIBS)
-CMD_LIBS = $(X_LIBS) $(X_PRE_LIBS) \
- -lX11 -lXext $(X_EXTRA_LIBS) \
- $(LIBS)
+CMD_LIBS = $(LIBS) $(X_LIBS) \
+ $(X_PRE_LIBS) -lX11 -lXext $(X_EXTRA_LIBS)
-EXES = xscreensaver xscreensaver-command
+DEMO_LIBS = $(LIBS) $(X_LIBS) $(TOOLKIT_LIBS) \
+ $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
-HDRS = XScreenSaver_ad.h xscreensaver.h
-MEN = xscreensaver.man xscreensaver-command.man
+EXES = xscreensaver xscreensaver-command xscreensaver-demo
+
+HDRS = XScreenSaver_ad.h xscreensaver.h prefs.h remote.h
+MEN = xscreensaver.man xscreensaver-demo.man \
+ xscreensaver-command.man
EXTRAS = README Makefile.in XScreenSaver.ad.in dialogs.xd .gdbinit
VMSFILES = compile_axp.com compile_decc.com link_axp.com link_decc.com \
vms-getpwnam.c vms-pwd.h vms-hpwd.c vms-validate.c \
TARFILES = $(EXTRAS) $(VMSFILES) $(SAVER_SRCS_1) \
$(MOTIF_SRCS) $(ATHENA_SRCS) $(PWENT_SRCS) $(KERBEROS_SRCS) \
- $(LOCK_SRCS_1) $(CMD_SRCS) $(HDRS) $(TEST_SRCS) $(MEN)
+ $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS) $(HDRS) \
+ $(TEST_SRCS) $(MEN)
all: $(EXES)
$$e " must run 'make install' as 'root', not as '$$me'." ;\
$$e "" ;\
$$e " For now, xscreensaver will be installed non-setuid, which" ;\
- $$e " means that locking might not work." ;\
+ $$e " means that locking might not work. (Try it and see.)" ;\
$$e "" ;\
fi ; \
fi ; \
echo $$inst xscreensaver $(bindir)/xscreensaver ; \
$$inst xscreensaver $(bindir)/xscreensaver
$(INSTALL_PROGRAM) xscreensaver-command $(bindir)/xscreensaver-command
+ $(INSTALL_PROGRAM) xscreensaver-demo $(bindir)/xscreensaver-demo
install-ad: XScreenSaver.ad
@if [ ! -d $(AD_DIR) ]; then $(INSTALL_DIRS) $(AD_DIR) ; fi
-s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
$(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) -- \
$(SAVER_SRCS_1) $(MOTIF_SRCS) $(ATHENA_SRCS) $(PWENT_SRCS) \
- $(LOCK_SRCS_1) $(CMD_SRCS) | \
+ $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS) $(TEST_SRCS) | \
( \
awk '/^# .*Makefile.in ---/,/^# DO .*distdepend/' < Makefile.in ; \
sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d' \
xscreensaver-command: $(CMD_OBJS)
$(CC) $(LDFLAGS) -o $@ $(CMD_OBJS) $(CMD_LIBS)
+xscreensaver-demo: $(DEMO_OBJS)
+ $(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(DEMO_LIBS)
+
-TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PWENT_OBJS) $(DIALOG_OBJS) \
- subprocs.o setuid.o demo.o splash.o \
+
+TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PWENT_OBJS) $(TOOLKIT_OBJS) \
+ subprocs.o setuid.o demo.o splash.o prefs.o \
$(UTIL_OBJS)
test-passwd.o: XScreenSaver_ad.h
test-xdpms: test-xdpms.o
$(CC) $(LDFLAGS) -o $@ test-xdpms.o $(SAVER_LIBS)
+
+# This kludge is so that I can build/test the Athena version of the
+# xscreensaver-demo program without having to re-run configure.
+# Normally it builds it with Motif if possible; this lets me build
+# both.
+#
+xscreensaver-demo-Xaw: $(ATHENA_OBJS) demo-Xaw.o $(DEMO_OBJS)
+ $(CC) $(LDFLAGS) -o $@ demo-Xaw.o prefs.o remote.o \
+ $(ATHENA_OBJS) $(DEMO_UTIL_OBJS) \
+ $(LIBS) $(X_LIBS) -lXaw \
+ $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
+xscreensaver-demo-Xaw3d: $(ATHENA_OBJS) demo-Xaw.o $(DEMO_OBJS)
+ $(CC) $(LDFLAGS) -o $@ demo-Xaw.o prefs.o remote.o \
+ $(ATHENA_OBJS) $(DEMO_UTIL_OBJS) \
+ $(LIBS) $(X_LIBS) -lXaw3d \
+ $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
+demo-Xaw.o: demo.c XScreenSaver_ad.h
+ $(CC) -o $@ -c -DHAVE_ATHENA_KLUDGE \
+ $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) $<
+
+
+
##############################################################################
#
# DO NOT DELETE: updated by make distdepend
# $(srcdir)/DO $(srcdir)/NOT $(srcdir)/DELETE: $(srcdir)/updated $(srcdir)/by $(srcdir)/make $(srcdir)/distdepend
-demo.o: ../config.h
-demo.o: $(srcdir)/xscreensaver.h
-demo.o: $(UTILS_SRC)/resources.h
-stderr.o: ../config.h
-stderr.o: $(srcdir)/xscreensaver.h
-stderr.o: $(UTILS_SRC)/resources.h
-stderr.o: $(UTILS_SRC)/visual.h
-subprocs.o: ../config.h
-subprocs.o: $(srcdir)/xscreensaver.h
-subprocs.o: $(UTILS_SRC)/yarandom.h
-setuid.o: ../config.h
-setuid.o: $(srcdir)/xscreensaver.h
-timers.o: ../config.h
-timers.o: $(srcdir)/xscreensaver.h
-windows.o: ../config.h
-windows.o: $(srcdir)/xscreensaver.h
-windows.o: $(UTILS_SRC)/visual.h
-windows.o: $(UTILS_SRC)/fade.h
xscreensaver.o: ../config.h
xscreensaver.o: $(srcdir)/xscreensaver.h
+xscreensaver.o: $(srcdir)/prefs.h
xscreensaver.o: $(UTILS_SRC)/version.h
xscreensaver.o: $(UTILS_SRC)/yarandom.h
xscreensaver.o: $(UTILS_SRC)/resources.h
xscreensaver.o: $(UTILS_SRC)/visual.h
xscreensaver.o: XScreenSaver_ad.h
+windows.o: ../config.h
+windows.o: $(srcdir)/xscreensaver.h
+windows.o: $(srcdir)/prefs.h
+windows.o: $(UTILS_SRC)/visual.h
+windows.o: $(UTILS_SRC)/fade.h
+timers.o: ../config.h
+timers.o: $(srcdir)/xscreensaver.h
+timers.o: $(srcdir)/prefs.h
+subprocs.o: ../config.h
+subprocs.o: $(srcdir)/xscreensaver.h
+subprocs.o: $(srcdir)/prefs.h
+subprocs.o: $(UTILS_SRC)/yarandom.h
+xset.o: ../config.h
+xset.o: $(srcdir)/xscreensaver.h
+xset.o: $(srcdir)/prefs.h
splash.o: ../config.h
splash.o: $(srcdir)/xscreensaver.h
+splash.o: $(srcdir)/prefs.h
splash.o: $(UTILS_SRC)/resources.h
-xset.o: ../config.h
-xset.o: $(srcdir)/xscreensaver.h
-dotfile.o: ../config.h
-dotfile.o: $(srcdir)/xscreensaver.h
-dotfile.o: $(UTILS_SRC)/resources.h
+setuid.o: ../config.h
+setuid.o: $(srcdir)/xscreensaver.h
+setuid.o: $(srcdir)/prefs.h
+stderr.o: ../config.h
+stderr.o: $(srcdir)/xscreensaver.h
+stderr.o: $(srcdir)/prefs.h
+stderr.o: $(UTILS_SRC)/resources.h
+stderr.o: $(UTILS_SRC)/visual.h
dialogs-Xm.o: ../config.h
dialogs-Xm.o: $(UTILS_SRC)/visual.h
dialogs-Xaw.o: ../config.h
passwd.o: ../config.h
lock.o: ../config.h
lock.o: $(srcdir)/xscreensaver.h
+lock.o: $(srcdir)/prefs.h
lock.o: $(UTILS_SRC)/resources.h
+demo.o: ../config.h
+demo.o: $(UTILS_SRC)/version.h
+demo.o: $(srcdir)/prefs.h
+demo.o: $(UTILS_SRC)/resources.h
+demo.o: $(UTILS_SRC)/visual.h
+demo.o: $(srcdir)/remote.h
+demo.o: XScreenSaver_ad.h
+prefs.o: ../config.h
+prefs.o: $(srcdir)/prefs.h
+prefs.o: $(UTILS_SRC)/resources.h
+remote.o: ../config.h
+remote.o: $(srcdir)/remote.h
xscreensaver-command.o: ../config.h
+xscreensaver-command.o: $(srcdir)/remote.h
xscreensaver-command.o: $(UTILS_SRC)/version.h
+test-passwd.o: ../config.h
+test-passwd.o: $(srcdir)/xscreensaver.h
+test-passwd.o: $(srcdir)/prefs.h
+test-passwd.o: $(UTILS_SRC)/resources.h
+test-passwd.o: $(UTILS_SRC)/version.h
+test-passwd.o: XScreenSaver_ad.h
+test-uid.o: ../config.h
+test-xdpms.o: ../config.h
! a screen saver and locker for the X window system
! by Jamie Zawinski
!
-! version 2.34
-! 08-Oct-98
+! version 3.01
+! 24-Oct-98
!
! See "man xscreensaver" for more info. The latest version is always
! available at http://www.jwz.org/xscreensaver/
+
+! These resources, when placed in the system-wide app-defaults directory
+! (e.g., /usr/lib/X11/app-defaults/XScreenSaver) will provide the default
+! settings for new users. However, if you have a ".xscreensaver" file in
+! your home directory, the settings in that file take precedence.
+
+
*timeout: 10
*cycle: 10
*lockTimeout: 0
*overlayStderr: True
*font: *-medium-r-*-140-*-m-*
+! This is what the "Demo" button on the splash screen runs (/bin/sh syntax.)
+*demoCommand: xscreensaver-demo
+
+! This is what the "Prefs" button on the splash screen runs (/bin/sh syntax.)
+*prefsCommand: xscreensaver-demo -prefs
+
! This is the URL that the "Help" button on the splash screen loads.
*helpURL: http://www.jwz.org/xscreensaver/man.html
-! This is how the "Help" button loads URLs (in /bin/sh syntax.)
-*loadURL: netscape -remote 'openURL(%s)' || netscape '%s' &
+! This is how the "Help" button loads URLs (/bin/sh syntax.)
+! The "helpURL" will be substituted for up to two occurrences of "%s".
+*loadURL: netscape -remote 'openURL(%s)' || netscape '%s'
! Turning on "installColormap" interacts erratically with twm and tvtwm,
!
! Each line is an `sh' command.
!
-! But, if the first word on the line is the name of a visual followed by a
+! If the first (non-blank) character on the line is "-", then that means
+! that this command is disabled: it's still in the list, but it won't ever
+! be used. (This is just to make it easy to disable and then re-enable
+! them later.)
+!
+! If the first word on the line is the name of a visual followed by a
! colon, then that visual will be used for the program, if it is available.
! If no such visual is available, then the program will be skipped. In
! this way, you can specify that you want certain programs to run only
jigsaw -root \n\
blitspin -root -grab \n\
slip -root \n\
+ distort -root \n\
hypercube -root \n\
halo -root \n\
maze -root \n\
vines -root \n\
kaleidescope -root \n\
xjack -root \n\
+ - xlyap -root -randomize \n\
cynosure -root \n\
flow -root \n\
epicycle -root \n\
crystal -root \n\
discrete -root \n\
kumppa -root \n\
+ rd-bomb -root \n\
+ rd-bomb -root -speed 1 -size 0.1 \n\
\
mono: rocks -root \n\
color: rocks -root -fg darksalmon \n\
color: attraction -root -glow -points 10 \n\
color: bubbles -root \n\
\
- color: rd-bomb -root \n\
- color: rd-bomb -root -speed 1 -size 0.1 \n\
- \
PseudoColor: qix -root -count 4 -solid -transparent \n\
PseudoColor: qix -root -count 5 -solid -transparent -linear \
-segments 250 -size 100 \n\
-@GL_KLUDGE_1@
-@GL_KLUDGE_2@ gears -root \n\
-@GL_KLUDGE_2@ superquadrics -root \n\
-@GL_KLUDGE_2@ morph3d -root \n\
-@GL_KLUDGE_2@ cage -root \n\
-@GL_KLUDGE_2@ moebius -root \n\
-@GL_KLUDGE_2@ stairs -root \n\
-@GL_KLUDGE_2@ pipes -root \n\
-@GL_KLUDGE_2@ sproingies -root \n\
-@GL_KLUDGE_2@ rubik -root \n\
-@GL_KLUDGE_2@ atlantis -root \n\
-@GL_KLUDGE_2@ lament -root \n\
-@GL_KLUDGE_2@ bubble3d -root \n\
-@GL_KLUDGE_2@ glplanet -root \n
+ \
+@GL_KLUDGE@ gears -root \n\
+@GL_KLUDGE@ superquadrics -root \n\
+@GL_KLUDGE@ morph3d -root \n\
+@GL_KLUDGE@ cage -root \n\
+@GL_KLUDGE@ moebius -root \n\
+@GL_KLUDGE@ stairs -root \n\
+@GL_KLUDGE@ pipes -root \n\
+@GL_KLUDGE@ sproingies -root \n\
+@GL_KLUDGE@ rubik -root \n\
+@GL_KLUDGE@ atlantis -root \n\
+@GL_KLUDGE@ lament -root \n\
+@GL_KLUDGE@ bubble3d -root \n\
+@GL_KLUDGE@ glplanet -root \n
! A few of the hacks require OpenGL, and will only be built if you have it.
!=============================================================================
-! Resources for the password and splash-screen dialog boxes.
+XScreenSaver.pointerPollTime: 5
+XScreenSaver.initialDelay: 0
+XScreenSaver.windowCreationTimeout: 30
+XScreenSaver.bourneShell: /bin/sh
+
+
+! Resources for the password and splash-screen dialog boxes of
+! the "xscreensaver" daemon.
!
*Dialog.headingFont: *-times-bold-r-*-*-*-180-*-*-*-iso8859-1
*Dialog.bodyFont: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1
*splash.help.label: Help
-! Resources for the Motif dialog boxes:
+! Resources for the Motif dialog boxes of the "xscreensaver-demo" program.
!
*fontList: *-helvetica-medium-r-*-*-*-120-*-*-*-iso8859-1
*demoDialog*label1.fontList: *-helvetica-medium-r-*-*-*-140-*-*-*-iso8859-1
*XmTextField.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1
-*splashDialog*fontList: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1
-*splashDialog*splashLabel1.fontList: *-times-bold-r-*-*-*-180-*-*-*-iso8859-1
-*splashDialog*splashLabel2.fontList: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1
-*splashDialog*splashLabel3.fontList: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1
+*label0.fontList: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1
XScreenSaver*XmList.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1
! Need to fully-qualify the preceeding in the case of of *sgiMode.
*XmDialogShell*demoList.foreground: #000000
*XmDialogShell*demoList.background: #FFFFFF
-! Need to fully-qualify the following in the case of of *sgiMode.
-XScreenSaver*XmDialogShell*rogerLabel.foreground: #CD0000
-XScreenSaver*XmDialogShell*rogerLabel.background: #FFFFFF
-
*XmDialogShell.title: XScreenSaver
+*versionWarning_popup.title: XScreenSaver Warning
+*demoForm_popup.title: XScreenSaver Demo
+*preferencesForm_popup.title: XScreenSaver Preferences
*allowShellResize: True
*autoUnmanage: False
*next.labelString: Run Next
*prev.labelString: Run Previous
*edit.labelString: Preferences
-*done.labelString: Exit Demo Mode
*restart.labelString: Reinitialize
+*done.labelString: Quit
-*resourcesLabel.labelString: XScreenSaver Parameters
+*preferencesLabel.labelString: XScreenSaver Parameters
*timeoutLabel.labelString: Saver Timeout
*cycleLabel.labelString: Cycle Timeout
*fadeTicksLabel.labelString: Fade Ticks
*lockLabel.labelString: Lock Timeout
*passwdLabel.labelString: Password Timeout
-*resourcesForm*XmTextField.columns: 8
+*preferencesForm*XmTextField.columns: 8
*verboseToggle.labelString: Verbose
*cmapToggle.labelString: Install Colormap
*fadeToggle.labelString: Fade Colormap
*unfadeToggle.labelString: Unfade Colormap
*lockToggle.labelString: Require Password
-*resourcesDone.labelString: OK
-*resourcesCancel.labelString: Cancel
-
-*splashDialog.title: XScreenSaver
-*splashLabel1.labelString: XScreenSaver %s
-*splashLabel2.labelString: Copyright © 1991-1998 by
-*splashLabel3.labelString: Jamie Zawinski <jwz@jwz.org>
-*splashDemo.labelString: Demo
-*splashPrefs.labelString: Prefs
-*splashDialog*Help.labelString: Help
-
-*splashLabel1.alignment: ALIGNMENT_CENTER
-*splashLabel2.alignment: ALIGNMENT_CENTER
-*splashLabel3.alignment: ALIGNMENT_CENTER
+*preferencesDone.labelString: OK
+*preferencesCancel.labelString: Cancel
-*splashDialog.borderWidth: 1
-*splashForm.shadowThickness: 4
! Disable Motif drag-and-drop in dialog boxes. This is kind of pathetic, but
! in some older versions of Motif, most any attempt to drag cause immediate
! flaming death from above. This *should* rip the legs off that bug.
+! (But sadly, Lesstif 0.86 and earlier ignore these resources *and* have
+! buggy drag-and-drop.)
!
XScreenSaver*dragInitiatorProtocolStyle: DRAG_NONE
XScreenSaver*dragReceiverProtocolStyle: DRAG_NONE
-! Resources for the dialog boxes using the abominable Athena widgets:
+! Resources for the Athena dialog boxes of the "xscreensaver-demo" program.
!
+*demo_dialog.title: XScreenSaver Demo
+*preferences_dialog.title: XScreenSaver Preferences
+*warning_dialog.title: XScreenSaver Warning
+
+! For some reason, it doesn't size correctly by itself.
+*demo_dialog.geometry: =640x400
+
*demo_dialog*font: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1
-*resources_dialog*font: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1
-*splash_dialog*font: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1
-*splash_dialog*splashLabel1.font: *-times-bold-r-*-*-*-180-*-*-*-iso8859-1
-*splash_dialog*splashLabel2.font: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1
-*splash_dialog*splashLabel3.font: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1
+*preferences_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
-XScreenSaver.demo_dialog*List.font: \
+*preferences_dialog*label1.font:*-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1
+XScreenSaver*warning_dialog*label0.font: \
+ *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1
+XScreenSaver*warning_dialog*Label.font: \
+ *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1
+XScreenSaver*warning_dialog*Command.font: \
+ *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1
+XScreenSaver.demo_dialog*List.font: \
*-courier-medium-r-*-*-*-120-*-*-*-iso8859-1
-XScreenSaver.demo_dialog*Text*font: \
+XScreenSaver.demo_dialog*Text*font: \
*-courier-medium-r-*-*-*-120-*-*-*-iso8859-1
XScreenSaver.demo_dialog*foreground: #000000
XScreenSaver.demo_dialog*Command.background: #D9D9D9
XScreenSaver.demo_dialog*Text*background: #FFFFFF
-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
+XScreenSaver.preferences_dialog*foreground: #000000
+XScreenSaver.preferences_dialog*background: #E5E5E5
+XScreenSaver.preferences_dialog*Command.background: #D9D9D9
+XScreenSaver.preferences_dialog*Toggle.background: #D9D9D9
+XScreenSaver.preferences_dialog*Text*background: #FFFFFF
-*resources_dialog*Dialog.value.translations: #override\n\
- <Key>Return: beginning-of-line()\n
+XScreenSaver.warning_dialog*foreground: #000000
+XScreenSaver.warning_dialog*background: #E5E5E5
+XScreenSaver.warning_dialog*Command.background: #D9D9D9
-XScreenSaver.splash_dialog*foreground: #000000
-XScreenSaver.splash_dialog*background: #E5E5E5
-XScreenSaver.splash_dialog*Command.background: #D9D9D9
-XScreenSaver.splash_dialog*Text*background: #FFFFFF
-XScreenSaver.splash_dialog*roger.foreground: #CD0000
-XScreenSaver.splash_dialog*roger.background: #FFFFFF
+*preferences_dialog*Dialog.value.translations: #override\n\
+ <Key>Return: beginning-of-line()\n
*demo_dialog*viewport.height: 200
*Form.borderWidth: 0
*Box.borderWidth: 0
*Label.borderWidth: 0
-*resources_dialog*Dialog.borderWidth: 0
+*preferences_dialog*Dialog.borderWidth: 0
*demo_dialog*next.label: Run Next
*demo_dialog*prev.label: Run Previous
*demo_dialog*edit.label: Preferences
-*demo_dialog*done.label: Exit Demo Mode
*demo_dialog*restart.label: Reinitialize
+*demo_dialog*done.label: Quit
XScreenSaver.demo_dialog*Command.internalWidth: 10
XScreenSaver.demo_dialog*Command.internalHeight: 4
-*resources_dialog*timeout.label: Saver Timeout:
-*resources_dialog*cycle.label: Cycle Timeout:
-*resources_dialog*fade.label: Fade Duration:
-*resources_dialog*ticks.label: Fade Ticks:
-*resources_dialog*lockTime.label: Lock Timeout:
-*resources_dialog*passwdTime.label: Password Timeout:
-
-*resources_dialog*label1.label: XScreenSaver Parameters
-*resources_dialog*buttonbox.verbose.label: Verbose
-*resources_dialog*buttonbox.cmap.label: Install Colormap
-*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: OK
-*resources_dialog*cancel.label: Cancel
-
-*splash_dialog*splashLabel1.label: XScreenSaver %s
-*splash_dialog*splashLabel2.label: Copyright © 1991-1998 by
-*splash_dialog*splashLabel3.label: Jamie Zawinski <jwz@jwz.org>
-*splash_dialog*splash_form*label.label:
-*splash_dialog*Dialog.label:
-*splash_dialog*splash_form.borderWidth: 0
-*splash_dialog*roger.width: 150
-*splash_dialog*roger.height: 150
-*splash_dialog*roger.borderWidth: 1
-*splash_dialog*demo.label: Demo
-*splash_dialog*prefs.label: Prefs
-*splash_dialog*help.label: Help
-*splash_dialog.box.defaultDistance: 0
-*splash_dialog*splashLabel1.internalHeight: 10
-*splash_dialog*splashLabel1.internalWidth: 10
-*splash_dialog*splashLabel2.internalHeight: 0
-*splash_dialog*splashLabel3.internalHeight: 0
-
-
-
-! You probably won't need to change these. They are only used if no server
-! extension is in use.
-!
-XScreenSaver.pointerPollTime: 5
-XScreenSaver.initialDelay: 0
-XScreenSaver.windowCreationTimeout: 30
-XScreenSaver.bourneShell: /bin/sh
+*preferences_dialog*timeout.label: Saver Timeout:
+*preferences_dialog*cycle.label: Cycle Timeout:
+*preferences_dialog*fade.label: Fade Duration:
+*preferences_dialog*ticks.label: Fade Ticks:
+*preferences_dialog*lockTime.label: Lock Timeout:
+*preferences_dialog*passwdTime.label: Password Timeout:
+XScreenSaver.preferences_dialog*Command.internalWidth: 10
+XScreenSaver.preferences_dialog*Command.internalHeight: 4
+
+*preferences_dialog*label1.label: XScreenSaver Parameters
+*preferences_dialog*buttonbox.verbose.label: Verbose
+*preferences_dialog*buttonbox.cmap.label: Install Colormap
+*preferences_dialog*buttonbox.fade.label: Fade Colormap
+*preferences_dialog*buttonbox.unfade.label: Unfade Colormap
+*preferences_dialog*buttonbox.lock.label: Require Password
+*preferences_dialog*done.label: Ok
+*preferences_dialog*cancel.label: Cancel
+
+*warning_dialog*ok.label: Ok
+
+*warning_dialog*horizDistance: 30
+*warning_dialog*vertDistance: 0
+
+*warning_dialog*Label.internalWidth: 1
+*warning_dialog*Label.internalHeight: 0
+
+*warning_dialog*label0.horizDistance: 80
+*warning_dialog*label0.vertDistance: 20
+
+*warning_dialog*Command.horizDistance: 160
+*warning_dialog*Command.vertDistance: 20
+*warning_dialog*Command.internalWidth: 20
+*warning_dialog*Command.internalHeight: 5
"*overlayTextBackground: #000000",
"*overlayStderr: True",
"*font: *-medium-r-*-140-*-m-*",
+"*demoCommand: xscreensaver-demo",
+"*prefsCommand: xscreensaver-demo -prefs",
"*helpURL: http://www.jwz.org/xscreensaver/man.html",
-"*loadURL: netscape -remote 'openURL(%s)' || netscape '%s' &",
+"*loadURL: netscape -remote 'openURL(%s)' || netscape '%s'",
"*installColormap: True",
"*programs: qix -root -solid -delay 0 -segments 100 \\n\
attraction -root -mode balls \\n\
jigsaw -root \\n\
blitspin -root -grab \\n\
slip -root \\n\
+ distort -root \\n\
hypercube -root \\n\
halo -root \\n\
maze -root \\n\
vines -root \\n\
kaleidescope -root \\n\
xjack -root \\n\
+ - xlyap -root -randomize \\n\
cynosure -root \\n\
flow -root \\n\
epicycle -root \\n\
crystal -root \\n\
discrete -root \\n\
kumppa -root \\n\
+ rd-bomb -root \\n\
+ rd-bomb -root -speed 1 -size 0.1 \\n\
\
mono: rocks -root \\n\
color: rocks -root -fg darksalmon \\n\
color: attraction -root -glow -points 10 \\n\
color: bubbles -root \\n\
\
- color: rd-bomb -root \\n\
- color: rd-bomb -root -speed 1 -size 0.1 \\n\
- \
PseudoColor: qix -root -count 4 -solid -transparent \\n\
PseudoColor: qix -root -count 5 -solid -transparent -linear \
-segments 250 -size 100 \\n\
bubble3d -root \\n\
glplanet -root \\n",
" ",
+"XScreenSaver.pointerPollTime: 5",
+"XScreenSaver.initialDelay: 0",
+"XScreenSaver.windowCreationTimeout: 30",
+"XScreenSaver.bourneShell: /bin/sh",
"*Dialog.headingFont: *-times-bold-r-*-*-*-180-*-*-*-iso8859-1",
"*Dialog.bodyFont: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1",
"*Dialog.labelFont: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1",
"*fontList: *-helvetica-medium-r-*-*-*-120-*-*-*-iso8859-1",
"*demoDialog*label1.fontList: *-helvetica-medium-r-*-*-*-140-*-*-*-iso8859-1",
"*XmTextField.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1",
-"*splashDialog*fontList: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1",
-"*splashDialog*splashLabel1.fontList: *-times-bold-r-*-*-*-180-*-*-*-iso8859-1",
-"*splashDialog*splashLabel2.fontList: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1",
-"*splashDialog*splashLabel3.fontList: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1",
+"*label0.fontList: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1",
"XScreenSaver*XmList.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1",
"*XmDialogShell*foreground: #000000",
"*XmDialogShell*background: #E5E5E5",
"*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",
+"*versionWarning_popup.title: XScreenSaver Warning",
+"*demoForm_popup.title: XScreenSaver Demo",
+"*preferencesForm_popup.title: XScreenSaver Preferences",
"*allowShellResize: True",
"*autoUnmanage: False",
"*demoDialog.maxWidth: 600",
"*next.labelString: Run Next",
"*prev.labelString: Run Previous",
"*edit.labelString: Preferences",
-"*done.labelString: Exit Demo Mode",
"*restart.labelString: Reinitialize",
-"*resourcesLabel.labelString: XScreenSaver Parameters",
+"*done.labelString: Quit",
+"*preferencesLabel.labelString: XScreenSaver Parameters",
"*timeoutLabel.labelString: Saver Timeout",
"*cycleLabel.labelString: Cycle Timeout",
"*fadeSecondsLabel.labelString: Fade Duration",
"*fadeTicksLabel.labelString: Fade Ticks",
"*lockLabel.labelString: Lock Timeout",
"*passwdLabel.labelString: Password Timeout",
-"*resourcesForm*XmTextField.columns: 8",
+"*preferencesForm*XmTextField.columns: 8",
"*verboseToggle.labelString: Verbose",
"*cmapToggle.labelString: Install Colormap",
"*fadeToggle.labelString: Fade Colormap",
"*unfadeToggle.labelString: Unfade Colormap",
"*lockToggle.labelString: Require Password",
-"*resourcesDone.labelString: OK",
-"*resourcesCancel.labelString: Cancel",
-"*splashDialog.title: XScreenSaver",
-"*splashLabel1.labelString: XScreenSaver %s",
-"*splashLabel2.labelString: Copyright © 1991-1998 by",
-"*splashLabel3.labelString: Jamie Zawinski <jwz@jwz.org>",
-"*splashDemo.labelString: Demo",
-"*splashPrefs.labelString: Prefs",
-"*splashDialog*Help.labelString: Help",
-"*splashLabel1.alignment: ALIGNMENT_CENTER",
-"*splashLabel2.alignment: ALIGNMENT_CENTER",
-"*splashLabel3.alignment: ALIGNMENT_CENTER",
-"*splashDialog.borderWidth: 1",
-"*splashForm.shadowThickness: 4",
+"*preferencesDone.labelString: OK",
+"*preferencesCancel.labelString: Cancel",
"XScreenSaver*dragInitiatorProtocolStyle: DRAG_NONE",
"XScreenSaver*dragReceiverProtocolStyle: DRAG_NONE",
+"*demo_dialog.title: XScreenSaver Demo",
+"*preferences_dialog.title: XScreenSaver Preferences",
+"*warning_dialog.title: XScreenSaver Warning",
+"*demo_dialog.geometry: =640x400",
"*demo_dialog*font: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1",
-"*resources_dialog*font: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1",
-"*splash_dialog*font: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1",
-"*splash_dialog*splashLabel1.font: *-times-bold-r-*-*-*-180-*-*-*-iso8859-1",
-"*splash_dialog*splashLabel2.font: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1",
-"*splash_dialog*splashLabel3.font: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1",
+"*preferences_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",
-"XScreenSaver.demo_dialog*List.font: \
+"*preferences_dialog*label1.font:*-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1",
+"XScreenSaver*warning_dialog*label0.font: \
+ *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1",
+"XScreenSaver*warning_dialog*Label.font: \
+ *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1",
+"XScreenSaver*warning_dialog*Command.font: \
+ *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1",
+"XScreenSaver.demo_dialog*List.font: \
*-courier-medium-r-*-*-*-120-*-*-*-iso8859-1",
-"XScreenSaver.demo_dialog*Text*font: \
+"XScreenSaver.demo_dialog*Text*font: \
*-courier-medium-r-*-*-*-120-*-*-*-iso8859-1",
"XScreenSaver.demo_dialog*foreground: #000000",
"XScreenSaver.demo_dialog*background: #E5E5E5",
"XScreenSaver.demo_dialog*Scrollbar.background: #D9D9D9",
"XScreenSaver.demo_dialog*Command.background: #D9D9D9",
"XScreenSaver.demo_dialog*Text*background: #FFFFFF",
-"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\
+"XScreenSaver.preferences_dialog*foreground: #000000",
+"XScreenSaver.preferences_dialog*background: #E5E5E5",
+"XScreenSaver.preferences_dialog*Command.background: #D9D9D9",
+"XScreenSaver.preferences_dialog*Toggle.background: #D9D9D9",
+"XScreenSaver.preferences_dialog*Text*background: #FFFFFF",
+"XScreenSaver.warning_dialog*foreground: #000000",
+"XScreenSaver.warning_dialog*background: #E5E5E5",
+"XScreenSaver.warning_dialog*Command.background: #D9D9D9",
+"*preferences_dialog*Dialog.value.translations: #override\\n\
<Key>Return: beginning-of-line()\\n",
-"XScreenSaver.splash_dialog*foreground: #000000",
-"XScreenSaver.splash_dialog*background: #E5E5E5",
-"XScreenSaver.splash_dialog*Command.background: #D9D9D9",
-"XScreenSaver.splash_dialog*Text*background: #FFFFFF",
-"XScreenSaver.splash_dialog*roger.foreground: #CD0000",
-"XScreenSaver.splash_dialog*roger.background: #FFFFFF",
"*demo_dialog*viewport.height: 200",
"*Form.borderWidth: 0",
"*Box.borderWidth: 0",
"*Label.borderWidth: 0",
-"*resources_dialog*Dialog.borderWidth: 0",
+"*preferences_dialog*Dialog.borderWidth: 0",
"*demo_dialog*next.label: Run Next",
"*demo_dialog*prev.label: Run Previous",
"*demo_dialog*edit.label: Preferences",
-"*demo_dialog*done.label: Exit Demo Mode",
"*demo_dialog*restart.label: Reinitialize",
+"*demo_dialog*done.label: Quit",
"XScreenSaver.demo_dialog*Command.internalWidth: 10",
"XScreenSaver.demo_dialog*Command.internalHeight: 4",
-"*resources_dialog*timeout.label: Saver Timeout:",
-"*resources_dialog*cycle.label: Cycle Timeout:",
-"*resources_dialog*fade.label: Fade Duration:",
-"*resources_dialog*ticks.label: Fade Ticks:",
-"*resources_dialog*lockTime.label: Lock Timeout:",
-"*resources_dialog*passwdTime.label: Password Timeout:",
-"*resources_dialog*label1.label: XScreenSaver Parameters",
-"*resources_dialog*buttonbox.verbose.label: Verbose",
-"*resources_dialog*buttonbox.cmap.label: Install Colormap",
-"*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: OK",
-"*resources_dialog*cancel.label: Cancel",
-"*splash_dialog*splashLabel1.label: XScreenSaver %s",
-"*splash_dialog*splashLabel2.label: Copyright © 1991-1998 by",
-"*splash_dialog*splashLabel3.label: Jamie Zawinski <jwz@jwz.org>",
-"*splash_dialog*splash_form*label.label: ",
-"*splash_dialog*Dialog.label: ",
-"*splash_dialog*splash_form.borderWidth: 0",
-"*splash_dialog*roger.width: 150",
-"*splash_dialog*roger.height: 150",
-"*splash_dialog*roger.borderWidth: 1",
-"*splash_dialog*demo.label: Demo",
-"*splash_dialog*prefs.label: Prefs",
-"*splash_dialog*help.label: Help",
-"*splash_dialog.box.defaultDistance: 0",
-"*splash_dialog*splashLabel1.internalHeight: 10",
-"*splash_dialog*splashLabel1.internalWidth: 10",
-"*splash_dialog*splashLabel2.internalHeight: 0",
-"*splash_dialog*splashLabel3.internalHeight: 0",
-"XScreenSaver.pointerPollTime: 5",
-"XScreenSaver.initialDelay: 0",
-"XScreenSaver.windowCreationTimeout: 30",
-"XScreenSaver.bourneShell: /bin/sh",
+"*preferences_dialog*timeout.label: Saver Timeout:",
+"*preferences_dialog*cycle.label: Cycle Timeout:",
+"*preferences_dialog*fade.label: Fade Duration:",
+"*preferences_dialog*ticks.label: Fade Ticks:",
+"*preferences_dialog*lockTime.label: Lock Timeout:",
+"*preferences_dialog*passwdTime.label: Password Timeout:",
+"XScreenSaver.preferences_dialog*Command.internalWidth: 10",
+"XScreenSaver.preferences_dialog*Command.internalHeight: 4",
+"*preferences_dialog*label1.label: XScreenSaver Parameters",
+"*preferences_dialog*buttonbox.verbose.label: Verbose",
+"*preferences_dialog*buttonbox.cmap.label: Install Colormap",
+"*preferences_dialog*buttonbox.fade.label: Fade Colormap",
+"*preferences_dialog*buttonbox.unfade.label: Unfade Colormap",
+"*preferences_dialog*buttonbox.lock.label: Require Password",
+"*preferences_dialog*done.label: Ok",
+"*preferences_dialog*cancel.label: Cancel",
+"*warning_dialog*ok.label: Ok",
+"*warning_dialog*horizDistance: 30",
+"*warning_dialog*vertDistance: 0",
+"*warning_dialog*Label.internalWidth: 1",
+"*warning_dialog*Label.internalHeight: 0",
+"*warning_dialog*label0.horizDistance: 80",
+"*warning_dialog*label0.vertDistance: 20",
+"*warning_dialog*Command.horizDistance: 160",
+"*warning_dialog*Command.vertDistance: 20",
+"*warning_dialog*Command.internalWidth: 20",
+"*warning_dialog*Command.internalHeight: 5",
# include "config.h"
#endif
+#ifdef HAVE_ATHENA_KLUDGE /* don't ask */
+# undef HAVE_MOTIF
+# define HAVE_ATHENA 1
+#endif
+
+#include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#ifndef VMS
+# include <pwd.h> /* for getpwuid() */
+#else /* VMS */
+# include "vms-pwd.h"
+#endif /* VMS */
+
+#ifdef HAVE_UNAME
+# include <sys/utsname.h> /* for uname() */
+#endif /* HAVE_UNAME */
+
+#include <stdio.h>
+
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
# include <Xm/Text.h>
# include <Xm/List.h>
# include <Xm/ToggleB.h>
+# include <Xm/MessageB.h>
+# include <Xm/LabelG.h>
+# include <Xm/RowColumn.h>
#else /* HAVE_ATHENA */
/* Athena demo code contributed by Jon A. Christopher <jac8782@tamu.edu> */
# include <X11/Xaw/Text.h>
#endif /* HAVE_ATHENA */
-#include "xscreensaver.h"
+#include "version.h"
+#include "prefs.h"
#include "resources.h" /* for parse_time() */
+#include "visual.h" /* for has_writable_cells() */
+#include "remote.h" /* for xscreensaver_command() */
+
#include <stdio.h>
#include <string.h>
#include <ctype.h>
-#ifdef _VROOT_H_
-ERROR! You must not include vroot.h in this file.
-#endif
-static void demo_mode_hack (saver_info *si, char *);
-static void demo_mode_done (saver_info *si);
+char *progname = 0;
+char *progclass = "XScreenSaver";
+XrmDatabase db;
+
+typedef struct {
+ saver_preferences *a, *b;
+} prefs_pair;
+
+
+char *blurb (void) { return progname; }
+
+static void run_hack (Display *dpy, int n);
+
+#ifdef HAVE_ATHENA
+static saver_preferences *global_prefs_kludge = 0; /* I hate C so much... */
+#endif /* HAVE_ATHENA */
+
+static char *short_version = 0;
+
+Atom XA_VROOT;
+Atom XA_SCREENSAVER, XA_SCREENSAVER_RESPONSE, XA_SCREENSAVER_VERSION;
+Atom XA_SCREENSAVER_TIME, XA_SCREENSAVER_ID, XA_SELECT, XA_DEMO, XA_RESTART;
+
+extern void create_demo_dialog (Widget, Visual *, Colormap);
+extern void create_preferences_dialog (Widget, Visual *, Colormap);
extern Widget demo_dialog;
extern Widget label1;
extern Widget demo_list;
extern Widget next, prev, done, restart, edit;
-extern Widget resources_dialog;
-extern Widget resources_form;
-extern Widget res_done, res_cancel;
-extern Widget timeout_text, cycle_text, fade_text, ticks_text;
-extern Widget lock_time_text, passwd_time_text;
-extern Widget verbose_toggle, cmap_toggle, fade_toggle, unfade_toggle,
+extern Widget preferences_dialog;
+extern Widget preferences_form;
+extern Widget prefs_done, prefs_cancel;
+extern Widget timeout_text, cycle_text, fade_text, fade_ticks_text;
+extern Widget lock_timeout_text, passwd_timeout_text;
+extern Widget verbose_toggle, install_cmap_toggle, fade_toggle, unfade_toggle,
lock_toggle;
}
-void
+static void
format_into_label (Widget label, const char *arg)
{
char *text = get_label_string (label);
- char *buf = (char *) malloc ((text ? strlen(text) : 100) + strlen(arg) + 10);
+ char *buf = (char *) malloc ((text ? strlen(text) : 0) + strlen(arg) + 100);
if (!text || !strcmp (text, XtName (label)))
strcpy (buf, "ERROR: RESOURCES ARE NOT INSTALLED CORRECTLY");
}
-void
-steal_focus_and_colormap (Widget dialog)
-{
- Display *dpy = XtDisplay (dialog);
- Window window = XtWindow (dialog);
- Colormap cmap = 0;
- XSetInputFocus (dpy, window, RevertToParent, CurrentTime);
-
- XtVaGetValues (dialog, XtNcolormap, &cmap, 0);
- if (cmap)
- XInstallColormap (dpy, cmap);
-}
-
-static void
-raise_screenhack_dialog (void)
-{
- XMapRaised (XtDisplay (demo_dialog), XtWindow (demo_dialog));
- if (resources_dialog)
- XMapRaised (XtDisplay (resources_dialog), XtWindow (resources_dialog));
- steal_focus_and_colormap (resources_dialog ? resources_dialog : demo_dialog);
-}
-
-static void
-destroy_screenhack_dialogs (saver_info *si)
-{
- saver_screen_info *ssi = si->default_screen;
-
- if (demo_dialog) XtDestroyWidget (demo_dialog);
- if (resources_dialog) XtDestroyWidget (resources_dialog);
- demo_dialog = resources_dialog = 0;
-
- if (ssi->demo_cmap &&
- ssi->demo_cmap != ssi->cmap &&
- ssi->demo_cmap != DefaultColormapOfScreen (ssi->screen))
- {
- XFreeColormap (si->dpy, ssi->demo_cmap);
- ssi->demo_cmap = 0;
- }
-
- /* Since we installed our colormap to display the dialogs properly, put
- the old one back, so that the screensaver_window is now displayed
- properly. */
- if (ssi->cmap)
- XInstallColormap (si->dpy, ssi->cmap);
-}
-
-
-static void
-text_cb (Widget text_widget, XtPointer client_data, XtPointer call_data)
-{
- saver_info *si = (saver_info *) client_data;
- saver_preferences *p = &si->prefs;
- char *line;
- line = get_text_string (text_widget);
-
- if (p->verbose_p)
- fprintf (stderr, "%s: processing text \"%s\".\n", blurb(), line);
-
- demo_mode_hack (si, line);
-}
-
-
-#ifdef HAVE_ATHENA
-/* Bend over backwards to make hitting Return in the text field do the
- right thing.
- */
-extern saver_info *global_si_kludge;
-static void text_enter (Widget w, XEvent *event, String *av, Cardinal *ac)
-{
- text_cb (w, global_si_kludge, 0);
-}
-
-static XtActionsRec actions[] = {{"done", text_enter}
- };
-static char translations[] = ("<Key>Return: done()\n"
- "<Key>Linefeed: done()\n"
- "Ctrl<Key>M: done()\n"
- "Ctrl<Key>J: done()\n");
-#endif /* HAVE_ATHENA */
-
-
-static void
-select_cb (Widget button, XtPointer client_data, XtPointer call_data)
-{
- saver_info *si = (saver_info *) client_data;
-
-#ifdef HAVE_ATHENA
- XawListReturnStruct *item = (XawListReturnStruct*)call_data;
- XtVaSetValues(text_line, XtNstring, item->string, 0);
-
- demo_mode_hack (si, item->string);
- if (item->list_index >= 0)
- si->default_screen->current_hack = item->list_index;
-
-#else /* HAVE_MOTIF */
- XmListCallbackStruct *lcb = (XmListCallbackStruct *) call_data;
- char *string = 0;
- if (lcb->item)
- XmStringGetLtoR (lcb->item, XmSTRING_DEFAULT_CHARSET, &string);
- set_text_string (text_line, (string ? string : ""));
- if (lcb->reason == XmCR_DEFAULT_ACTION && string)
- {
- demo_mode_hack (si, string);
- if (lcb->item_position > 0)
- si->default_screen->current_hack = lcb->item_position - 1;
- }
- if (string)
- XtFree (string);
-#endif /* HAVE_MOTIF */
- steal_focus_and_colormap (demo_dialog);
-}
-
-
/* Why this behavior isn't automatic in *either* toolkit, I'll never know.
*/
static void
}
+/* Callback for the text area:
+ - note the text the user has entered;
+ - change the corresponding element in `screenhacks';
+ - write the .xscreensaver file;
+ - tell the xscreensaver daemon to run that hack.
+ */
static void
-next_cb (Widget button, XtPointer client_data, XtPointer call_data)
+text_cb (Widget text_widget, XtPointer client_data, XtPointer call_data)
{
- saver_info *si = (saver_info *) client_data;
- saver_preferences *p = &si->prefs;
+ Display *dpy = XtDisplay (text_widget);
+ saver_preferences *p = (saver_preferences *) client_data;
+ char *new_text = get_text_string (text_widget);
- if (p->verbose_p)
- fprintf (stderr, "%s: Run Next\n", blurb());
+ int hack_number = -1; /* 0-based */
- {
#ifdef HAVE_ATHENA
- int cnt;
XawListReturnStruct *current = XawListShowCurrent(demo_list);
- if (current->list_index == XAW_LIST_NONE)
- XawListHighlight(demo_list, 0);
+ hack_number = current->list_index;
+#else /* HAVE_MOTIF */
+ int *pos_list = 0;
+ int pos_count = 0;
+ if (XmListGetSelectedPos (demo_list, &pos_list, &pos_count))
+ hack_number = pos_list[0] - 1;
+ if (pos_list)
+ XtFree ((char *) pos_list);
+#endif /* HAVE_MOTIF */
+
+ ensure_selected_item_visible (demo_list);
+
+ if (hack_number < 0 || hack_number >= p->screenhacks_count)
+ {
+ set_text_string (text_widget, "");
+ XBell (dpy, 0);
+ }
else
{
- XtVaGetValues(demo_list,
- XtNnumberStrings, &cnt,
- NULL);
- if (current->list_index + 1 < cnt)
- {
- current->list_index++;
- XawListHighlight(demo_list, current->list_index);
- }
+fprintf(stderr, "%d:\nold: %s\nnew: %s\n",
+ hack_number, p->screenhacks [hack_number], new_text);
+
+ if (p->screenhacks [hack_number])
+ free (p->screenhacks [hack_number]);
+ p->screenhacks [hack_number] = strdup (new_text);
+
+#ifdef HAVE_MOTIF
+
+ XmListDeselectAllItems (demo_list);
+ {
+ XmString xmstr = XmStringCreate (new_text, XmSTRING_DEFAULT_CHARSET);
+ XmListReplaceItemsPos (demo_list, &xmstr, 1, hack_number+1);
+ XmStringFree (xmstr);
+ }
+ XmListSelectPos (demo_list, hack_number+1, True);
+
+#else /* HAVE_ATHENA */
+
+ {
+ Widget vp = XtParent(demo_list);
+ Widget sb = (vp ? XtNameToWidget(vp, "*vertical") : 0);
+ Dimension list_h = 0;
+ Position vp_x = 0, vp_y = 0;
+ float sb_top = 0;
+
+ XawListUnhighlight (demo_list);
+
+ XtVaGetValues (vp, XtNx, &vp_x, 0);
+ XtVaGetValues (sb, XtNtopOfThumb, &sb_top, 0);
+ XtVaGetValues (demo_list, XtNheight, &list_h, 0);
+ vp_y = (sb_top * list_h);
+ XtVaSetValues (demo_list,
+ XtNlist, p->screenhacks,
+ XtNnumberStrings, p->screenhacks_count,
+ 0);
+ XawViewportSetCoordinates (vp, vp_x, vp_y);
+ XawListHighlight (demo_list, hack_number);
+ }
+
+#endif /* HAVE_ATHENA */
+
+ write_init_file (p, short_version);
+ XSync (dpy, False);
+ usleep (500000); /* give the disk time to settle down */
+
+ run_hack (dpy, hack_number+1);
}
+}
+
+
+#ifdef HAVE_ATHENA
+/* Bend over backwards to make hitting Return in the text field do the
+ right thing.
+ */
+static void text_enter (Widget w, XEvent *event, String *av, Cardinal *ac)
+{
+ text_cb (w, global_prefs_kludge, 0); /* I hate C so much... */
+}
+
+static XtActionsRec actions[] = {{"done", text_enter}
+ };
+static char translations[] = ("<Key>Return: done()\n"
+ "<Key>Linefeed: done()\n"
+ "Ctrl<Key>M: done()\n"
+ "Ctrl<Key>J: done()\n");
+#endif /* HAVE_ATHENA */
+
+
+/* Callback for the Run Next button.
+ */
+static void
+next_cb (Widget button, XtPointer client_data, XtPointer call_data)
+{
+#ifdef HAVE_ATHENA
+ XawListReturnStruct *current = XawListShowCurrent(demo_list);
+ int cnt;
+ XtVaGetValues (demo_list, XtNnumberStrings, &cnt, 0);
+ if (current->list_index == XAW_LIST_NONE ||
+ current->list_index + 1 >= cnt)
+ current->list_index = 0;
+ else
+ current->list_index++;
+ XawListHighlight(demo_list, current->list_index);
ensure_selected_item_visible (demo_list);
current = XawListShowCurrent(demo_list);
XtVaSetValues(text_line, XtNstring, current->string, 0);
- demo_mode_hack (si, current->string);
+
+ run_hack (XtDisplay (button), current->list_index + 1);
#else /* HAVE_MOTIF */
- int *pos_list;
- int pos_count;
+ saver_preferences *p = (saver_preferences *) client_data;
+ int *pos_list = 0;
+ int pos_count = 0;
+ int pos;
if (! XmListGetSelectedPos (demo_list, &pos_list, &pos_count))
{
- XmListDeselectAllItems(demo_list); /* LessTif lossage */
- XmListSelectPos (demo_list, 1, True);
+ pos = 1;
+ XmListDeselectAllItems (demo_list); /* LessTif lossage */
+ XmListSelectPos (demo_list, pos, True);
}
else
{
- int pos = pos_list[0] + 1;
- if (pos > si->prefs.screenhacks_count)
+ pos = pos_list[0] + 1;
+ if (pos > p->screenhacks_count)
pos = 1;
- XmListDeselectAllItems(demo_list); /* LessTif lossage */
+ XmListDeselectAllItems (demo_list); /* LessTif lossage */
XmListSelectPos (demo_list, pos, True);
}
- XtFree ((char *) pos_list);
+
ensure_selected_item_visible (demo_list);
- demo_mode_hack (si, get_text_string (text_line));
+ run_hack (XtDisplay (button), pos);
+ if (pos_list)
+ XtFree ((char *) pos_list);
#endif /* HAVE_MOTIF */
- }
}
+/* Callback for the Run Previous button.
+ */
static void
prev_cb (Widget button, XtPointer client_data, XtPointer call_data)
{
- saver_info *si = (saver_info *) client_data;
- saver_preferences *p = &si->prefs;
-
- if (p->verbose_p)
- fprintf (stderr, "%s: Run Previous\n", blurb());
-
- {
#ifdef HAVE_ATHENA
- XawListReturnStruct *current=XawListShowCurrent(demo_list);
- if (current->list_index == XAW_LIST_NONE)
- XawListHighlight(demo_list, 0);
+ XawListReturnStruct *current = XawListShowCurrent(demo_list);
+ int cnt;
+ XtVaGetValues (demo_list, XtNnumberStrings, &cnt, 0);
+ if (current->list_index == XAW_LIST_NONE ||
+ current->list_index <= 0)
+ current->list_index = cnt-1;
else
- {
- if (current->list_index >= 1)
- {
- current->list_index--;
- XawListHighlight(demo_list, current->list_index);
- }
- }
+ current->list_index--;
+ XawListHighlight(demo_list, current->list_index);
ensure_selected_item_visible (demo_list);
current = XawListShowCurrent(demo_list);
XtVaSetValues(text_line, XtNstring, current->string, 0);
- demo_mode_hack (si, current->string);
+
+ run_hack (XtDisplay (button), current->list_index + 1);
#else /* HAVE_MOTIF */
- int *pos_list;
- int pos_count;
+ saver_preferences *p = (saver_preferences *) client_data;
+ int *pos_list = 0;
+ int pos_count = 0;
+ int pos;
if (! XmListGetSelectedPos (demo_list, &pos_list, &pos_count))
{
- XmListDeselectAllItems(demo_list); /* LessTif lossage */
- XmListSelectPos (demo_list, 0, True);
+ pos = p->screenhacks_count;
+ XmListDeselectAllItems (demo_list); /* LessTif lossage */
+ XmListSelectPos (demo_list, pos, True);
}
else
{
- XmListDeselectAllItems(demo_list); /* LessTif lossage */
- XmListSelectPos (demo_list, pos_list [0] - 1, True);
- XtFree ((char *) pos_list);
+ pos = pos_list[0] - 1;
+ if (pos == 0)
+ pos = p->screenhacks_count;
+ XmListDeselectAllItems (demo_list); /* LessTif lossage */
+ XmListSelectPos (demo_list, pos, True);
}
+
ensure_selected_item_visible (demo_list);
- demo_mode_hack (si, get_text_string (text_line));
+ run_hack (XtDisplay (button), pos);
+ if (pos_list)
+ XtFree ((char *) pos_list);
#endif /* HAVE_MOTIF */
- }
}
-static void pop_resources_dialog (saver_info *si);
-static void make_resources_dialog (saver_info *si, Widget parent);
+/* Callback run when a list element is double-clicked.
+ */
+static void
+select_cb (Widget button, XtPointer client_data, XtPointer call_data)
+{
+/* saver_preferences *p = (saver_preferences *) client_data; */
+
+#ifdef HAVE_ATHENA
+ XawListReturnStruct *item = (XawListReturnStruct*)call_data;
+ XtVaSetValues(text_line, XtNstring, item->string, 0);
+ run_hack (XtDisplay (button), item->list_index + 1);
+
+#else /* HAVE_MOTIF */
+ XmListCallbackStruct *lcb = (XmListCallbackStruct *) call_data;
+ char *string = 0;
+ if (lcb->item)
+ XmStringGetLtoR (lcb->item, XmSTRING_DEFAULT_CHARSET, &string);
+ set_text_string (text_line, (string ? string : ""));
+
+ if (lcb->reason == XmCR_DEFAULT_ACTION && string)
+ run_hack (XtDisplay (button), lcb->item_position);
+
+ if (string)
+ XtFree (string);
+#endif /* HAVE_MOTIF */
+}
+
+
+
+static void pop_preferences_dialog (prefs_pair *pair);
+static void make_preferences_dialog (prefs_pair *pair, Widget parent);
+/* Callback for the Preferences button.
+ */
static void
-edit_cb (Widget button, XtPointer client_data, XtPointer call_data)
+preferences_cb (Widget button, XtPointer client_data, XtPointer call_data)
{
- saver_info *si = (saver_info *) client_data;
- saver_screen_info *ssi = si->default_screen;
- saver_preferences *p = &si->prefs;
- Widget parent = ssi->toplevel_shell;
+ prefs_pair *pair = (prefs_pair *) client_data;
+ Widget parent = button;
- if (p->verbose_p)
- fprintf (stderr, "%s: Preferences\n", blurb());
+ do {
+ parent = XtParent(parent);
+ } while (XtParent(parent));
- if (! resources_dialog)
- make_resources_dialog (si, parent);
- pop_resources_dialog (si);
+ if (! preferences_dialog)
+ make_preferences_dialog (pair, parent);
+ pop_preferences_dialog (pair);
}
+/* Callback for the Quit button.
+ */
static void
-done_cb (Widget button, XtPointer client_data, XtPointer call_data)
+quit_cb (Widget button, XtPointer client_data, XtPointer call_data)
{
- saver_info *si = (saver_info *) client_data;
- demo_mode_done (si);
+ /* Save here? Right now we don't need to, because we save every time
+ the text field is edited, or the Preferences OK button is pressed.
+ */
+ exit (0);
}
+/* Callback for the (now unused) Restart button.
+ */
static void
restart_cb (Widget button, XtPointer client_data, XtPointer call_data)
{
- saver_info *si = (saver_info *) client_data;
- saver_preferences *p = &si->prefs;
- if (p->verbose_p)
- fprintf (stderr, "%s: Restart\n", blurb());
- demo_mode_restart_process (si);
+ xscreensaver_command (XtDisplay (button), XA_RESTART, 0, False);
}
-void
-pop_up_dialog_box (Widget dialog, Widget form, int where)
+static void
+pop_up_dialog_box (Widget dialog, Widget form)
{
- /* I'm sure this is the wrong way to pop up a dialog box, but I can't
- figure out how else to do it.
-
- It's important that the screensaver dialogs not get decorated or
- otherwise reparented by the window manager, because they need to be
- children of the *real* root window, not the WM's virtual root, in
- order for us to guarentee that they are visible above the screensaver
- window itself.
- */
- Arg av [100];
- int ac = 0;
- Dimension sw, sh, x, y, w, h;
-
#ifdef HAVE_ATHENA
XtRealizeWidget (dialog);
-#else /* HAVE_MOTIF */
- /* Motif likes us to realize the *child* of the shell... */
- XtRealizeWidget (form);
-#endif /* HAVE_MOTIF */
-
- sw = WidthOfScreen (XtScreen (dialog));
- sh = HeightOfScreen (XtScreen (dialog));
- ac = 0;
- XtSetArg (av [ac], XtNwidth, &w); ac++;
- XtSetArg (av [ac], XtNheight, &h); ac++;
- XtGetValues (form, av, ac);
-
- /* for debugging -- don't ask */
- if (where >= 69)
- {
- where -= 69;
- sw = (sw * 7) / 12;
- }
-
- switch (where)
- {
- case 0: /* center it in the top-right quadrant */
- x = (sw/2 + w) / 2 + (sw/2) - w;
- y = (sh/2 + h) / 2 - h;
- break;
- case 1: /* center it in the bottom-right quadrant */
- x = (sw/2 + w) / 2 + (sw/2) - w;
- y = (sh/2 + h) / 2 + (sh/2) - h;
- break;
- case 2: /* center it on the screen */
- x = (sw + w) / 2 - w;
- y = (sh + h) / 2 - h;
- break;
- case 3: /* center it in the top 2/3rds of the screen */
- x = (sw + w) / 2 - w;
- y = (sh*2/3 + h) / 2 - h;
- break;
- default:
- abort ();
- }
- if (x + w > sw) x = sw - w;
- if (y + h > sh) y = sh - h;
- ac = 0;
- XtSetArg (av [ac], XtNx, x); ac++;
- XtSetArg (av [ac], XtNy, y); ac++;
- XtSetArg (av [ac], XtNoverrideRedirect, True); ac++;
-
-#ifdef HAVE_MOTIF
- XtSetArg (av [ac], XmNdefaultPosition, False); ac++;
-#endif /* HAVE_MOTIF */
-
- XtSetValues (dialog, av, ac);
- XtSetValues (form, av, ac);
-
-#ifdef HAVE_ATHENA
XtPopup (dialog, XtGrabNone);
#else /* HAVE_MOTIF */
+ XtRealizeWidget (form);
XtManageChild (form);
#endif /* HAVE_MOTIF */
-
- steal_focus_and_colormap (dialog);
+ XMapRaised (XtDisplay (dialog), XtWindow (dialog));
}
-void
-make_screenhack_dialog (saver_info *si)
+static void
+make_demo_dialog (Widget toplevel_shell, prefs_pair *pair)
{
- saver_screen_info *ssi = si->default_screen;
- Widget parent = ssi->toplevel_shell;
- char **hacks = si->prefs.screenhacks;
+ saver_preferences *p = pair->a;
+ /* saver_preferences *p2 = pair->b; */
- if (ssi->demo_cmap &&
- ssi->demo_cmap != ssi->cmap &&
- ssi->demo_cmap != DefaultColormapOfScreen (ssi->screen))
- {
- XFreeColormap (si->dpy, ssi->demo_cmap);
- ssi->demo_cmap = 0;
- }
+ Widget parent = toplevel_shell;
+ char **hacks = p->screenhacks;
- if (ssi->default_visual == DefaultVisualOfScreen (ssi->screen))
- ssi->demo_cmap = DefaultColormapOfScreen (ssi->screen);
- else
- ssi->demo_cmap = XCreateColormap (si->dpy,
- RootWindowOfScreen (ssi->screen),
- ssi->default_visual, AllocNone);
+ create_demo_dialog (parent,
+ DefaultVisualOfScreen (XtScreen (parent)),
+ DefaultColormapOfScreen (XtScreen (parent)));
+ format_into_label (label1, short_version);
- create_demo_dialog (parent, ssi->default_visual, ssi->demo_cmap);
- format_into_label (label1, si->version);
-
- add_button_callback (next, next_cb, (XtPointer) si);
- add_button_callback (prev, prev_cb, (XtPointer) si);
- add_button_callback (done, done_cb, (XtPointer) si);
- add_button_callback (restart, restart_cb, (XtPointer) si);
- add_button_callback (edit, edit_cb, (XtPointer) si);
+ add_button_callback (next, next_cb, (XtPointer) p);
+ add_button_callback (prev, prev_cb, (XtPointer) p);
+ add_button_callback (done, quit_cb, (XtPointer) p);
+ if (restart)
+ add_button_callback(restart,restart_cb, (XtPointer) p);
+ add_button_callback (edit, preferences_cb, (XtPointer) pair);
#ifdef HAVE_MOTIF
XtAddCallback (demo_list, XmNbrowseSelectionCallback,
- select_cb, (XtPointer) si);
+ select_cb, (XtPointer) p);
XtAddCallback (demo_list, XmNdefaultActionCallback,
- select_cb, (XtPointer) si);
- XtAddCallback (text_line, XmNactivateCallback, text_cb, (XtPointer) si);
+ select_cb, (XtPointer) p);
+ XtAddCallback (text_line, XmNactivateCallback, text_cb, (XtPointer) p);
if (hacks)
for (; *hacks; hacks++)
XmStringFree (xmstr);
}
- /* Cause the most-recently-run hack to be selected in the list.
- Do some voodoo to make it be roughly centered in the list (really,
- just make it not be within +/- 5 of the top/bottom if possible.)
- */
- if (ssi->current_hack > 0)
- {
- int i = ssi->current_hack+1;
- int top = i + 5;
- int bot = i - 5;
- if (bot < 1) bot = 1;
- if (top > si->prefs.screenhacks_count)
- top = si->prefs.screenhacks_count;
-
- XmListDeselectAllItems(demo_list); /* LessTif lossage */
- XmListSelectPos (demo_list, bot, False);
- ensure_selected_item_visible (demo_list);
-
- XmListDeselectAllItems(demo_list); /* LessTif lossage */
- XmListSelectPos (demo_list, top, False);
- ensure_selected_item_visible (demo_list);
-
- XmListDeselectAllItems(demo_list); /* LessTif lossage */
- XmListSelectPos (demo_list, i, False);
- ensure_selected_item_visible (demo_list);
- }
-
#else /* HAVE_ATHENA */
/* Hook up the text line. */
XtVaSetValues (demo_list,
XtNlist, hacks,
- XtNnumberStrings, si->prefs.screenhacks_count,
+ XtNnumberStrings, p->screenhacks_count,
0);
- XtAddCallback (demo_list, XtNcallback, select_cb, si);
- if (ssi->current_hack > 0)
- XawListHighlight(demo_list, ssi->current_hack);
+ XtAddCallback (demo_list, XtNcallback, select_cb, p);
/* Now that we've populated the list, make sure that the list is as
wide as the dialog itself.
/* Why isn't the viewport getting centered? */
XtVaGetValues(viewport,
XtNx, &x, XtNy, &y, XtNheight, &h, XtNborderWidth, &bw, 0);
-/* printf("%d %d %d %d\n", x, y, w, h); */
XtConfigureWidget(viewport, x, y, w2-x-x, h, bw);
/* And the text line, too. */
#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) +
- 0);
+ pop_up_dialog_box(demo_dialog, demo_form);
#ifdef HAVE_ATHENA
/* For Athena, have to do this after the dialog is managed. */
}
\f
-/* the Screensaver Parameters dialog */
-
-static struct resources {
- int timeout, cycle, secs, ticks, lock_time, passwd_time;
- int verb, cmap, fade, unfade, lock_p;
-} res;
-
+/* the Preferences dialog
+ */
+/* Helper for the text fields that contain time specifications:
+ this parses the text, and does error checking.
+ */
static void
-hack_time_cb (Display *dpy, char *line, int *store, Bool sec_p)
+hack_time_text (Display *dpy, char *line, Time *store, Bool sec_p)
{
if (*line)
{
int value;
value = parse_time (line, sec_p, True);
+ value *= 1000; /* Time measures in microseconds */
if (value < 0)
/*XBell (dpy, 0)*/;
else
}
}
+
+/* Callback for text fields that hold a time that default to seconds,
+ when not fully spelled out. client_data is an Time* where the value goes.
+ */
static void
-res_sec_cb (Widget button, XtPointer client_data, XtPointer call_data)
+prefs_sec_cb (Widget button, XtPointer client_data, XtPointer call_data)
{
- hack_time_cb (XtDisplay (button), get_text_string (button),
- (int *) client_data, True);
+ hack_time_text (XtDisplay (button), get_text_string (button),
+ (Time *) client_data, True);
}
+
+/* Callback for text fields that hold a time that default to minutes,
+ when not fully spelled out. client_data is an Time* where the value goes.
+ */
static void
-res_min_cb (Widget button, XtPointer client_data, XtPointer call_data)
+prefs_min_cb (Widget button, XtPointer client_data, XtPointer call_data)
{
- hack_time_cb (XtDisplay (button), get_text_string (button),
- (int *) client_data, False);
+ hack_time_text (XtDisplay (button), get_text_string (button),
+ (Time *) client_data, False);
}
+
+/* Callback for text fields that hold an integer value.
+ client_data is an int* where the value goes.
+ */
static void
-res_int_cb (Widget button, XtPointer client_data, XtPointer call_data)
+prefs_int_cb (Widget button, XtPointer client_data, XtPointer call_data)
{
char *line = get_text_string (button);
int *store = (int *) client_data;
*store = value;
}
+/* Callback for toggle buttons. client_data is an Bool* where the value goes.
+ */
static void
-res_bool_cb (Widget button, XtPointer client_data, XtPointer call_data)
+prefs_bool_cb (Widget button, XtPointer client_data, XtPointer call_data)
{
- int *store = (int *) client_data;
+ Bool *store = (Bool *) client_data;
#ifdef HAVE_MOTIF
*store = ((XmToggleButtonCallbackStruct *) call_data)->set;
#else /* HAVE_ATHENA */
Boolean state = FALSE;
- XtVaGetValues (button, XtNstate, &state, NULL);
+ XtVaGetValues (button, XtNstate, &state, 0);
*store = state;
#endif /* HAVE_ATHENA */
}
+
+/* Callback for the Cancel button on the Preferences dialog.
+ */
static void
-res_cancel_cb (Widget button, XtPointer client_data, XtPointer call_data)
+prefs_cancel_cb (Widget button, XtPointer client_data, XtPointer call_data)
{
- saver_info *si = (saver_info *) client_data;
- saver_preferences *p = &si->prefs;
-
- XtDestroyWidget (resources_dialog);
- resources_dialog = 0;
- raise_screenhack_dialog ();
-
- if (p->verbose_p)
- fprintf (stderr, "%s: lowering preferences dialog.\n", blurb());
+ XtDestroyWidget (preferences_dialog);
+ preferences_dialog = 0;
+ XMapRaised (XtDisplay (demo_dialog), XtWindow (demo_dialog));
}
+/* Callback for the OK button on the Preferences dialog.
+ */
static void
-res_done_cb (Widget button, XtPointer client_data, XtPointer call_data)
+prefs_ok_cb (Widget button, XtPointer client_data, XtPointer call_data)
{
- saver_info *si = (saver_info *) client_data;
- saver_preferences *p = &si->prefs;
+ prefs_pair *pair = (prefs_pair *) client_data;
+ saver_preferences *p = pair->a;
+ saver_preferences *p2 = pair->b;
- res_cancel_cb (button, client_data, call_data);
+ prefs_cancel_cb (button, 0, call_data);
#ifdef HAVE_ATHENA
- /* Check all text widgets, since we don't have callbacks for these. */
- res_min_cb (timeout_text, (XtPointer) &res.timeout, NULL);
- res_min_cb (cycle_text, (XtPointer) &res.cycle, NULL);
- res_sec_cb (fade_text, (XtPointer) &res.secs, NULL);
- res_int_cb (ticks_text, (XtPointer) &res.ticks, NULL);
- res_min_cb (lock_time_text, (XtPointer) &res.lock_time, NULL);
- res_sec_cb (passwd_time_text, (XtPointer) &res.passwd_time, NULL);
+ /* Athena doesn't let us put callbacks on these widgets, so run
+ all the callbacks by hand when OK is pressed. */
+ prefs_min_cb (timeout_text, (XtPointer) &p2->timeout, 0);
+ prefs_min_cb (cycle_text, (XtPointer) &p2->cycle, 0);
+ prefs_sec_cb (fade_text, (XtPointer) &p2->fade_seconds, 0);
+ prefs_int_cb (fade_ticks_text, (XtPointer) &p2->fade_ticks, 0);
+ prefs_min_cb (lock_timeout_text, (XtPointer) &p2->lock_timeout, 0);
+ prefs_sec_cb (passwd_timeout_text, (XtPointer) &p2->passwd_timeout, 0);
#endif /* HAVE_ATHENA */
- /* Throttle the timeouts to minimum sane values. */
- if (res.timeout < 5) res.timeout = 5;
- if (res.cycle < 2) res.cycle = 2;
- if (res.passwd_time < 10) res.passwd_time = 10;
-
- p->timeout = res.timeout * 1000;
- p->cycle = res.cycle * 1000;
- p->lock_timeout = res.lock_time * 1000;
-#ifndef NO_LOCKING
- p->passwd_timeout = res.passwd_time * 1000;
-#endif
- p->fade_seconds = res.secs;
- p->fade_ticks = res.ticks;
- p->verbose_p = res.verb;
- p->install_cmap_p = res.cmap;
- p->fade_p = res.fade;
- p->unfade_p = res.unfade;
- p->lock_p = res.lock_p;
-
- if (p->debug_p && p->verbose_p)
- fprintf (stderr, "%s: parameters changed:\n\
- timeout: %d\n\tcycle: %d\n\tlock: %d\n\tpasswd: %d\n\
- fade: %d\n\tfade: %d\n\tverbose: %d\n\tinstall: %d\n\
- fade: %d\n\tunfade: %d\n\tlock: %d\n",
- blurb(), p->timeout, p->cycle, p->lock_timeout,
-#ifdef NO_LOCKING
- 0,
-#else
- p->passwd_timeout,
-#endif
- p->fade_seconds, p->fade_ticks, p->verbose_p, p->install_cmap_p,
- p->fade_p, p->unfade_p, p->lock_p);
-
-
-#if defined(HAVE_MIT_SAVER_EXTENSION) || defined(HAVE_SGI_SAVER_EXTENSION)
- if (p->use_mit_saver_extension || p->use_sgi_saver_extension)
- {
- /* Need to set the server timeout to the new one the user has picked.
- */
- int server_timeout, server_interval, prefer_blank, allow_exp;
- XGetScreenSaver (si->dpy, &server_timeout, &server_interval,
- &prefer_blank, &allow_exp);
- if (server_timeout != (p->timeout / 1000))
- {
- server_timeout = (p->timeout / 1000);
- if (p->verbose_p)
- fprintf (stderr,
- "%s: configuring server for saver timeout of %d seconds.\n",
- blurb(), server_timeout);
- /* Leave all other parameters the same. */
- XSetScreenSaver (si->dpy, server_timeout, server_interval,
- prefer_blank, allow_exp);
- }
- }
-#endif /* HAVE_MIT_SAVER_EXTENSION || HAVE_SGI_SAVER_EXTENSION */
-
- write_init_file (si);
+ p->timeout = p2->timeout;
+ p->cycle = p2->cycle;
+ p->lock_timeout = p2->lock_timeout;
+ p->passwd_timeout = p2->passwd_timeout;
+ p->fade_seconds = p2->fade_seconds;
+ p->fade_ticks = p2->fade_ticks;
+ p->verbose_p = p2->verbose_p;
+ p->install_cmap_p = p2->install_cmap_p;
+ p->fade_p = p2->fade_p;
+ p->unfade_p = p2->unfade_p;
+ p->lock_p = p2->lock_p;
+
+ write_init_file (p, short_version);
}
static void
-make_resources_dialog (saver_info *si, Widget parent)
+make_preferences_dialog (prefs_pair *pair, Widget parent)
{
- saver_screen_info *ssi = si->default_screen;
+ saver_preferences *p = pair->a;
+ saver_preferences *p2 = pair->b;
- if (ssi->demo_cmap &&
- ssi->demo_cmap != ssi->cmap &&
- ssi->demo_cmap != DefaultColormapOfScreen (ssi->screen))
- {
- XFreeColormap (si->dpy, ssi->demo_cmap);
- ssi->demo_cmap = 0;
- }
+ Screen *screen = XtScreen (parent);
+ Display *dpy = XtDisplay (parent);
- if (ssi->default_visual == DefaultVisualOfScreen (ssi->screen))
- ssi->demo_cmap = DefaultColormapOfScreen (ssi->screen);
- else
- ssi->demo_cmap = XCreateColormap (si->dpy,
- RootWindowOfScreen (ssi->screen),
- ssi->default_visual, AllocNone);
+ *p2 = *p; /* copy all slots of p into p2. */
- create_resources_dialog (parent, ssi->default_visual, ssi->demo_cmap);
+ create_preferences_dialog (parent,
+ DefaultVisualOfScreen (screen),
+ DefaultColormapOfScreen (screen));
- add_button_callback (res_done, res_done_cb, (XtPointer) si);
- add_button_callback (res_cancel, res_cancel_cb, (XtPointer) si);
+ add_button_callback (prefs_done, prefs_ok_cb, (XtPointer) pair);
+ add_button_callback (prefs_cancel, prefs_cancel_cb, 0);
#define CB(widget,type,slot) \
add_text_callback ((widget), (type), (XtPointer) (slot))
#ifdef HAVE_MOTIF
/* When using Athena widgets, we can't set callbacks for these,
- so we'll check them all if "done" gets pressed.
- */
- CB (timeout_text, res_min_cb, &res.timeout);
- CB (cycle_text, res_min_cb, &res.cycle);
- CB (fade_text, res_sec_cb, &res.secs);
- CB (ticks_text, res_int_cb, &res.ticks);
- CB (lock_time_text, res_min_cb, &res.lock_time);
- CB (passwd_time_text, res_sec_cb, &res.passwd_time);
+ so in that case, we run them by hand when "OK" is pressed. */
+ CB (timeout_text, prefs_min_cb, &p2->timeout);
+ CB (cycle_text, prefs_min_cb, &p2->cycle);
+ CB (fade_text, prefs_sec_cb, &p2->fade_seconds);
+ CB (fade_ticks_text, prefs_int_cb, &p2->fade_ticks);
+ CB (lock_timeout_text, prefs_min_cb, &p2->lock_timeout);
+ CB (passwd_timeout_text, prefs_sec_cb, &p2->passwd_timeout);
#endif /* HAVE_MOTIF */
- CBT (verbose_toggle, res_bool_cb, &res.verb);
- CBT (cmap_toggle, res_bool_cb, &res.cmap);
- CBT (fade_toggle, res_bool_cb, &res.fade);
- CBT (unfade_toggle, res_bool_cb, &res.unfade);
- CBT (lock_toggle, res_bool_cb, &res.lock_p);
+ CBT (verbose_toggle, prefs_bool_cb, &p2->verbose_p);
+ CBT (install_cmap_toggle, prefs_bool_cb, &p2->install_cmap_p);
+ CBT (fade_toggle, prefs_bool_cb, &p2->fade_p);
+ CBT (unfade_toggle, prefs_bool_cb, &p2->unfade_p);
+ CBT (lock_toggle, prefs_bool_cb, &p2->lock_p);
#undef CB
#undef CBT
- if (si->locking_disabled_p)
- {
- disable_widget (passwd_time_text);
- disable_widget (lock_time_text);
- disable_widget (lock_toggle);
- }
- if (!si->fading_possible_p)
- {
- disable_widget (fade_text);
- disable_widget (ticks_text);
- disable_widget (cmap_toggle);
- disable_widget (fade_toggle);
- disable_widget (unfade_toggle);
- }
+ {
+ Bool found_any_writable_cells = False;
+ int nscreens = ScreenCount(dpy);
+ int i;
+ for (i = 0; i < nscreens; i++)
+ {
+ Screen *s = ScreenOfDisplay (dpy, i);
+ if (has_writable_cells (s, DefaultVisualOfScreen (s)))
+ {
+ found_any_writable_cells = True;
+ break;
+ }
+ }
+
+ if (! found_any_writable_cells) /* fading isn't possible */
+ {
+ disable_widget (fade_text);
+ disable_widget (fade_ticks_text);
+ disable_widget (install_cmap_toggle);
+ disable_widget (fade_toggle);
+ disable_widget (unfade_toggle);
+ }
+ }
}
+/* Formats a `Time' into "H:MM:SS". (Time is microseconds.)
+ */
static void
-fmt_time (char *buf, unsigned int s, int min_p)
+format_time (char *buf, Time time)
{
+ int s = time / 1000;
unsigned int h = 0, m = 0;
if (s >= 60)
{
h += (m / 60);
m %= 60;
}
-/*
- if (min_p && h == 0 && s == 0)
- sprintf (buf, "%u", m);
- else if (!min_p && h == 0 && m == 0)
- sprintf (buf, "%u", s);
- else
- if (h == 0)
- sprintf (buf, "%u:%02u", m, s);
- else
-*/
- sprintf (buf, "%u:%02u:%02u", h, m, s);
+ sprintf (buf, "%u:%02u:%02u", h, m, s);
}
+
static void
-pop_resources_dialog (saver_info *si)
+pop_preferences_dialog (prefs_pair *pair)
{
- saver_preferences *p = &si->prefs;
- char buf [100];
+ /* saver_preferences *p = pair->a; */
+ saver_preferences *p2 = pair->b;
+ char s[100];
+
+ format_time (s, p2->timeout); set_text_string(timeout_text, s);
+ format_time (s, p2->cycle); set_text_string(cycle_text, s);
+ format_time (s, p2->lock_timeout); set_text_string(lock_timeout_text, s);
+ format_time (s, p2->passwd_timeout); set_text_string(passwd_timeout_text, s);
+ format_time (s, p2->fade_seconds); set_text_string(fade_text, s);
+ sprintf (s, "%u", p2->fade_ticks); set_text_string(fade_ticks_text, s);
+
+ set_toggle_button_state (verbose_toggle, p2->verbose_p);
+ set_toggle_button_state (install_cmap_toggle, p2->install_cmap_p);
+ set_toggle_button_state (fade_toggle, p2->fade_p);
+ set_toggle_button_state (unfade_toggle, p2->unfade_p);
+ set_toggle_button_state (lock_toggle, p2->lock_p);
+
+ pop_up_dialog_box (preferences_dialog, preferences_form);
+}
- if (p->verbose_p)
- fprintf (stderr, "%s: raising preferences dialog.\n", blurb());
- res.timeout = p->timeout / 1000;
- res.cycle = p->cycle / 1000;
- res.lock_time = p->lock_timeout / 1000;
-#ifndef NO_LOCKING
- res.passwd_time = p->passwd_timeout / 1000;
-#endif
- res.secs = p->fade_seconds;
- res.ticks = p->fade_ticks;
- res.verb = p->verbose_p;
- res.cmap = p->install_cmap_p;
- res.fade = p->fade_p;
- res.unfade = p->unfade_p;
- res.lock_p = (p->lock_p && !si->locking_disabled_p);
-
- fmt_time (buf, res.timeout, 1); set_text_string (timeout_text, buf);
- fmt_time (buf, res.cycle, 1); set_text_string (cycle_text, buf);
- fmt_time (buf, res.lock_time, 1); set_text_string (lock_time_text, buf);
- fmt_time (buf, res.passwd_time, 0); set_text_string (passwd_time_text, buf);
- fmt_time (buf, res.secs, 0); set_text_string (fade_text, buf);
- sprintf (buf, "%u", res.ticks); set_text_string (ticks_text, buf);
-
- set_toggle_button_state (verbose_toggle, res.verb);
- set_toggle_button_state (cmap_toggle, res.cmap);
- set_toggle_button_state (fade_toggle, res.fade);
- 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) +
- 1);
+static void
+run_hack (Display *dpy, int n)
+{
+ if (n <= 0) abort();
+ xscreensaver_command (dpy, XA_DEMO, n, False);
}
-\f
-/* The main demo-mode command loop.
- */
-void
-demo_mode (saver_info *si)
+static void
+warning_dialog_dismiss_cb (Widget button, XtPointer client_data,
+ XtPointer call_data)
{
- saver_preferences *p = &si->prefs;
- Bool prefs_p = (si->demo_mode_p == (Bool) 2); /* kludge! */
+ Widget shell = (Widget) client_data;
+ XtDestroyWidget (shell);
+}
- if (p->verbose_p)
- fprintf (stderr, "%s: Demo Mode.\n", blurb());
+static void
+warning_dialog (Widget parent, const char *message)
+{
+ char *msg = strdup (message);
+ char *head;
- si->selection_mode = 0;
- si->dbox_up_p = True;
- monitor_power_on (si);
- raise_window (si, True, False, False);
- make_screenhack_dialog (si);
+ Widget dialog = 0;
+ Widget label = 0;
+ Widget ok = 0;
+ int i = 0;
- if (prefs_p)
- edit_cb (0, si, 0); /* pop up preferences panel */
+#ifdef HAVE_MOTIF
- while (si->demo_mode_p)
+ Widget w;
+ Widget container;
+ XmString xmstr;
+ Arg av[10];
+ int ac = 0;
+
+ ac = 0;
+ dialog = XmCreateWarningDialog (parent, "versionWarning", av, ac);
+
+ w = XmMessageBoxGetChild (dialog, XmDIALOG_MESSAGE_LABEL);
+ if (w) XtUnmanageChild (w);
+ w = XmMessageBoxGetChild (dialog, XmDIALOG_CANCEL_BUTTON);
+ if (w) XtUnmanageChild (w);
+ w = XmMessageBoxGetChild (dialog, XmDIALOG_HELP_BUTTON);
+ if (w) XtUnmanageChild (w);
+
+ ok = XmMessageBoxGetChild (dialog, XmDIALOG_OK_BUTTON);
+
+ ac = 0;
+ XtSetArg (av[ac], XmNnumColumns, 1); ac++;
+ XtSetArg (av[ac], XmNorientation, XmVERTICAL); ac++;
+ XtSetArg (av[ac], XmNpacking, XmPACK_COLUMN); ac++;
+ XtSetArg (av[ac], XmNrowColumnType, XmWORK_AREA); ac++;
+ XtSetArg (av[ac], XmNspacing, 0); ac++;
+ container = XmCreateRowColumn (dialog, "container", av, ac);
+
+#else /* HAVE_ATHENA */
+
+ Widget form;
+ dialog = XtVaCreatePopupShell("warning_dialog", transientShellWidgetClass,
+ parent, 0);
+ form = XtVaCreateManagedWidget("warning_form", formWidgetClass, dialog, 0);
+
+#endif /* HAVE_ATHENA */
+
+ head = msg;
+ while (head)
{
- XEvent event;
- XtAppNextEvent (si->app, &event);
- switch (event.xany.type)
- {
- case 0: /* synthetic "timeout" event */
- break;
-
- case ClientMessage:
- handle_clientmessage (si, &event, False);
- break;
-
- case CreateNotify:
- if (!p->use_xidle_extension &&
- !p->use_mit_saver_extension &&
- !p->use_sgi_saver_extension)
- {
- start_notice_events_timer (si, event.xcreatewindow.window);
-#ifdef DEBUG_TIMERS
- if (p->verbose_p)
- fprintf (stderr,
- "%s: starting notice_events_timer for 0x%X (%lu)\n",
- blurb(),
- (unsigned int) event.xcreatewindow.window,
- p->notice_events_timeout);
-#endif /* DEBUG_TIMERS */
- }
- break;
-
- case ButtonPress:
- case ButtonRelease:
- if (!XtWindowToWidget (si->dpy, event.xbutton.window))
- raise_screenhack_dialog ();
- /* fall through */
-
- default:
-#ifdef HAVE_MIT_SAVER_EXTENSION
- if (event.type == si->mit_saver_ext_event_number)
- {
- /* Get the "real" server window(s) out of the way as soon
- as possible. */
- int i = 0;
- for (i = 0; i < si->nscreens; i++)
- {
- saver_screen_info *ssi = &si->screens[i];
- if (ssi->server_mit_saver_window &&
- window_exists_p (si->dpy, ssi->server_mit_saver_window))
- XUnmapWindow (si->dpy, ssi->server_mit_saver_window);
- }
- }
- else
-#endif /* HAVE_MIT_SAVER_EXTENSION */
-
- XtDispatchEvent (&event);
- break;
- }
+ char name[20];
+ char *s = strchr (head, '\n');
+ if (s) *s = 0;
+
+ sprintf (name, "label%d", i++);
+
+#ifdef HAVE_MOTIF
+ xmstr = XmStringCreate (head, XmSTRING_DEFAULT_CHARSET);
+ ac = 0;
+ XtSetArg (av[ac], XmNlabelString, xmstr); ac++;
+ label = XmCreateLabelGadget (container, name, av, ac);
+ XtManageChild (label);
+ XmStringFree (xmstr);
+#else /* HAVE_ATHENA */
+
+ label = XtVaCreateManagedWidget (name, labelWidgetClass,
+ form,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainRight,
+ XtNlabel, head,
+ (label ? XtNfromVert : XtNtop),
+ (label ? label : XtChainTop),
+ 0);
+
+#endif /* HAVE_ATHENA */
+
+ if (s)
+ head = s+1;
+ else
+ head = 0;
}
- if (p->verbose_p)
- fprintf (stderr, "%s: Demo Mode done.\n", blurb());
+#ifdef HAVE_MOTIF
+
+ XtManageChild (container);
+ XtRealizeWidget (dialog);
+ XtManageChild (dialog);
+
+#else /* HAVE_ATHENA */
+
+ ok = XtVaCreateManagedWidget ("ok", commandWidgetClass, form,
+ XtNleft, XtChainLeft,
+ XtNbottom, XtChainBottom,
+ XtNfromVert, label,
+ 0);
- kill_screenhack (si);
+ XtRealizeWidget (dialog);
+ XtPopup (dialog, XtGrabNone);
- destroy_screenhack_dialogs (si);
- initialize_screensaver_window (si);
+#endif /* HAVE_ATHENA */
- si->dbox_up_p = False;
- si->demo_hack = 0;
+ add_button_callback (ok, warning_dialog_dismiss_cb, dialog);
- si->demo_mode_p = True; /* kludge to inhibit unfade... */
- unblank_screen (si);
- si->demo_mode_p = False;
+ free (msg);
}
-static void
-demo_mode_hack (saver_info *si, char *hack)
+
+\f
+/* The main demo-mode command loop.
+ */
+
+#if 0
+static Bool
+mapper (XrmDatabase *db, XrmBindingList bindings, XrmQuarkList quarks,
+ XrmRepresentation *type, XrmValue *value, XPointer closure)
{
- if (! si->demo_mode_p) abort ();
- kill_screenhack (si);
- if (! si->demo_hack)
- blank_screen (si);
- si->demo_hack = hack;
- spawn_screenhack (si, False);
- /* raise_screenhack_dialog(); */
+ int i;
+ for (i = 0; quarks[i]; i++)
+ {
+ if (bindings[i] == XrmBindTightly)
+ fprintf (stderr, (i == 0 ? "" : "."));
+ else if (bindings[i] == XrmBindLoosely)
+ fprintf (stderr, "*");
+ else
+ fprintf (stderr, " ??? ");
+ fprintf(stderr, "%s", XrmQuarkToString (quarks[i]));
+ }
+
+ fprintf (stderr, ": %s\n", (char *) value->addr);
+
+ return False;
}
+#endif
static void
-demo_mode_done (saver_info *si)
+the_network_is_not_the_computer (Widget parent)
+{
+ Display *dpy = XtDisplay (parent);
+ char *rversion, *ruser, *rhost;
+ char *luser, *lhost;
+ char *msg = 0;
+ struct passwd *p = getpwuid (getuid ());
+ const char *d = DisplayString (dpy);
+
+# if defined(HAVE_UNAME)
+ struct utsname uts;
+ if (uname (&uts) < 0)
+ lhost = "<UNKNOWN>";
+ else
+ lhost = uts.nodename;
+# elif defined(VMS)
+ strcpy (lhost, getenv("SYS$NODE"));
+# else /* !HAVE_UNAME && !VMS */
+ strcat (lhost, "<UNKNOWN>");
+# endif /* !HAVE_UNAME && !VMS */
+
+ if (p && p->pw_name)
+ luser = p->pw_name;
+ else
+ luser = "???";
+
+ server_xscreensaver_version (dpy, &rversion, &ruser, &rhost);
+
+ /* Make a buffer that's big enough for a number of copies of all the
+ strings, plus some. */
+ msg = (char *) malloc (10 * ((rversion ? strlen(rversion) : 0) +
+ (ruser ? strlen(ruser) : 0) +
+ (rhost ? strlen(rhost) : 0) +
+ strlen(lhost) +
+ strlen(luser) +
+ strlen(d) +
+ 30));
+ *msg = 0;
+
+ if (!rversion || !*rversion)
+ {
+ sprintf (msg,
+ "Warning:\n\n"
+ "xscreensaver doesn't seem to be running on display \"%s\".",
+ d);
+ }
+ else if (p && ruser && *ruser && !!strcmp (ruser, p->pw_name))
+ {
+ /* Warn that the two processes are running as different users.
+ */
+ sprintf(msg,
+ "Warning:\n\n"
+ "%s is running as user \"%s\" on host \"%s\".\n"
+ "But the xscreensaver managing display \"%s\"\n"
+ "is running as user \"%s\" on host \"%s\".\n"
+ "\n"
+ "Since they are different users, they won't be reading/writing\n"
+ "the same ~/.xscreensaver file, so %s isn't\n"
+ "going to work right.\n"
+ "\n"
+ "Either re-run %s as \"%s\", or re-run\n"
+ "xscreensaver as \"%s\".\n",
+ progname, luser, lhost,
+ d,
+ (ruser ? ruser : "???"), (rhost ? rhost : "???"),
+ progname,
+ progname, (ruser ? ruser : "???"),
+ luser);
+ }
+ else if (rhost && *rhost && !!strcmp (rhost, lhost))
+ {
+ /* Warn that the two processes are running on different hosts.
+ */
+ sprintf (msg,
+ "Warning:\n\n"
+ "%s is running as user \"%s\" on host \"%s\".\n"
+ "But the xscreensaver managing display \"%s\"\n"
+ "is running as user \"%s\" on host \"%s\".\n"
+ "\n"
+ "If those two machines don't share a file system (that is,\n"
+ "if they don't see the same ~%s/.xscreensaver file) then\n"
+ "%s won't work right.",
+ progname, luser, lhost,
+ d,
+ (ruser ? ruser : "???"), (rhost ? rhost : "???"),
+ luser,
+ progname);
+ }
+ else if (!!strcmp (rversion, short_version))
+ {
+ /* Warn that the version numbers don't match.
+ */
+ sprintf (msg,
+ "Warning:\n\n"
+ "This is %s version %s.\n"
+ "But the xscreensaver managing display \"%s\"\n"
+ "is version %s. This could cause problems.",
+ progname, short_version,
+ d,
+ rversion);
+ }
+
+
+ if (*msg)
+ warning_dialog (parent, msg);
+
+ free (msg);
+}
+
+
+static char *defaults[] = {
+#include "XScreenSaver_ad.h"
+ 0
+};
+
+int
+main (int argc, char **argv)
{
- si->demo_mode_p = False;
+ XtAppContext app;
+ prefs_pair Pair, *pair;
+ saver_preferences P, P2, *p, *p2;
+ Bool prefs = False;
+ int i;
+ Display *dpy;
+ Widget toplevel_shell;
+ char *real_progname = argv[0];
+ char *s;
+
+ s = strrchr (real_progname, '/');
+ if (s) real_progname = s+1;
+
+ p = &P;
+ p2 = &P2;
+ pair = &Pair;
+ pair->a = p;
+ pair->b = p2;
+ memset (p, 0, sizeof (*p));
+ memset (p2, 0, sizeof (*p2));
+
+ /* We must read exactly the same resources as xscreensaver.
+ That means we must have both the same progclass *and* progname,
+ at least as far as the resource database is concerned. So,
+ put "xscreensaver" in argv[0] while initializing Xt.
+ */
+ argv[0] = "xscreensaver";
+
+ toplevel_shell = XtAppInitialize (&app, progclass, 0, 0, &argc, argv,
+ defaults, 0, 0);
+ dpy = XtDisplay (toplevel_shell);
+ db = XtDatabase (dpy);
+ XtGetApplicationNameAndClass (dpy, &progname, &progclass);
+
+ for (i = 1; i < argc; i++)
+ {
+ char *s = argv[i];
+ if (s[0] == '-' && s[1] == '-')
+ s++;
+ if (!strcmp (s, "-prefs"))
+ prefs = True;
+ else
+ {
+ fprintf (stderr, "usage: %s [ -display dpy-string ] [ -prefs ]\n",
+ real_progname);
+ exit (1);
+ }
+ }
+
+ short_version = (char *) malloc (5);
+ memcpy (short_version, screensaver_id + 17, 4);
+ short_version [4] = 0;
+
+
+ /* Now that Xt has been initialized, we can set our `progname' variable
+ to something that makes more sense (like our "real" argv[0].)
+ */
+ progname = real_progname;
+
+
+ p->db = db;
+ p->fading_possible_p = True;
+ load_init_file (p);
+ *p2 = *p;
+
+#ifdef HAVE_ATHENA
+ global_prefs_kludge = p; /* I hate C so much... */
+#endif /* HAVE_ATHENA */
+
+#if 0
+ {
+ XrmName name = { 0 };
+ XrmClass class = { 0 };
+ int count = 0;
+ XrmEnumerateDatabase (db, &name, &class, XrmEnumAllLevels, mapper,
+ (XtPointer) &count);
+ }
+#endif
+
+
+ XA_VROOT = XInternAtom (dpy, "__SWM_VROOT", False);
+ XA_SCREENSAVER = XInternAtom (dpy, "SCREENSAVER", False);
+ XA_SCREENSAVER_VERSION = XInternAtom (dpy, "_SCREENSAVER_VERSION",False);
+ XA_SCREENSAVER_TIME = XInternAtom (dpy, "_SCREENSAVER_TIME", False);
+ XA_SCREENSAVER_ID = XInternAtom (dpy, "_SCREENSAVER_ID", False);
+ XA_SCREENSAVER_RESPONSE = XInternAtom (dpy, "_SCREENSAVER_RESPONSE", False);
+ XA_SELECT = XInternAtom (dpy, "SELECT", False);
+ XA_DEMO = XInternAtom (dpy, "DEMO", False);
+ XA_RESTART = XInternAtom (dpy, "RESTART", False);
+
+ make_demo_dialog (toplevel_shell, pair);
+
+ if (prefs)
+ {
+ make_preferences_dialog (pair, toplevel_shell);
+ pop_preferences_dialog (pair);
+ }
+
+ the_network_is_not_the_computer (preferences_dialog
+ ? preferences_dialog
+ : demo_dialog);
+
+ XtAppMainLoop(app);
+ exit (0);
}
#include "visual.h" /* for visual_depth() */
-Widget resources_dialog;
-Widget resources_form;
+Widget preferences_dialog;
+Widget preferences_form;
Widget timeout_text;
Widget cycle_text;
Widget fade_text;
-Widget ticks_text;
-Widget lock_time_text;
-Widget passwd_time_text;
+Widget fade_ticks_text;
+Widget lock_timeout_text;
+Widget passwd_timeout_text;
Widget verbose_toggle;
-Widget cmap_toggle;
+Widget install_cmap_toggle;
Widget fade_toggle;
Widget unfade_toggle;
Widget lock_toggle;
-Widget res_done;
-Widget res_cancel;
+Widget prefs_done;
+Widget prefs_cancel;
Widget demo_dialog;
Widget demo_form;
void
-create_resources_dialog(Widget parent, Visual *visual, Colormap colormap)
+create_preferences_dialog(Widget parent, Visual *visual, Colormap colormap)
{
Widget rlabel;
int depth = visual_depth(XtScreen(parent), visual);
- resources_dialog =
- XtVaCreatePopupShell("resources_dialog", transientShellWidgetClass, parent,
- XtNtitle, NULL,
- XtNoverrideRedirect, TRUE,
+ preferences_dialog =
+ XtVaCreatePopupShell("preferences_dialog", transientShellWidgetClass, parent,
XtNvisual, visual,
XtNcolormap, colormap,
XtNdepth, depth,
NULL);
- resources_form =
- XtVaCreateManagedWidget("resources_form", formWidgetClass,
- resources_dialog,
+ preferences_form =
+ XtVaCreateManagedWidget("preferences_form", formWidgetClass,
+ preferences_dialog,
XtNvisual, visual,
XtNcolormap, colormap,
XtNdepth, depth,
NULL);
- rlabel = XtVaCreateManagedWidget("label1", labelWidgetClass, resources_form,
+ rlabel = XtVaCreateManagedWidget("label1", labelWidgetClass, preferences_form,
XtNleft, XtChainLeft,
XtNright, XtChainRight,
XtNtop, XtChainTop,
NULL);
textbox=
- XtVaCreateManagedWidget("textbox", formWidgetClass, resources_form,
+ XtVaCreateManagedWidget("textbox", formWidgetClass, preferences_form,
XtNleft, XtChainLeft,
XtNfromVert, rlabel,
NULL);
okbox=
- XtVaCreateManagedWidget("textbox", boxWidgetClass, resources_form,
+ XtVaCreateManagedWidget("textbox", boxWidgetClass, preferences_form,
XtNleft, XtChainLeft,
XtNright, XtChainRight,
XtNfromVert, textbox,
XtNfromVert, cycle_text,
NULL);
- ticks_text =
+ fade_ticks_text =
XtVaCreateManagedWidget("ticks", dialogWidgetClass, textbox,
XtNtop, XtChainTop,
XtNright, XtChainRight,
XtNfromHoriz, timeout_text,
NULL);
- lock_time_text =
+ lock_timeout_text =
XtVaCreateManagedWidget("lockTime", dialogWidgetClass, textbox,
- XtNfromVert, ticks_text,
+ XtNfromVert, fade_ticks_text,
XtNright, XtChainRight,
XtNfromHoriz, cycle_text,
NULL);
- passwd_time_text =
+ passwd_timeout_text =
XtVaCreateManagedWidget("passwdTime", dialogWidgetClass, textbox,
- XtNfromVert, lock_time_text,
+ XtNfromVert, lock_timeout_text,
XtNright, XtChainRight,
XtNfromHoriz, fade_text,
NULL);
buttonbox=
- XtVaCreateManagedWidget("buttonbox", boxWidgetClass, resources_form,
+ XtVaCreateManagedWidget("buttonbox", boxWidgetClass, preferences_form,
XtNfromVert, rlabel,
XtNfromHoriz, textbox,
XtNright, XtChainRight,
verbose_toggle =
XtVaCreateManagedWidget("verbose", toggleWidgetClass, buttonbox,
NULL);
- cmap_toggle =
+ install_cmap_toggle =
XtVaCreateManagedWidget("cmap", toggleWidgetClass, buttonbox,
NULL);
fade_toggle =
NULL);
- res_done = XtVaCreateManagedWidget("done", commandWidgetClass, okbox,
+ prefs_done = XtVaCreateManagedWidget("done", commandWidgetClass, okbox,
NULL);
- res_cancel = XtVaCreateManagedWidget("cancel", commandWidgetClass, okbox,
+ prefs_cancel = XtVaCreateManagedWidget("cancel", commandWidgetClass, okbox,
NULL);
}
demo_dialog =
XtVaCreatePopupShell("demo_dialog", transientShellWidgetClass, parent,
- XtNtitle, NULL,
- XtNoverrideRedirect, TRUE,
XtNvisual, visual,
XtNcolormap, colormap,
XtNdepth, depth,
demo_form =
XtVaCreateManagedWidget("demo_form", formWidgetClass, demo_dialog,
- XtNvisual, visual,
- XtNcolormap, colormap,
- XtNdepth, depth,
+ XtNvisual, visual,
+ XtNcolormap, colormap,
+ XtNdepth, depth,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainRight,
+ XtNtop, XtChainTop,
NULL);
label1 = XtVaCreateManagedWidget("label1", labelWidgetClass, demo_form,
XtNleft, XtChainLeft,
XtNright, XtChainRight,
XtNfromVert, label2,
+ XtNresizable, True,
NULL);
viewport =
XtVaCreateManagedWidget("viewport", viewportWidgetClass, subform,
next = XtVaCreateManagedWidget("next", commandWidgetClass, box, NULL);
prev = XtVaCreateManagedWidget("prev", commandWidgetClass, box, NULL);
edit = XtVaCreateManagedWidget("edit", commandWidgetClass, box, NULL);
+#if 0
restart = XtVaCreateManagedWidget("restart", commandWidgetClass, box, NULL);
+#endif
done = XtVaCreateManagedWidget("done", commandWidgetClass, box, NULL);
}
#include "visual.h" /* for visual_depth() */
-Widget resources_dialog;
-Widget resources_form;
+Widget preferences_dialog;
+Widget preferences_form;
Widget timeout_text;
Widget cycle_text;
Widget fade_text;
-Widget ticks_text;
-Widget lock_time_text;
-Widget passwd_time_text;
+Widget fade_ticks_text;
+Widget lock_timeout_text;
+Widget passwd_timeout_text;
Widget verbose_toggle;
-Widget cmap_toggle;
+Widget install_cmap_toggle;
Widget fade_toggle;
Widget unfade_toggle;
Widget lock_toggle;
-Widget res_done;
-Widget res_cancel;
+Widget prefs_done;
+Widget prefs_cancel;
Widget demo_dialog;
Widget demo_form;
Widget spacer;
void
-create_resources_dialog(Widget parent, Visual *visual, Colormap colormap)
+create_preferences_dialog(Widget parent, Visual *visual, Colormap colormap)
{
Widget children[22]; /* Children to manage */
Arg al[64]; /* Arg List */
XtSetArg (al[ac], XmNcolormap, colormap); ac++;
XtSetArg (al[ac], XmNdepth, visual_depth(XtScreen(parent), visual)); ac++;
- real_dialog = XmCreatePromptDialog (parent, "resourcesForm", al, ac);
- resources_dialog = XtParent(real_dialog);
+ real_dialog = XmCreatePromptDialog (parent, "preferencesForm", al, ac);
+ preferences_dialog = XtParent(real_dialog);
w = XmSelectionBoxGetChild (real_dialog, XmDIALOG_SEPARATOR);
if (w) XtUnmanageChild (w);
XtSetArg (al [ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
XtSetArg (al [ac], XmNleftAttachment, XmATTACH_FORM); ac++;
XtSetArg (al [ac], XmNrightAttachment, XmATTACH_FORM); ac++;
- resources_form = XmCreateForm (real_dialog, "form", al, ac);
- XtManageChild (resources_form);
+ preferences_form = XmCreateForm (real_dialog, "form", al, ac);
+ XtManageChild (preferences_form);
ac = 0;
- widget12 = XmCreateLabel ( resources_form, "resourcesLabel", al, ac );
- widget13 = XmCreateSeparator ( resources_form, "separator", al, ac );
+ widget12 = XmCreateLabel ( preferences_form, "preferencesLabel", al, ac );
+ widget13 = XmCreateSeparator ( preferences_form, "separator", al, ac );
XtSetArg(al[ac], XmNalignment, XmALIGNMENT_END); ac++;
- widget14 = XmCreateLabel ( resources_form, "timeoutLabel", al, ac );
+ widget14 = XmCreateLabel ( preferences_form, "timeoutLabel", al, ac );
ac = 0;
XtSetArg(al[ac], XmNalignment, XmALIGNMENT_END); ac++;
- widget15 = XmCreateLabel ( resources_form, "cycleLabel", al, ac );
+ widget15 = XmCreateLabel ( preferences_form, "cycleLabel", al, ac );
ac = 0;
XtSetArg(al[ac], XmNalignment, XmALIGNMENT_END); ac++;
- widget16 = XmCreateLabel ( resources_form, "fadeSecondsLabel", al, ac );
+ widget16 = XmCreateLabel ( preferences_form, "fadeSecondsLabel", al, ac );
ac = 0;
XtSetArg(al[ac], XmNalignment, XmALIGNMENT_END); ac++;
- widget17 = XmCreateLabel ( resources_form, "fadeTicksLabel", al, ac );
+ widget17 = XmCreateLabel ( preferences_form, "fadeTicksLabel", al, ac );
ac = 0;
XtSetArg(al[ac], XmNalignment, XmALIGNMENT_END); ac++;
- widget18 = XmCreateLabel ( resources_form, "lockLabel", al, ac );
+ widget18 = XmCreateLabel ( preferences_form, "lockLabel", al, ac );
ac = 0;
XtSetArg(al[ac], XmNalignment, XmALIGNMENT_END); ac++;
- widget48 = XmCreateLabel ( resources_form, "passwdLabel", al, ac );
- ac = 0;
- timeout_text = XmCreateTextField ( resources_form, "timeoutText", al, ac );
- cycle_text = XmCreateTextField ( resources_form, "cycleText", al, ac );
- fade_text = XmCreateTextField ( resources_form, "fadeSecondsText", al, ac );
- ticks_text = XmCreateTextField ( resources_form, "fadeTicksText", al, ac );
- lock_time_text = XmCreateTextField ( resources_form, "passwdText", al, ac );
- passwd_time_text = XmCreateTextField ( resources_form, "lockText", al, ac );
+ widget48 = XmCreateLabel ( preferences_form, "passwdLabel", al, ac );
+ ac = 0;
+ timeout_text = XmCreateTextField ( preferences_form, "timeoutText", al, ac );
+ cycle_text = XmCreateTextField ( preferences_form, "cycleText", al, ac );
+ fade_text = XmCreateTextField ( preferences_form, "fadeSecondsText", al, ac);
+ fade_ticks_text = XmCreateTextField ( preferences_form, "fadeTicksText", al, ac);
+ lock_timeout_text = XmCreateTextField ( preferences_form, "passwdText", al, ac);
+ passwd_timeout_text = XmCreateTextField ( preferences_form, "lockText", al, ac);
XtSetArg(al[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
- verbose_toggle = XmCreateToggleButton ( resources_form, "verboseToggle", al, ac );
+ verbose_toggle = XmCreateToggleButton (preferences_form,"verboseToggle",al,ac);
ac = 0;
XtSetArg(al[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
- cmap_toggle = XmCreateToggleButton ( resources_form, "cmapToggle", al, ac );
+ install_cmap_toggle = XmCreateToggleButton ( preferences_form, "cmapToggle", al, ac);
ac = 0;
XtSetArg(al[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
- fade_toggle = XmCreateToggleButton ( resources_form, "fadeToggle", al, ac );
+ fade_toggle = XmCreateToggleButton ( preferences_form, "fadeToggle", al, ac);
ac = 0;
XtSetArg(al[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
- unfade_toggle = XmCreateToggleButton ( resources_form, "unfadeToggle", al, ac );
+ unfade_toggle = XmCreateToggleButton (preferences_form,"unfadeToggle",al,ac);
ac = 0;
XtSetArg(al[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
- lock_toggle = XmCreateToggleButton ( resources_form, "lockToggle", al, ac );
+ lock_toggle = XmCreateToggleButton ( preferences_form, "lockToggle", al, ac);
ac = 0;
- widget29 = XmCreateSeparator ( resources_form, "separator", al, ac );
+ widget29 = XmCreateSeparator ( preferences_form, "separator", al, ac );
- res_done = XmSelectionBoxGetChild (real_dialog, XmDIALOG_OK_BUTTON);
- res_cancel = XmSelectionBoxGetChild (real_dialog, XmDIALOG_CANCEL_BUTTON);
+ prefs_done = XmSelectionBoxGetChild (real_dialog, XmDIALOG_OK_BUTTON);
+ prefs_cancel = XmSelectionBoxGetChild (real_dialog, XmDIALOG_CANCEL_BUTTON);
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
XtSetArg(al[ac], XmNtopOffset, 4); ac++;
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNtopOffset, 0); ac++;
- XtSetArg(al[ac], XmNtopWidget, ticks_text); ac++;
+ XtSetArg(al[ac], XmNtopWidget, fade_ticks_text); ac++;
XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNbottomOffset, 0); ac++;
- XtSetArg(al[ac], XmNbottomWidget, ticks_text); ac++;
+ XtSetArg(al[ac], XmNbottomWidget, fade_ticks_text); ac++;
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
XtSetArg(al[ac], XmNleftOffset, 20); ac++;
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_WIDGET); ac++;
XtSetArg(al[ac], XmNrightOffset, 4); ac++;
- XtSetArg(al[ac], XmNrightWidget, ticks_text); ac++;
+ XtSetArg(al[ac], XmNrightWidget, fade_ticks_text); ac++;
XtSetValues ( widget17,al, ac );
ac = 0;
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNtopOffset, 0); ac++;
- XtSetArg(al[ac], XmNtopWidget, lock_time_text); ac++;
+ XtSetArg(al[ac], XmNtopWidget, lock_timeout_text); ac++;
XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNbottomOffset, 0); ac++;
- XtSetArg(al[ac], XmNbottomWidget, lock_time_text); ac++;
+ XtSetArg(al[ac], XmNbottomWidget, lock_timeout_text); ac++;
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
XtSetArg(al[ac], XmNleftOffset, 19); ac++;
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_WIDGET); ac++;
XtSetArg(al[ac], XmNrightOffset, 4); ac++;
- XtSetArg(al[ac], XmNrightWidget, lock_time_text); ac++;
+ XtSetArg(al[ac], XmNrightWidget, lock_timeout_text); ac++;
XtSetValues ( widget18,al, ac );
ac = 0;
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNtopOffset, 0); ac++;
- XtSetArg(al[ac], XmNtopWidget, passwd_time_text); ac++;
+ XtSetArg(al[ac], XmNtopWidget, passwd_timeout_text); ac++;
XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNbottomOffset, 0); ac++;
- XtSetArg(al[ac], XmNbottomWidget, passwd_time_text); ac++;
+ XtSetArg(al[ac], XmNbottomWidget, passwd_timeout_text); ac++;
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
XtSetArg(al[ac], XmNleftOffset, 14); ac++;
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_WIDGET); ac++;
XtSetArg(al[ac], XmNrightOffset, 4); ac++;
- XtSetArg(al[ac], XmNrightWidget, passwd_time_text); ac++;
+ XtSetArg(al[ac], XmNrightWidget, passwd_timeout_text); ac++;
XtSetValues ( widget48,al, ac );
ac = 0;
XtSetArg(al[ac], XmNleftOffset, 0); ac++;
XtSetArg(al[ac], XmNleftWidget, fade_text); ac++;
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
- XtSetValues ( ticks_text,al, ac );
+ XtSetValues ( fade_ticks_text,al, ac );
ac = 0;
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
XtSetArg(al[ac], XmNtopOffset, 2); ac++;
- XtSetArg(al[ac], XmNtopWidget, ticks_text); ac++;
+ XtSetArg(al[ac], XmNtopWidget, fade_ticks_text); ac++;
XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNleftOffset, 0); ac++;
- XtSetArg(al[ac], XmNleftWidget, ticks_text); ac++;
+ XtSetArg(al[ac], XmNleftWidget, fade_ticks_text); ac++;
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
- XtSetValues ( lock_time_text,al, ac );
+ XtSetValues ( lock_timeout_text,al, ac );
ac = 0;
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
XtSetArg(al[ac], XmNtopOffset, 4); ac++;
- XtSetArg(al[ac], XmNtopWidget, lock_time_text); ac++;
+ XtSetArg(al[ac], XmNtopWidget, lock_timeout_text); ac++;
XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNleftOffset, 0); ac++;
- XtSetArg(al[ac], XmNleftWidget, lock_time_text); ac++;
+ XtSetArg(al[ac], XmNleftWidget, lock_timeout_text); ac++;
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
- XtSetValues ( passwd_time_text,al, ac );
+ XtSetValues ( passwd_timeout_text,al, ac );
ac = 0;
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
XtSetArg(al[ac], XmNleftWidget, verbose_toggle); ac++;
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
XtSetArg(al[ac], XmNrightOffset, 20); ac++;
- XtSetValues ( cmap_toggle,al, ac );
+ XtSetValues ( install_cmap_toggle,al, ac );
ac = 0;
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNbottomWidget, fade_text); ac++;
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNleftOffset, 0); ac++;
- XtSetArg(al[ac], XmNleftWidget, cmap_toggle); ac++;
+ XtSetArg(al[ac], XmNleftWidget, install_cmap_toggle); ac++;
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
XtSetArg(al[ac], XmNrightOffset, 20); ac++;
XtSetValues ( fade_toggle,al, ac );
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNtopOffset, 0); ac++;
- XtSetArg(al[ac], XmNtopWidget, ticks_text); ac++;
+ XtSetArg(al[ac], XmNtopWidget, fade_ticks_text); ac++;
XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNbottomOffset, 0); ac++;
- XtSetArg(al[ac], XmNbottomWidget, ticks_text); ac++;
+ XtSetArg(al[ac], XmNbottomWidget, fade_ticks_text); ac++;
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNleftOffset, 0); ac++;
XtSetArg(al[ac], XmNleftWidget, fade_toggle); ac++;
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNtopOffset, 0); ac++;
- XtSetArg(al[ac], XmNtopWidget, lock_time_text); ac++;
+ XtSetArg(al[ac], XmNtopWidget, lock_timeout_text); ac++;
XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNbottomOffset, 0); ac++;
- XtSetArg(al[ac], XmNbottomWidget, lock_time_text); ac++;
+ XtSetArg(al[ac], XmNbottomWidget, lock_timeout_text); ac++;
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
XtSetArg(al[ac], XmNleftOffset, 0); ac++;
XtSetArg(al[ac], XmNleftWidget, unfade_toggle); ac++;
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
XtSetArg(al[ac], XmNtopOffset, 0); ac++;
- XtSetArg(al[ac], XmNtopWidget, passwd_time_text); ac++;
+ XtSetArg(al[ac], XmNtopWidget, passwd_timeout_text); ac++;
XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
XtSetArg(al[ac], XmNbottomOffset, 4); ac++;
children[ac++] = timeout_text;
children[ac++] = cycle_text;
children[ac++] = fade_text;
- children[ac++] = ticks_text;
- children[ac++] = lock_time_text;
- children[ac++] = passwd_time_text;
+ children[ac++] = fade_ticks_text;
+ children[ac++] = lock_timeout_text;
+ children[ac++] = passwd_timeout_text;
children[ac++] = verbose_toggle;
- children[ac++] = cmap_toggle;
+ children[ac++] = install_cmap_toggle;
children[ac++] = fade_toggle;
children[ac++] = unfade_toggle;
children[ac++] = lock_toggle;
XtManageChildren(children, ac);
ac = 0;
- resources_form = real_dialog;
+ preferences_form = real_dialog;
}
prev = XmCreatePushButton ( real_dialog, "prev", al, ac );
edit = XmCreatePushButton ( real_dialog, "edit", al, ac );
done = XmCreatePushButton ( real_dialog, "done", al, ac );
+#if 0
restart = XmCreatePushButton ( real_dialog, "restart", al, ac );
+#endif
XtManageChild(next);
XtManageChild(prev);
XtManageChild(edit);
XtManageChild(done);
+#if 0
XtManageChild(restart);
+#endif
ac = 0;
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
+++ /dev/null
-/* dotfile.c --- management of the ~/.xscreensaver file.
- * xscreensaver, Copyright (c) 1998 Jamie Zawinski <jwz@jwz.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation. No representations are made about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <X11/Xlib.h>
-#include <X11/Xresource.h>
-
-#ifndef VMS
-# include <pwd.h>
-#else /* VMS */
-# include "vms-pwd.h"
-#endif /* VMS */
-
-
-/* This file doesn't need the Xt headers, so stub these types out... */
-#undef XtPointer
-#define XtAppContext void*
-#define XtIntervalId void*
-#define XtPointer void*
-#define Widget void*
-
-#include "xscreensaver.h"
-#include "resources.h"
-
-/* Just in case there's something pathological about stat.h... */
-#ifndef S_IRUSR
-# define S_IRUSR 00400
-#endif
-#ifndef S_IWUSR
-# define S_IWUSR 00200
-#endif
-#ifndef S_IXUSR
-# define S_IXUSR 00100
-#endif
-#ifndef S_IXGRP
-# define S_IXGRP 00010
-#endif
-#ifndef S_IXOTH
-# define S_IXOTH 00001
-#endif
-
-
-static const char *
-init_file_name (void)
-{
- static char *file = 0;
-
- if (!file)
- {
- struct passwd *p = getpwuid (getuid ());
-
- if (!p || !p->pw_name || !*p->pw_name)
- {
- fprintf (stderr, "%s: couldn't get user info of uid %d\n",
- blurb(), getuid ());
- file = "";
- }
- else if (!p->pw_dir || !*p->pw_dir)
- {
- fprintf (stderr, "%s: couldn't get home directory of %s\n",
- blurb(), (p->pw_name ? p->pw_name : "???"));
- file = "";
- }
- else
- {
- const char *home = p->pw_dir;
- const char *name = ".xscreensaver";
- file = (char *) malloc(strlen(home) + strlen(name) + 2);
- strcpy(file, home);
- if (!*home || home[strlen(home)-1] != '/')
- strcat(file, "/");
- strcat(file, name);
- }
- }
-
- if (file && *file)
- return file;
- else
- return 0;
-}
-
-
-static const char *
-init_file_tmp_name (void)
-{
- static char *file = 0;
- if (!file)
- {
- const char *name = init_file_name();
- const char *suffix = ".tmp";
- if (!name || !*name)
- file = "";
- else
- {
- file = (char *) malloc(strlen(name) + strlen(suffix) + 2);
- strcpy(file, name);
- strcat(file, suffix);
- }
- }
-
- if (file && *file)
- return file;
- else
- return 0;
-}
-
-
-static const char * const prefs[] = {
- "timeout",
- "cycle",
- "lock",
- "lockVTs",
- "lockTimeout",
- "passwdTimeout",
- "visualID",
- "installColormap",
- "verbose",
- "timestamp",
- "splash", /* not saved -- same as "splashDuration: 0" */
- "splashDuration",
- "helpURL",
- "loadURL",
- "nice",
- "fade",
- "unfade",
- "fadeSeconds",
- "fadeTicks",
- "captureStderr",
- "captureStdout", /* not saved -- obsolete */
- "font",
- "",
- "programs",
- "",
- "pointerPollTime",
- "windowCreationTimeout",
- "initialDelay",
- "sgiSaverExtension",
- "mitSaverExtension",
- "xidleExtension",
- "overlayStderr",
- "overlayTextBackground", /* not saved -- X resources only */
- "overlayTextForeground", /* not saved -- X resources only */
- "bourneShell", /* not saved -- X resources only */
- 0
-};
-
-static char *strip(char *s)
-{
- char *s2;
- while (*s == '\t' || *s == ' ' || *s == '\r' || *s == '\n')
- s++;
- for (s2 = s; *s2; s2++)
- ;
- for (s2--; s2 >= s; s2--)
- if (*s2 == '\t' || *s2 == ' ' || *s2 == '\r' || *s2 =='\n')
- *s2 = 0;
- else
- break;
- return s;
-}
-
-\f
-/* Reading
- */
-
-static int
-handle_entry (saver_info *si, const char *key, const char *value,
- const char *filename, int line)
-{
- int i;
- for (i = 0; prefs[i]; i++)
- if (*prefs[i] && !strcasecmp(key, prefs[i]))
- {
- char *val = strdup(value);
- char *spec = (char *) malloc(strlen(progclass) + strlen(prefs[i]) +10);
- strcpy(spec, progclass);
- strcat(spec, ".");
- strcat(spec, prefs[i]);
-
- XrmPutStringResource (&si->db, spec, val);
-
- free(spec);
- free(val);
- return 0;
- }
-
- fprintf(stderr, "%s: %s:%d: unknown option \"%s\"\n",
- blurb(), filename, line, key);
- return 1;
-}
-
-int
-read_init_file (saver_info *si)
-{
- time_t write_date = 0;
- const char *name = init_file_name();
- int line = 0;
- struct stat st;
- FILE *in;
- int buf_size = 1024;
- char *buf;
-
- if (!name) return 0;
-
- if (stat(name, &st) != 0)
- {
- si->init_file_date = 0;
- return 0;
- }
-
- in = fopen(name, "r");
- if (!in)
- {
- char *buf = (char *) malloc(1024 + strlen(name));
- sprintf(buf, "%s: error reading %s", blurb(), name);
- perror(buf);
- free(buf);
- return -1;
- }
-
- if (fstat (fileno(in), &st) == 0)
- {
- write_date = st.st_mtime;
- }
- else
- {
- char *buf = (char *) malloc(1024 + strlen(name));
- sprintf(buf, "%s: couldn't re-stat %s", blurb(), name);
- perror(buf);
- free(buf);
- return -1;
- }
-
- buf = (char *) malloc(buf_size);
-
- while (fgets (buf, buf_size-1, in))
- {
- char *key, *value;
- int L = strlen(buf);
-
- line++;
- while (L > 2 &&
- (buf[L-1] != '\n' || /* whole line didn't fit in buffer */
- buf[L-2] == '\\')) /* or line ended with backslash */
- {
- if (buf[L-2] == '\\') /* backslash-newline gets swallowed */
- {
- buf[L-2] = 0;
- L -= 2;
- }
- buf_size += 1024;
- buf = (char *) realloc(buf, buf_size);
- if (!buf) exit(1);
-
- line++;
- if (!fgets (buf + L, buf_size-L-1, in))
- break;
- L = strlen(buf);
- }
-
- /* Now handle other backslash escapes. */
- {
- int i, j;
- for (i = 0; buf[i]; i++)
- if (buf[i] == '\\')
- {
- switch (buf[i+1])
- {
- case 'n': buf[i] = '\n'; break;
- case 'r': buf[i] = '\r'; break;
- case 't': buf[i] = '\t'; break;
- default: buf[i] = buf[i+1]; break;
- }
- for (j = i+2; buf[j]; j++)
- buf[j-1] = buf[j];
- buf[j-1] = 0;
- }
- }
-
- key = strip(buf);
-
- if (*key == '#' || *key == '!' || *key == ';' ||
- *key == '\n' || *key == 0)
- continue;
-
- value = strchr (key, ':');
- if (!value)
- {
- fprintf(stderr, "%s: %s:%d: unparsable line: %s\n", blurb(),
- name, line, key);
- continue;
- }
- else
- {
- *value++ = 0;
- value = strip(value);
- }
-
- handle_entry (si, key, value, name, line);
- }
- free(buf);
-
- si->init_file_date = write_date;
- return 0;
-}
-
-
-int
-maybe_reload_init_file (saver_info *si)
-{
- saver_preferences *p = &si->prefs;
- const char *name = init_file_name();
- struct stat st;
- int status = 0;
-
- if (!name) return 0;
-
- if (stat(name, &st) != 0)
- return 0;
-
- if (si->init_file_date == st.st_mtime)
- return 0;
-
- if (p->verbose_p)
- fprintf (stderr, "%s: file %s has changed, reloading.\n", blurb(), name);
-
- status = read_init_file (si);
- if (status == 0)
- get_resources (si);
- return status;
-}
-
-\f
-/* Writing
- */
-
-static int
-tab_to (FILE *out, int from, int to)
-{
- int tab_width = 8;
- int to_mod = (to / tab_width) * tab_width;
- while (from < to_mod)
- {
- fprintf(out, "\t");
- from = (((from / tab_width) + 1) * tab_width);
- }
- while (from < to)
- {
- fprintf(out, " ");
- from++;
- }
- return from;
-}
-
-static void
-write_entry (FILE *out, const char *key, const char *value)
-{
- char *v = strdup(value ? value : "");
- char *v2 = v;
- char *nl = 0;
- int col;
- Bool do_visual_kludge = (!strcmp(key, "programs"));
- Bool do_wrap = do_visual_kludge;
- int tab = (do_visual_kludge ? 16 : 23);
- int tab2 = 3;
- Bool first = True;
-
- fprintf(out, "%s:", key);
- col = strlen(key) + 1;
-
- while (1)
- {
- char *s;
- if (first)
- first = False;
- else
- {
- col = tab_to(out, col, 75);
- fprintf(out, " \\n\\\n");
- col = 0;
- }
-
- v2 = strip(v2);
- nl = strchr(v2, '\n');
- if (nl)
- *nl = 0;
-
- s = (do_visual_kludge ? strpbrk(v2, " \t\n:") : 0);
- if (s && *s == ':')
- col = tab_to (out, col, tab2);
- else
- col = tab_to (out, col, tab);
-
- if (do_wrap &&
- strlen(v2) + col > 75)
- {
- int L = strlen(v2);
- int start = 0;
- int end = start;
- while (start < L)
- {
- while (v2[end] == ' ' || v2[end] == '\t')
- end++;
- while (v2[end] != ' ' && v2[end] != '\t' &&
- v2[end] != '\n' && v2[end] != 0)
- end++;
- if (col + (end - start) >= 74)
- {
- col = tab_to (out, col, 75);
- fprintf(out, " \\\n");
- col = tab_to (out, 0, tab + 2);
- while (v2[start] == ' ' || v2[start] == '\t')
- start++;
- }
-
- while (start < end)
- {
- fputc(v2[start++], out);
- col++;
- }
- }
- }
- else
- {
- fprintf (out, "%s", v2);
- col += strlen(v2);
- }
-
- if (nl)
- v2 = nl + 1;
- else
- break;
- }
-
- fprintf(out, "\n");
- free(v);
-}
-
-int
-write_init_file (saver_info *si)
-{
- const char *name = init_file_name();
- const char *tmp_name = init_file_tmp_name();
- struct stat st;
- saver_preferences *p = &si->prefs;
- int i, j;
-
- /* Kludge, since these aren't in the saver_preferences struct as strings...
- */
- char *visual_name;
- char *programs;
- Bool capture_stderr_p;
- Bool overlay_stderr_p;
- char *stderr_font;
- FILE *out;
-
- if (!name) return 0;
-
- if (si->dangerous_uid_p)
- {
- if (p->verbose_p)
- {
- fprintf (stderr, "%s: not writing \"%s\":\n", blurb(), name);
- describe_uids (si, stderr);
- }
- return 0;
- }
-
- if (p->verbose_p)
- fprintf (stderr, "%s: writing \"%s\".\n", blurb(), name);
-
- unlink (tmp_name);
- out = fopen(tmp_name, "w");
- if (!out)
- {
- char *buf = (char *) malloc(1024 + strlen(name));
- sprintf(buf, "%s: error writing %s", blurb(), name);
- perror(buf);
- free(buf);
- return -1;
- }
-
- /* Give the new .xscreensaver file the same permissions as the old one;
- except ensure that it is readable and writable by owner, and not
- executable.
- */
- if (stat(name, &st) == 0)
- {
- mode_t mode = st.st_mode;
- mode |= S_IRUSR | S_IWUSR;
- mode &= ~(S_IXUSR | S_IXGRP | S_IXOTH);
- if (fchmod (fileno(out), mode) != 0)
- {
- char *buf = (char *) malloc(1024 + strlen(name));
- sprintf (buf, "%s: error fchmodding %s to 0%o", blurb(),
- tmp_name, (unsigned int) mode);
- perror(buf);
- free(buf);
- return -1;
- }
- }
-
- /* Kludge, since these aren't in the saver_preferences struct... */
- visual_name = get_string_resource ("visualID", "VisualID");
- programs = 0;
- capture_stderr_p = get_boolean_resource ("captureStderr", "Boolean");
- overlay_stderr_p = get_boolean_resource ("overlayStderr", "Boolean");
- stderr_font = get_string_resource ("font", "Font");
-
- i = 0;
- for (j = 0; j < p->screenhacks_count; j++)
- i += strlen(p->screenhacks[j]) + 2;
- {
- char *ss = programs = (char *) malloc(i + 10);
- *ss = 0;
- for (j = 0; j < p->screenhacks_count; j++)
- {
- strcat(ss, p->screenhacks[j]);
- ss += strlen(ss);
- *ss++ = '\n';
- *ss = 0;
- }
- }
-
- {
- struct passwd *p = getpwuid (getuid ());
- char *whoami = (p && p->pw_name && *p->pw_name
- ? p->pw_name : "<unknown>");
- fprintf (out,
- "# %s Preferences File\n"
- "# Written by %s %s for %s on %s.\n"
- "# http://www.jwz.org/xscreensaver/\n"
- "\n",
- progclass, progname, si->version,
- (whoami ? whoami : "<unknown>"),
- timestring());
- }
-
- for (j = 0; prefs[j]; j++)
- {
- char buf[255];
- const char *pr = prefs[j];
- enum pref_type { pref_str, pref_int, pref_bool, pref_time
- } type = pref_str;
- const char *s = 0;
- int i = 0;
- Bool b = False;
- Time t = 0;
-
- if (pr && !*pr)
- {
- fprintf(out, "\n");
- continue;
- }
-
-# undef CHECK
-# define CHECK(X) else if (!strcmp(pr, X))
- if (!pr || !*pr) ;
- CHECK("timeout") type = pref_time, t = p->timeout;
- CHECK("cycle") type = pref_time, t = p->cycle;
- CHECK("lock") type = pref_bool, b = p->lock_p;
-# if 0 /* #### not ready yet */
- CHECK("lockVTs") type = pref_bool, b = p->lock_vt_p;
-# else
- CHECK("lockVTs") continue; /* don't save */
-# endif
- CHECK("lockTimeout") type = pref_time, t = p->lock_timeout;
- CHECK("passwdTimeout") type = pref_time, t = p->passwd_timeout;
- CHECK("visualID") type = pref_str, s = visual_name;
- CHECK("installColormap") type = pref_bool, b = p->install_cmap_p;
- CHECK("verbose") type = pref_bool, b = p->verbose_p;
- CHECK("timestamp") type = pref_bool, b = p->timestamp_p;
- CHECK("splash") continue; /* don't save */
- CHECK("splashDuration") type = pref_time, t = p->splash_duration;
- CHECK("helpURL") type = pref_str, s = p->help_url;
- CHECK("loadURL") type = pref_str, s = p->load_url_command;
- CHECK("nice") type = pref_int, i = p->nice_inferior;
- CHECK("fade") type = pref_bool, b = p->fade_p;
- CHECK("unfade") type = pref_bool, b = p->unfade_p;
- CHECK("fadeSeconds") type = pref_time, t = p->fade_seconds;
- CHECK("fadeTicks") type = pref_int, i = p->fade_ticks;
- CHECK("captureStderr") type = pref_bool, b = capture_stderr_p;
- CHECK("captureStdout") continue; /* don't save */
- CHECK("font") type = pref_str, s = stderr_font;
- CHECK("programs") type = pref_str, s = programs;
- CHECK("pointerPollTime") type = pref_time, t = p->pointer_timeout;
- CHECK("windowCreationTimeout")type=pref_time,t= p->notice_events_timeout;
- CHECK("initialDelay") type = pref_time, t = p->initial_delay;
- CHECK("sgiSaverExtension")type = pref_bool, b=p->use_sgi_saver_extension;
- CHECK("mitSaverExtension")type = pref_bool, b=p->use_mit_saver_extension;
- CHECK("xidleExtension") type = pref_bool, b = p->use_xidle_extension;
- CHECK("overlayStderr") type = pref_bool, b = overlay_stderr_p;
- CHECK("overlayTextBackground") continue; /* don't save */
- CHECK("overlayTextForeground") continue; /* don't save */
- CHECK("bourneShell") continue;
- else abort();
-# undef CHECK
-
- switch (type)
- {
- case pref_str:
- break;
- case pref_int:
- sprintf(buf, "%d", i);
- s = buf;
- break;
- case pref_bool:
- s = b ? "True" : "False";
- break;
- case pref_time:
- {
- unsigned int hour = 0, min = 0, sec = (unsigned int) (t/1000);
- if (sec >= 60)
- {
- min += (sec / 60);
- sec %= 60;
- }
- if (min >= 60)
- {
- hour += (min / 60);
- min %= 60;
- }
- sprintf (buf, "%u:%02u:%02u", hour, min, sec);
- s = buf;
- }
- break;
- default:
- abort();
- break;
- }
- write_entry (out, pr, s);
- }
-
- fprintf(out, "\n");
-
- if (visual_name) free(visual_name);
- if (stderr_font) free(stderr_font);
- if (programs) free(programs);
-
- if (fclose(out) == 0)
- {
- time_t write_date = 0;
-
- if (stat(tmp_name, &st) == 0)
- {
- write_date = st.st_mtime;
- }
- else
- {
- char *buf = (char *) malloc(1024 + strlen(tmp_name) + strlen(name));
- sprintf(buf, "%s: couldn't stat %s", blurb(), tmp_name);
- perror(buf);
- unlink (tmp_name);
- free(buf);
- return -1;
- }
-
- if (rename (tmp_name, name) != 0)
- {
- char *buf = (char *) malloc(1024 + strlen(tmp_name) + strlen(name));
- sprintf(buf, "%s: error renaming %s to %s", blurb(), tmp_name, name);
- perror(buf);
- unlink (tmp_name);
- free(buf);
- return -1;
- }
- else
- {
- si->init_file_date = write_date;
- }
- }
- else
- {
- char *buf = (char *) malloc(1024 + strlen(name));
- sprintf(buf, "%s: error closing %s", blurb(), name);
- perror(buf);
- free(buf);
- unlink (tmp_name);
- return -1;
- }
-
- return 0;
-}
#include "xscreensaver.h"
#include "resources.h"
+#ifdef HAVE_SYSLOG
+# include <syslog.h>
+#endif /* HAVE_SYSLOG */
+
#ifdef _VROOT_H_
ERROR! You must not include vroot.h in this file.
#endif
#undef MAX
#define MAX(a,b) ((a)>(b)?(a):(b))
-enum passwd_state { pw_read, pw_ok, pw_fail, pw_cancel, pw_time };
+enum passwd_state { pw_read, pw_ok, pw_null, pw_fail, pw_cancel, pw_time };
struct passwd_dialog_data {
; /* already done? */
else if (passwd_valid_p (typed_passwd))
pw->state = pw_ok;
+ else if (typed_passwd[0] == 0)
+ pw->state = pw_null;
else
pw->state = pw_fail;
break;
static void
passwd_event_loop (saver_info *si)
{
+ saver_preferences *p = &si->prefs;
char *msg = 0;
XEvent event;
passwd_animate_timer ((XtPointer) si, 0);
switch (si->pw_data->state)
{
case pw_ok: msg = 0; break;
+ case pw_null: msg = ""; break;
case pw_time: msg = "Timed out!"; break;
default: msg = "Sorry!"; break;
}
+ if (si->pw_data->state == pw_fail)
+ si->unlock_failures++;
+
+ if (p->verbose_p)
+ switch (si->pw_data->state)
+ {
+ case pw_ok:
+ fprintf (stderr, "%s: password correct.\n", blurb()); break;
+ case pw_fail:
+ fprintf (stderr, "%s: password incorrect!\n", blurb()); break;
+ case pw_null:
+ case pw_cancel:
+ fprintf (stderr, "%s: password entry cancelled.\n", blurb()); break;
+ case pw_time:
+ fprintf (stderr, "%s: password entry timed out.\n", blurb()); break;
+ default: break;
+ }
+
+#ifdef HAVE_SYSLOG
+ if (si->pw_data->state == pw_fail)
+ {
+ /* If they typed a password (as opposed to just hitting return) and
+ the password was invalid, log it.
+ */
+ struct passwd *pw = getpwuid (getuid ());
+ char *d = DisplayString (si->dpy);
+ char *u = (pw->pw_name ? pw->pw_name : "???");
+ int opt = 0;
+ int fac = 0;
+
+# ifdef LOG_PID
+ opt = LOG_PID;
+# endif
+
+# if defined(LOG_AUTHPRIV)
+ fac = LOG_AUTHPRIV;
+# elif defined(LOG_AUTH)
+ fac = LOG_AUTH;
+# else
+ fac = LOG_DAEMON;
+# endif
+
+ if (!d) d = "";
+ openlog (progname, opt, fac);
+ syslog (LOG_NOTICE, "FAILED LOGIN %d ON DISPLAY \"%s\", FOR \"%s\"",
+ si->unlock_failures, d, u);
+ closelog ();
+ }
+#endif /* HAVE_SYSLOG */
+
+ if (si->pw_data->state == pw_ok && si->unlock_failures != 0)
+ {
+ if (si->unlock_failures == 1)
+ fprintf (real_stderr,
+ "%s: WARNING: 1 failed attempt to unlock the screen.\n",
+ blurb());
+ else
+ fprintf (real_stderr,
+ "%s: WARNING: %d failed attempts to unlock the screen.\n",
+ blurb(), si->unlock_failures);
+ fflush (real_stderr);
+
+ si->unlock_failures = 0;
+ }
+
if (msg)
{
si->pw_data->i_beam = 0;
}
}
+
Bool
unlock_p (saver_info *si)
{
+ saver_preferences *p = &si->prefs;
Screen *screen = si->default_screen->screen;
Colormap cmap = DefaultColormapOfScreen (screen);
Bool status;
+ if (p->verbose_p)
+ fprintf (stderr, "%s: prompting for password.\n", blurb());
+
if (si->pw_data || si->passwd_dialog)
destroy_passwd_window (si);
--- /dev/null
+/* dotfile.c --- management of the ~/.xscreensaver file.
+ * xscreensaver, Copyright (c) 1998 Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation. No representations are made about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xresource.h>
+
+#ifndef VMS
+# include <pwd.h>
+#else /* VMS */
+# include "vms-pwd.h"
+#endif /* VMS */
+
+
+/* This file doesn't need the Xt headers, so stub these types out... */
+#undef XtPointer
+#define XtAppContext void*
+#define XtIntervalId void*
+#define XtPointer void*
+#define Widget void*
+
+
+/* Just in case there's something pathological about stat.h... */
+#ifndef S_IRUSR
+# define S_IRUSR 00400
+#endif
+#ifndef S_IWUSR
+# define S_IWUSR 00200
+#endif
+#ifndef S_IXUSR
+# define S_IXUSR 00100
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 00010
+#endif
+#ifndef S_IXOTH
+# define S_IXOTH 00001
+#endif
+
+
+#include "prefs.h"
+#include "resources.h"
+
+
+extern char *progname;
+extern char *progclass;
+extern const char *blurb (void);
+
+
+
+static void get_screenhacks (saver_preferences *p);
+
+
+const char *
+init_file_name (void)
+{
+ static char *file = 0;
+
+ if (!file)
+ {
+ struct passwd *p = getpwuid (getuid ());
+
+ if (!p || !p->pw_name || !*p->pw_name)
+ {
+ fprintf (stderr, "%s: couldn't get user info of uid %d\n",
+ blurb(), getuid ());
+ file = "";
+ }
+ else if (!p->pw_dir || !*p->pw_dir)
+ {
+ fprintf (stderr, "%s: couldn't get home directory of \"%s\"\n",
+ blurb(), (p->pw_name ? p->pw_name : "???"));
+ file = "";
+ }
+ else
+ {
+ const char *home = p->pw_dir;
+ const char *name = ".xscreensaver";
+ file = (char *) malloc(strlen(home) + strlen(name) + 2);
+ strcpy(file, home);
+ if (!*home || home[strlen(home)-1] != '/')
+ strcat(file, "/");
+ strcat(file, name);
+ }
+ }
+
+ if (file && *file)
+ return file;
+ else
+ return 0;
+}
+
+
+static const char *
+init_file_tmp_name (void)
+{
+ static char *file = 0;
+ if (!file)
+ {
+ const char *name = init_file_name();
+ const char *suffix = ".tmp";
+ if (!name || !*name)
+ file = "";
+ else
+ {
+ file = (char *) malloc(strlen(name) + strlen(suffix) + 2);
+ strcpy(file, name);
+ strcat(file, suffix);
+ }
+ }
+
+ if (file && *file)
+ return file;
+ else
+ return 0;
+}
+
+
+static const char * const prefs[] = {
+ "timeout",
+ "cycle",
+ "lock",
+ "lockVTs",
+ "lockTimeout",
+ "passwdTimeout",
+ "visualID",
+ "installColormap",
+ "verbose",
+ "timestamp",
+ "splash", /* not saved -- same as "splashDuration: 0" */
+ "splashDuration",
+ "demoCommand",
+ "prefsCommand",
+ "helpURL",
+ "loadURL",
+ "nice",
+ "fade",
+ "unfade",
+ "fadeSeconds",
+ "fadeTicks",
+ "captureStderr",
+ "captureStdout", /* not saved -- obsolete */
+ "font",
+ "",
+ "programs",
+ "",
+ "pointerPollTime",
+ "windowCreationTimeout",
+ "initialDelay",
+ "sgiSaverExtension",
+ "mitSaverExtension",
+ "xidleExtension",
+ "overlayStderr",
+ "overlayTextBackground", /* not saved -- X resources only */
+ "overlayTextForeground", /* not saved -- X resources only */
+ "bourneShell", /* not saved -- X resources only */
+ 0
+};
+
+static char *
+strip (char *s)
+{
+ char *s2;
+ while (*s == '\t' || *s == ' ' || *s == '\r' || *s == '\n')
+ s++;
+ for (s2 = s; *s2; s2++)
+ ;
+ for (s2--; s2 >= s; s2--)
+ if (*s2 == '\t' || *s2 == ' ' || *s2 == '\r' || *s2 =='\n')
+ *s2 = 0;
+ else
+ break;
+ return s;
+}
+
+\f
+/* Reading
+ */
+
+static int
+handle_entry (XrmDatabase *db, const char *key, const char *value,
+ const char *filename, int line)
+{
+ int i;
+ for (i = 0; prefs[i]; i++)
+ if (*prefs[i] && !strcasecmp(key, prefs[i]))
+ {
+ char *val = strdup(value);
+ char *spec = (char *) malloc(strlen(progclass) + strlen(prefs[i]) +10);
+ strcpy(spec, progclass);
+ strcat(spec, ".");
+ strcat(spec, prefs[i]);
+
+ XrmPutStringResource (db, spec, val);
+
+ free(spec);
+ free(val);
+ return 0;
+ }
+
+ fprintf(stderr, "%s: %s:%d: unknown option \"%s\"\n",
+ blurb(), filename, line, key);
+ return 1;
+}
+
+
+static int
+parse_init_file (saver_preferences *p)
+{
+ time_t write_date = 0;
+ const char *name = init_file_name();
+ int line = 0;
+ struct stat st;
+ FILE *in;
+ int buf_size = 1024;
+ char *buf;
+
+ if (!name) return 0;
+
+ if (stat(name, &st) != 0)
+ {
+ p->init_file_date = 0;
+ return 0;
+ }
+
+ in = fopen(name, "r");
+ if (!in)
+ {
+ char *buf = (char *) malloc(1024 + strlen(name));
+ sprintf(buf, "%s: error reading \"%s\"", blurb(), name);
+ perror(buf);
+ free(buf);
+ return -1;
+ }
+
+ if (fstat (fileno(in), &st) == 0)
+ {
+ write_date = st.st_mtime;
+ }
+ else
+ {
+ char *buf = (char *) malloc(1024 + strlen(name));
+ sprintf(buf, "%s: couldn't re-stat \"%s\"", blurb(), name);
+ perror(buf);
+ free(buf);
+ return -1;
+ }
+
+ buf = (char *) malloc(buf_size);
+
+ while (fgets (buf, buf_size-1, in))
+ {
+ char *key, *value;
+ int L = strlen(buf);
+
+ line++;
+ while (L > 2 &&
+ (buf[L-1] != '\n' || /* whole line didn't fit in buffer */
+ buf[L-2] == '\\')) /* or line ended with backslash */
+ {
+ if (buf[L-2] == '\\') /* backslash-newline gets swallowed */
+ {
+ buf[L-2] = 0;
+ L -= 2;
+ }
+ buf_size += 1024;
+ buf = (char *) realloc(buf, buf_size);
+ if (!buf) exit(1);
+
+ line++;
+ if (!fgets (buf + L, buf_size-L-1, in))
+ break;
+ L = strlen(buf);
+ }
+
+ /* Now handle other backslash escapes. */
+ {
+ int i, j;
+ for (i = 0; buf[i]; i++)
+ if (buf[i] == '\\')
+ {
+ switch (buf[i+1])
+ {
+ case 'n': buf[i] = '\n'; break;
+ case 'r': buf[i] = '\r'; break;
+ case 't': buf[i] = '\t'; break;
+ default: buf[i] = buf[i+1]; break;
+ }
+ for (j = i+2; buf[j]; j++)
+ buf[j-1] = buf[j];
+ buf[j-1] = 0;
+ }
+ }
+
+ key = strip(buf);
+
+ if (*key == '#' || *key == '!' || *key == ';' ||
+ *key == '\n' || *key == 0)
+ continue;
+
+ value = strchr (key, ':');
+ if (!value)
+ {
+ fprintf(stderr, "%s: %s:%d: unparsable line: %s\n", blurb(),
+ name, line, key);
+ continue;
+ }
+ else
+ {
+ *value++ = 0;
+ value = strip(value);
+ }
+
+ if (!p->db) abort();
+ handle_entry (&p->db, key, value, name, line);
+ }
+ free(buf);
+
+ p->init_file_date = write_date;
+ return 0;
+}
+
+
+Bool
+init_file_changed_p (saver_preferences *p)
+{
+ const char *name = init_file_name();
+ struct stat st;
+
+ if (!name) return False;
+
+ if (stat(name, &st) != 0)
+ return False;
+
+ if (p->init_file_date == st.st_mtime)
+ return False;
+
+ return True;
+}
+
+\f
+/* Writing
+ */
+
+static int
+tab_to (FILE *out, int from, int to)
+{
+ int tab_width = 8;
+ int to_mod = (to / tab_width) * tab_width;
+ while (from < to_mod)
+ {
+ fprintf(out, "\t");
+ from = (((from / tab_width) + 1) * tab_width);
+ }
+ while (from < to)
+ {
+ fprintf(out, " ");
+ from++;
+ }
+ return from;
+}
+
+static void
+write_entry (FILE *out, const char *key, const char *value)
+{
+ char *v = strdup(value ? value : "");
+ char *v2 = v;
+ char *nl = 0;
+ int col;
+ Bool do_visual_kludge = (!strcmp(key, "programs"));
+ Bool do_wrap = do_visual_kludge;
+ int tab = (do_visual_kludge ? 16 : 23);
+ int tab2 = 3;
+ Bool first = True;
+
+ fprintf(out, "%s:", key);
+ col = strlen(key) + 1;
+
+ while (1)
+ {
+ char *s;
+ Bool disabled_p = False;
+
+ v2 = strip(v2);
+ nl = strchr(v2, '\n');
+ if (nl)
+ *nl = 0;
+
+ if (do_visual_kludge && *v2 == '-')
+ {
+ disabled_p = True;
+ v2++;
+ v2 = strip(v2);
+ }
+
+ if (first && disabled_p)
+ first = False;
+
+ if (first)
+ first = False;
+ else
+ {
+ col = tab_to(out, col, 75);
+ fprintf(out, " \\n\\\n");
+ col = 0;
+ }
+
+ if (disabled_p)
+ {
+ fprintf(out, "-");
+ col++;
+ }
+
+ s = (do_visual_kludge ? strpbrk(v2, " \t\n:") : 0);
+ if (s && *s == ':')
+ col = tab_to (out, col, tab2);
+ else
+ col = tab_to (out, col, tab);
+
+ if (do_wrap &&
+ strlen(v2) + col > 75)
+ {
+ int L = strlen(v2);
+ int start = 0;
+ int end = start;
+ while (start < L)
+ {
+ while (v2[end] == ' ' || v2[end] == '\t')
+ end++;
+ while (v2[end] != ' ' && v2[end] != '\t' &&
+ v2[end] != '\n' && v2[end] != 0)
+ end++;
+ if (col + (end - start) >= 74)
+ {
+ col = tab_to (out, col, 75);
+ fprintf(out, " \\\n");
+ col = tab_to (out, 0, tab + 2);
+ while (v2[start] == ' ' || v2[start] == '\t')
+ start++;
+ }
+
+ while (start < end)
+ {
+ fputc(v2[start++], out);
+ col++;
+ }
+ }
+ }
+ else
+ {
+ fprintf (out, "%s", v2);
+ col += strlen(v2);
+ }
+
+ if (nl)
+ v2 = nl + 1;
+ else
+ break;
+ }
+
+ fprintf(out, "\n");
+ free(v);
+}
+
+void
+write_init_file (saver_preferences *p, const char *version_string)
+{
+ const char *name = init_file_name();
+ const char *tmp_name = init_file_tmp_name();
+ struct stat st;
+ int i, j;
+
+ /* Kludge, since these aren't in the saver_preferences struct as strings...
+ */
+ char *visual_name;
+ char *programs;
+ Bool capture_stderr_p;
+ Bool overlay_stderr_p;
+ char *stderr_font;
+ FILE *out;
+
+ if (!name) return;
+
+ if (p->verbose_p)
+ fprintf (stderr, "%s: writing \"%s\".\n", blurb(), name);
+
+ unlink (tmp_name);
+ out = fopen(tmp_name, "w");
+ if (!out)
+ {
+ char *buf = (char *) malloc(1024 + strlen(name));
+ sprintf(buf, "%s: error writing \"%s\"", blurb(), name);
+ perror(buf);
+ free(buf);
+ return;
+ }
+
+ /* Give the new .xscreensaver file the same permissions as the old one;
+ except ensure that it is readable and writable by owner, and not
+ executable.
+ */
+ if (stat(name, &st) == 0)
+ {
+ mode_t mode = st.st_mode;
+ mode |= S_IRUSR | S_IWUSR;
+ mode &= ~(S_IXUSR | S_IXGRP | S_IXOTH);
+ if (fchmod (fileno(out), mode) != 0)
+ {
+ char *buf = (char *) malloc(1024 + strlen(name));
+ sprintf (buf, "%s: error fchmodding \"%s\" to 0%o", blurb(),
+ tmp_name, (unsigned int) mode);
+ perror(buf);
+ free(buf);
+ return;
+ }
+ }
+
+ /* Kludge, since these aren't in the saver_preferences struct... */
+ visual_name = get_string_resource ("visualID", "VisualID");
+ programs = 0;
+ capture_stderr_p = get_boolean_resource ("captureStderr", "Boolean");
+ overlay_stderr_p = get_boolean_resource ("overlayStderr", "Boolean");
+ stderr_font = get_string_resource ("font", "Font");
+
+ i = 0;
+ for (j = 0; j < p->screenhacks_count; j++)
+ i += strlen(p->screenhacks[j]) + 2;
+ {
+ char *ss = programs = (char *) malloc(i + 10);
+ *ss = 0;
+ for (j = 0; j < p->screenhacks_count; j++)
+ {
+ strcat(ss, p->screenhacks[j]);
+ ss += strlen(ss);
+ *ss++ = '\n';
+ *ss = 0;
+ }
+ }
+
+ {
+ struct passwd *pw = getpwuid (getuid ());
+ char *whoami = (pw && pw->pw_name && *pw->pw_name
+ ? pw->pw_name
+ : "<unknown>");
+ time_t now = time ((time_t *) 0);
+ char *timestr = (char *) ctime (&now);
+ char *nl = (char *) strchr (timestr, '\n');
+ if (nl) *nl = 0;
+ fprintf (out,
+ "# %s Preferences File\n"
+ "# Written by %s %s for %s on %s.\n"
+ "# http://www.jwz.org/xscreensaver/\n"
+ "\n",
+ progclass, progname, version_string, whoami, timestr);
+ }
+
+ for (j = 0; prefs[j]; j++)
+ {
+ char buf[255];
+ const char *pr = prefs[j];
+ enum pref_type { pref_str, pref_int, pref_bool, pref_time
+ } type = pref_str;
+ const char *s = 0;
+ int i = 0;
+ Bool b = False;
+ Time t = 0;
+
+ if (pr && !*pr)
+ {
+ fprintf(out, "\n");
+ continue;
+ }
+
+# undef CHECK
+# define CHECK(X) else if (!strcmp(pr, X))
+ if (!pr || !*pr) ;
+ CHECK("timeout") type = pref_time, t = p->timeout;
+ CHECK("cycle") type = pref_time, t = p->cycle;
+ CHECK("lock") type = pref_bool, b = p->lock_p;
+# if 0 /* #### not ready yet */
+ CHECK("lockVTs") type = pref_bool, b = p->lock_vt_p;
+# else
+ CHECK("lockVTs") continue; /* don't save */
+# endif
+ CHECK("lockTimeout") type = pref_time, t = p->lock_timeout;
+ CHECK("passwdTimeout") type = pref_time, t = p->passwd_timeout;
+ CHECK("visualID") type = pref_str, s = visual_name;
+ CHECK("installColormap") type = pref_bool, b = p->install_cmap_p;
+ CHECK("verbose") type = pref_bool, b = p->verbose_p;
+ CHECK("timestamp") type = pref_bool, b = p->timestamp_p;
+ CHECK("splash") continue; /* don't save */
+ CHECK("splashDuration") type = pref_time, t = p->splash_duration;
+ CHECK("demoCommand") type = pref_str, s = p->demo_command;
+ CHECK("prefsCommand") type = pref_str, s = p->prefs_command;
+ CHECK("helpURL") type = pref_str, s = p->help_url;
+ CHECK("loadURL") type = pref_str, s = p->load_url_command;
+ CHECK("nice") type = pref_int, i = p->nice_inferior;
+ CHECK("fade") type = pref_bool, b = p->fade_p;
+ CHECK("unfade") type = pref_bool, b = p->unfade_p;
+ CHECK("fadeSeconds") type = pref_time, t = p->fade_seconds;
+ CHECK("fadeTicks") type = pref_int, i = p->fade_ticks;
+ CHECK("captureStderr") type = pref_bool, b = capture_stderr_p;
+ CHECK("captureStdout") continue; /* don't save */
+ CHECK("font") type = pref_str, s = stderr_font;
+ CHECK("programs") type = pref_str, s = programs;
+ CHECK("pointerPollTime") type = pref_time, t = p->pointer_timeout;
+ CHECK("windowCreationTimeout")type=pref_time,t= p->notice_events_timeout;
+ CHECK("initialDelay") type = pref_time, t = p->initial_delay;
+ CHECK("sgiSaverExtension")type = pref_bool, b=p->use_sgi_saver_extension;
+ CHECK("mitSaverExtension")type = pref_bool, b=p->use_mit_saver_extension;
+ CHECK("xidleExtension") type = pref_bool, b = p->use_xidle_extension;
+ CHECK("overlayStderr") type = pref_bool, b = overlay_stderr_p;
+ CHECK("overlayTextBackground") continue; /* don't save */
+ CHECK("overlayTextForeground") continue; /* don't save */
+ CHECK("bourneShell") continue;
+ else abort();
+# undef CHECK
+
+ switch (type)
+ {
+ case pref_str:
+ break;
+ case pref_int:
+ sprintf(buf, "%d", i);
+ s = buf;
+ break;
+ case pref_bool:
+ s = b ? "True" : "False";
+ break;
+ case pref_time:
+ {
+ unsigned int hour = 0, min = 0, sec = (unsigned int) (t/1000);
+ if (sec >= 60)
+ {
+ min += (sec / 60);
+ sec %= 60;
+ }
+ if (min >= 60)
+ {
+ hour += (min / 60);
+ min %= 60;
+ }
+ sprintf (buf, "%u:%02u:%02u", hour, min, sec);
+ s = buf;
+ }
+ break;
+ default:
+ abort();
+ break;
+ }
+ write_entry (out, pr, s);
+ }
+
+ fprintf(out, "\n");
+
+ if (visual_name) free(visual_name);
+ if (stderr_font) free(stderr_font);
+ if (programs) free(programs);
+
+ if (fclose(out) == 0)
+ {
+ time_t write_date = 0;
+
+ if (stat(tmp_name, &st) == 0)
+ {
+ write_date = st.st_mtime;
+ }
+ else
+ {
+ char *buf = (char *) malloc(1024 + strlen(tmp_name) + strlen(name));
+ sprintf(buf, "%s: couldn't stat \"%s\"", blurb(), tmp_name);
+ perror(buf);
+ unlink (tmp_name);
+ free(buf);
+ return;
+ }
+
+ if (rename (tmp_name, name) != 0)
+ {
+ char *buf = (char *) malloc(1024 + strlen(tmp_name) + strlen(name));
+ sprintf(buf, "%s: error renaming \"%s\" to \"%s\"",
+ blurb(), tmp_name, name);
+ perror(buf);
+ unlink (tmp_name);
+ free(buf);
+ return;
+ }
+ else
+ {
+ p->init_file_date = write_date;
+
+ /* Since the .xscreensaver file is used for IPC, let's try and make
+ sure that the bits actually land on the disk right away. */
+ sync ();
+ }
+ }
+ else
+ {
+ char *buf = (char *) malloc(1024 + strlen(name));
+ sprintf(buf, "%s: error closing \"%s\"", blurb(), name);
+ perror(buf);
+ free(buf);
+ unlink (tmp_name);
+ return;
+ }
+}
+
+\f
+/* Parsing the resource database
+ */
+
+
+/* Populate `saver_preferences' with the contents of the resource database.
+ Note that this may be called multiple times -- it is re-run each time
+ the ~/.xscreensaver file is reloaded.
+
+ This function can be very noisy, since it issues resource syntax errors
+ and so on.
+ */
+void
+load_init_file (saver_preferences *p)
+{
+ static Bool first_time = True;
+
+ if (parse_init_file (p) != 0) /* file might have gone away */
+ if (!first_time) return;
+
+ first_time = False;
+
+ p->xsync_p = get_boolean_resource ("synchronous", "Synchronous");
+ p->verbose_p = get_boolean_resource ("verbose", "Boolean");
+ p->timestamp_p = get_boolean_resource ("timestamp", "Boolean");
+ p->lock_p = get_boolean_resource ("lock", "Boolean");
+ p->lock_vt_p = get_boolean_resource ("lockVTs", "Boolean");
+ p->fade_p = get_boolean_resource ("fade", "Boolean");
+ p->unfade_p = get_boolean_resource ("unfade", "Boolean");
+ p->fade_seconds = 1000 * get_seconds_resource ("fadeSeconds", "Time");
+ p->fade_ticks = get_integer_resource ("fadeTicks", "Integer");
+ p->install_cmap_p = get_boolean_resource ("installColormap", "Boolean");
+ p->nice_inferior = get_integer_resource ("nice", "Nice");
+
+ p->initial_delay = 1000 * get_seconds_resource ("initialDelay", "Time");
+ p->splash_duration = 1000 * get_seconds_resource ("splashDuration", "Time");
+ p->timeout = 1000 * get_minutes_resource ("timeout", "Time");
+ p->lock_timeout = 1000 * get_minutes_resource ("lockTimeout", "Time");
+ p->cycle = 1000 * get_minutes_resource ("cycle", "Time");
+ p->passwd_timeout = 1000 * get_seconds_resource ("passwdTimeout", "Time");
+ p->pointer_timeout = 1000 * get_seconds_resource ("pointerPollTime", "Time");
+ p->notice_events_timeout = 1000*get_seconds_resource("windowCreationTimeout",
+ "Time");
+ p->shell = get_string_resource ("bourneShell", "BourneShell");
+
+ p->demo_command = get_string_resource("demoCommand", "URL");
+ p->prefs_command = get_string_resource("prefsCommand", "URL");
+ p->help_url = get_string_resource("helpURL", "URL");
+ p->load_url_command = get_string_resource("loadURL", "LoadURL");
+
+ {
+ char *s;
+ if ((s = get_string_resource ("splash", "Boolean")))
+ if (!get_boolean_resource("splash", "Boolean"))
+ p->splash_duration = 0;
+ if (s) free (s);
+ }
+
+ p->use_xidle_extension = get_boolean_resource ("xidleExtension","Boolean");
+ p->use_mit_saver_extension = get_boolean_resource ("mitSaverExtension",
+ "Boolean");
+ p->use_sgi_saver_extension = get_boolean_resource ("sgiSaverExtension",
+ "Boolean");
+
+ /* Throttle the various timeouts to reasonable values.
+ */
+ if (p->passwd_timeout <= 0) p->passwd_timeout = 30000; /* 30 secs */
+ if (p->timeout < 10000) p->timeout = 10000; /* 10 secs */
+ if (p->cycle < 0) p->cycle = 0;
+ if (p->cycle != 0 && p->cycle < 2000) p->cycle = 2000; /* 2 secs */
+ if (p->pointer_timeout <= 0) p->pointer_timeout = 5000; /* 5 secs */
+ if (p->notice_events_timeout <= 0)
+ p->notice_events_timeout = 10000; /* 10 secs */
+ if (p->fade_seconds <= 0 || p->fade_ticks <= 0)
+ p->fade_p = False;
+ if (! p->fade_p) p->unfade_p = False;
+
+ if (p->verbose_p && !p->fading_possible_p && (p->fade_p || p->unfade_p))
+ {
+ fprintf (stderr, "%s: there are no PseudoColor or GrayScale visuals.\n",
+ blurb());
+ fprintf (stderr, "%s: ignoring the request for fading/unfading.\n",
+ blurb());
+ }
+
+ p->watchdog_timeout = p->cycle;
+ if (p->watchdog_timeout < 30000) p->watchdog_timeout = 30000; /* 30 secs */
+ if (p->watchdog_timeout > 3600000) p->watchdog_timeout = 3600000; /* 1 hr */
+
+ get_screenhacks (p);
+
+ if (p->debug_p)
+ {
+ p->xsync_p = True;
+ p->verbose_p = True;
+ p->timestamp_p = True;
+ p->initial_delay = 0;
+ }
+}
+
+\f
+/* Parsing the programs resource.
+ */
+
+static char *
+reformat_hack (const char *hack)
+{
+ int i;
+ const char *in = hack;
+ int indent = 15;
+ char *h2 = (char *) malloc(strlen(in) + indent + 2);
+ char *out = h2;
+ Bool disabled_p = False;
+
+ while (isspace(*in)) in++; /* skip whitespace */
+
+ if (*in == '-') /* Handle a leading "-". */
+ {
+ in++;
+ hack = in;
+ *out++ = '-';
+ *out++ = ' ';
+ disabled_p = True;
+ while (isspace(*in)) in++;
+ }
+ else
+ {
+ *out++ = ' ';
+ *out++ = ' ';
+ }
+
+ while (*in && !isspace(*in) && *in != ':')
+ *out++ = *in++; /* snarf first token */
+ while (isspace(*in)) in++; /* skip whitespace */
+
+ if (*in == ':')
+ *out++ = *in++; /* copy colon */
+ else
+ {
+ in = hack;
+ out = h2 + 2; /* reset to beginning */
+ }
+
+ *out = 0;
+
+ while (isspace(*in)) in++; /* skip whitespace */
+ for (i = strlen(h2); i < indent; i++) /* indent */
+ *out++ = ' ';
+
+ /* copy the rest of the line. */
+ while (*in)
+ {
+ /* shrink all whitespace to one space, for the benefit of the "demo"
+ mode display. We only do this when we can easily tell that the
+ whitespace is not significant (no shell metachars).
+ */
+ switch (*in)
+ {
+ case '\'': case '"': case '`': case '\\':
+ {
+ /* Metachars are scary. Copy the rest of the line unchanged. */
+ while (*in)
+ *out++ = *in++;
+ }
+ break;
+ case ' ': case '\t':
+ {
+ while (*in == ' ' || *in == '\t')
+ in++;
+ *out++ = ' ';
+ }
+ break;
+ default:
+ *out++ = *in++;
+ break;
+ }
+ }
+ *out = 0;
+
+ /* strip trailing whitespace. */
+ out = out-1;
+ while (out > h2 && (*out == ' ' || *out == '\t' || *out == '\n'))
+ *out-- = 0;
+
+ return h2;
+}
+
+
+static void
+get_screenhacks (saver_preferences *p)
+{
+ int i = 0;
+ int start = 0;
+ int end = 0;
+ int size;
+ char *d;
+
+ d = get_string_resource ("monoPrograms", "MonoPrograms");
+ if (d && !*d) { free(d); d = 0; }
+ if (!d)
+ d = get_string_resource ("colorPrograms", "ColorPrograms");
+ if (d && !*d) { free(d); d = 0; }
+
+ if (d)
+ {
+ fprintf (stderr,
+ "%s: the `monoPrograms' and `colorPrograms' resources are obsolete;\n\
+ see the manual for details.\n", blurb());
+ free(d);
+ }
+
+ d = get_string_resource ("programs", "Programs");
+
+ if (p->screenhacks)
+ {
+ for (i = 0; i < p->screenhacks_count; i++)
+ if (p->screenhacks[i])
+ free (p->screenhacks[i]);
+ free(p->screenhacks);
+ p->screenhacks = 0;
+ }
+
+ if (!d || !*d)
+ {
+ p->screenhacks_count = 0;
+ p->screenhacks = 0;
+ return;
+ }
+
+ size = strlen (d);
+
+
+ /* Count up the number of newlines (which will be equal to or larger than
+ the number of hacks.)
+ */
+ i = 0;
+ for (i = 0; d[i]; i++)
+ if (d[i] == '\n')
+ i++;
+ i++;
+
+ p->screenhacks = (char **) calloc (sizeof (char *), i+1);
+
+ /* Iterate over the lines in `d' (the string with newlines)
+ and make new strings to stuff into the `screenhacks' array.
+ */
+ p->screenhacks_count = 0;
+ while (start < size)
+ {
+ /* skip forward over whitespace. */
+ while (d[start] == ' ' || d[start] == '\t' || d[start] == '\n')
+ start++;
+
+ /* skip forward to newline or end of string. */
+ end = start;
+ while (d[end] != 0 && d[end] != '\n')
+ end++;
+
+ /* null terminate. */
+ d[end] = 0;
+
+ p->screenhacks[p->screenhacks_count++] = reformat_hack (d + start);
+ if (p->screenhacks_count >= i)
+ abort();
+
+ start = end+1;
+ }
+
+ if (p->screenhacks_count == 0)
+ {
+ free (p->screenhacks);
+ p->screenhacks = 0;
+ }
+}
--- /dev/null
+/* xscreensaver, Copyright (c) 1993-1998 Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation. No representations are made about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#ifndef __XSCREENSAVER_PREFS_H__
+#define __XSCREENSAVER_PREFS_H__
+
+typedef struct saver_preferences saver_preferences;
+
+
+/* This structure holds all the user-specified parameters, read from the
+ command line, the resource database, or entered through a dialog box.
+ */
+struct saver_preferences {
+
+ XrmDatabase db; /* The resource database into which the
+ init file is merged, and out of which the
+ preferences are parsed. */
+
+ time_t init_file_date; /* The date (from stat()) of the .xscreensaver
+ file the last time this process read or
+ wrote it. */
+
+ Bool verbose_p; /* whether to print out lots of status info */
+ Bool timestamp_p; /* whether to mark messages with a timestamp */
+ Bool debug_p; /* pay no mind to the man behind the curtain */
+ Bool xsync_p; /* whether XSynchronize has been called */
+
+ Bool lock_p; /* whether to lock as well as save */
+ Bool lock_vt_p; /* whether to lock VTs too, if possible */
+
+ Bool fade_p; /* whether to fade to black, if possible */
+ Bool unfade_p; /* whether to fade from black, if possible */
+ int fade_seconds; /* how long that should take */
+ int fade_ticks; /* how many ticks should be used */
+ Bool fading_possible_p; /* Whether fading to/from black is possible.
+ (This isn't strictly a preference, as it
+ can only be known by querying the display;
+ the caller of the prefs code may fill this
+ in if it knows/cares, and warnings will be
+ issued.) */
+
+ Bool install_cmap_p; /* whether we should use our own colormap
+ when using the screen's default visual. */
+
+ char **screenhacks; /* the programs to run */
+ int screenhacks_count;
+
+ int nice_inferior; /* nice value for subprocs */
+
+ Time initial_delay; /* how long to sleep after launch */
+ Time splash_duration; /* how long the splash screen stays up */
+ Time timeout; /* how much idle time before activation */
+ Time lock_timeout; /* how long after activation locking starts */
+ Time cycle; /* how long each hack should run */
+ Time passwd_timeout; /* how much time before pw dialog goes down */
+ Time pointer_timeout; /* how often to check mouse position */
+ Time notice_events_timeout; /* how long after window creation to select */
+ Time watchdog_timeout; /* how often to re-raise and re-blank screen */
+
+ Bool use_xidle_extension; /* which extension to use, if possible */
+ Bool use_mit_saver_extension;
+ Bool use_sgi_saver_extension;
+
+ char *shell; /* where to find /bin/sh */
+
+ char *demo_command; /* How to enter demo mode. */
+ char *prefs_command; /* How to edit preferences. */
+ char *help_url; /* Where the help document resides. */
+ char *load_url_command; /* How one loads URLs. */
+};
+
+
+extern void load_init_file (saver_preferences *p);
+extern Bool init_file_changed_p (saver_preferences *p);
+extern void write_init_file (saver_preferences *p, const char *version_string);
+const char *init_file_name (void);
+
+#endif /* __XSCREENSAVER_PREFS_H__ */
--- /dev/null
+/* xscreensaver-command, Copyright (c) 1991-1998
+ * by Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation. No representations are made about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/select.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#include <X11/Xproto.h> /* for CARD32 */
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h> /* for XGetClassHint() */
+#include <X11/Xos.h>
+
+#include "remote.h"
+
+#ifdef _VROOT_H_
+ERROR! you must not include vroot.h in this file
+#endif
+
+extern char *progname;
+extern Atom XA_SCREENSAVER, XA_SCREENSAVER_VERSION, XA_SCREENSAVER_RESPONSE;
+extern Atom XA_SCREENSAVER_ID, XA_SCREENSAVER_TIME;
+extern Atom XA_VROOT, XA_SELECT, XA_DEMO;
+
+
+static XErrorHandler old_handler = 0;
+static Bool got_badwindow = False;
+static int
+BadWindow_ehandler (Display *dpy, XErrorEvent *error)
+{
+ /* When we notice a window being created, we spawn a timer that waits
+ 30 seconds or so, and then selects events on that window. This error
+ handler is used so that we can cope with the fact that the window
+ may have been destroyed <30 seconds after it was created.
+ */
+ if (error->error_code == BadWindow)
+ {
+ got_badwindow = True;
+ return 0;
+ }
+ else
+ {
+ fprintf (stderr, "%s: ", progname);
+ return (*old_handler) (dpy, error);
+ }
+}
+
+
+
+static Window
+find_screensaver_window (Display *dpy, char **version)
+{
+ int i;
+ Window root = RootWindowOfScreen (DefaultScreenOfDisplay (dpy));
+ Window root2, parent, *kids;
+ unsigned int nkids;
+
+ if (version) *version = 0;
+
+ if (! XQueryTree (dpy, root, &root2, &parent, &kids, &nkids))
+ abort ();
+ if (root != root2)
+ abort ();
+ if (parent)
+ abort ();
+ if (! (kids && nkids))
+ abort ();
+ for (i = 0; i < nkids; i++)
+ {
+ Atom type;
+ int format;
+ unsigned long nitems, bytesafter;
+ char *v;
+
+ if (XGetWindowProperty (dpy, kids[i],
+ XA_SCREENSAVER_VERSION,
+ 0, 200, False, XA_STRING,
+ &type, &format, &nitems, &bytesafter,
+ (unsigned char **) &v)
+ == Success
+ && type != None)
+ {
+ if (version)
+ *version = v;
+ return kids[i];
+ }
+ }
+ fprintf (stderr, "%s: no screensaver is running on display %s\n", progname,
+ DisplayString (dpy));
+ return 0;
+}
+
+
+static int
+send_xscreensaver_command (Display *dpy, Atom command, long arg,
+ Window *window_ret)
+{
+ char *v = 0;
+ Window window = find_screensaver_window (dpy, &v);
+ XWindowAttributes xgwa;
+
+ if (window_ret)
+ *window_ret = window;
+
+ if (!window)
+ return -1;
+
+ /* Select for property change events, so that we can read the response. */
+ XGetWindowAttributes (dpy, window, &xgwa);
+ XSelectInput (dpy, window, xgwa.your_event_mask | PropertyChangeMask);
+
+ if (command == XA_SCREENSAVER_TIME ||
+ command == XA_SCREENSAVER_VERSION)
+ {
+ XClassHint hint;
+ memset (&hint, 0, sizeof(hint));
+ if (!v || !*v)
+ {
+ fprintf (stderr, "%s: version property not set on window 0x%x?\n",
+ progname, (unsigned int) window);
+ return -1;
+ }
+
+ XGetClassHint(dpy, window, &hint);
+ if (!hint.res_class)
+ {
+ fprintf (stderr, "%s: class hints not set on window 0x%x?\n",
+ progname, (unsigned int) window);
+ return -1;
+ }
+
+ fprintf (stdout, "%s %s", hint.res_class, v);
+
+ if (command != XA_SCREENSAVER_TIME)
+ {
+ fprintf (stdout, "\n");
+ }
+ else
+ {
+ Atom type;
+ int format;
+ unsigned long nitems, bytesafter;
+ unsigned char *data = 0;
+ Bool active_p = False;
+
+ if (XGetWindowProperty (dpy, window, XA_VROOT,
+ 0, 0, False, XA_WINDOW,
+ &type, &format, &nitems, &bytesafter,
+ &data)
+ == Success
+ && type != None)
+ active_p = True;
+
+ if (data) free (data);
+ data = 0;
+
+ if (XGetWindowProperty (dpy, window,
+ XA_SCREENSAVER_TIME,
+ 0, 1, False, XA_INTEGER,
+ &type, &format, &nitems, &bytesafter,
+ &data)
+ == Success
+ && type == XA_INTEGER
+ && data)
+ {
+ CARD32 time32 = *((CARD32 *)data);
+ time_t tt = (time_t) time32;
+
+ if (active_p)
+ fprintf (stdout, ": screen blanked since ");
+ else
+ /* suggestions for a better way to phrase this are welcome. */
+ fprintf (stdout, ": screen non-blanked since ");
+ fprintf (stdout, "%s", ctime(&tt));
+ if (data) free (data);
+ }
+ else
+ {
+ if (data) free (data);
+ fprintf (stdout, "\n");
+ fflush (stdout);
+ fprintf (stderr, "%s: no time on window 0x%x (%s %s).\n",
+ progname, (unsigned int) window,
+ hint.res_class, (v ? v : "???"));
+ return -1;
+ }
+ }
+
+ /* No need to read a response for these commands. */
+ return 1;
+ }
+ else
+ {
+ XEvent event;
+ long arg1 = arg;
+ long arg2 = 0;
+
+ if (arg < 0)
+ abort();
+ else if (arg == 0 && command == XA_SELECT)
+ abort();
+ else if (arg != 0 && command == XA_DEMO)
+ {
+ arg1 = 300; /* version number of the XA_DEMO protocol, */
+ arg2 = arg; /* since it didn't use to take an argument. */
+ }
+
+ event.xany.type = ClientMessage;
+ event.xclient.display = dpy;
+ event.xclient.window = window;
+ event.xclient.message_type = XA_SCREENSAVER;
+ event.xclient.format = 32;
+ memset (&event.xclient.data, 0, sizeof(event.xclient.data));
+ event.xclient.data.l[0] = (long) command;
+ event.xclient.data.l[1] = arg1;
+ event.xclient.data.l[2] = arg2;
+ if (! XSendEvent (dpy, window, False, 0L, &event))
+ {
+ fprintf (stderr, "%s: XSendEvent(dpy, 0x%x ...) failed.\n",
+ progname, (unsigned int) window);
+ return -1;
+ }
+ }
+ XSync (dpy, 0);
+ return 0;
+}
+
+
+static int
+xscreensaver_command_response (Display *dpy, Window window, Bool verbose_p)
+{
+ int fd = ConnectionNumber (dpy);
+ int timeout = 10;
+ int status;
+ fd_set fds;
+ struct timeval tv;
+
+ while (1)
+ {
+ FD_ZERO(&fds);
+ FD_SET(fd, &fds);
+ memset(&tv, 0, sizeof(tv));
+ tv.tv_sec = timeout;
+ status = select (fd+1, &fds, 0, &fds, &tv);
+
+ if (status < 0)
+ {
+ char buf[1024];
+ sprintf (buf, "%s: waiting for reply", progname);
+ perror (buf);
+ return status;
+ }
+ else if (status == 0)
+ {
+ fprintf (stderr, "%s: no response to command.\n", progname);
+ return -1;
+ }
+ else
+ {
+ XEvent event;
+ XNextEvent (dpy, &event);
+ if (event.xany.type == PropertyNotify &&
+ event.xproperty.state == PropertyNewValue &&
+ event.xproperty.atom == XA_SCREENSAVER_RESPONSE)
+ {
+ Status st2;
+ Atom type;
+ int format;
+ unsigned long nitems, bytesafter;
+ char *msg = 0;
+
+ old_handler = XSetErrorHandler (BadWindow_ehandler);
+ XSync (dpy, False);
+
+ st2 = XGetWindowProperty (dpy, window,
+ XA_SCREENSAVER_RESPONSE,
+ 0, 1024, True,
+ AnyPropertyType,
+ &type, &format, &nitems, &bytesafter,
+ (unsigned char **) &msg);
+
+ if (got_badwindow)
+ {
+ fprintf (stdout,
+ "%s: xscreensaver window has been deleted.\n",
+ progname);
+ return 0;
+ }
+
+ if (st2 == Success && type != None)
+ {
+ if (type != XA_STRING || format != 8)
+ {
+ fprintf (stderr,
+ "%s: unrecognized response property.\n",
+ progname);
+ if (msg) XFree (msg);
+ return -1;
+ }
+ else if (!msg || (msg[0] != '+' && msg[0] != '-'))
+ {
+ fprintf (stderr,
+ "%s: unrecognized response message.\n",
+ progname);
+ if (msg) XFree (msg);
+ return -1;
+ }
+ else
+ {
+ int ret = (msg[0] == '+' ? 0 : -1);
+ if (verbose_p || ret != 0)
+ fprintf ((ret < 0 ? stderr : stdout),
+ "%s: %s\n",
+ progname,
+ msg+1);
+ XFree (msg);
+ return ret;
+ }
+ }
+ }
+ }
+ }
+}
+
+
+int
+xscreensaver_command (Display *dpy, Atom command, long arg, Bool verbose_p)
+{
+ Window w = 0;
+ int status = send_xscreensaver_command (dpy, command, arg, &w);
+ if (status == 0)
+ status = xscreensaver_command_response (dpy, w, verbose_p);
+ fflush (stdout);
+ fflush (stderr);
+ return status;
+}
+
+
+void
+server_xscreensaver_version (Display *dpy,
+ char **version_ret,
+ char **user_ret,
+ char **host_ret)
+{
+ Window window = find_screensaver_window (dpy, 0);
+
+ Atom type;
+ int format;
+ unsigned long nitems, bytesafter;
+
+ if (version_ret)
+ *version_ret = 0;
+ if (host_ret)
+ *host_ret = 0;
+
+ if (!window)
+ return;
+
+ if (version_ret)
+ {
+ char *v = 0;
+ XGetWindowProperty (dpy, window, XA_SCREENSAVER_VERSION, 0, 1,
+ False, XA_STRING, &type, &format, &nitems,
+ &bytesafter, (unsigned char **) &v);
+ if (v)
+ {
+ *version_ret = strdup (v);
+ XFree (v);
+ }
+ }
+
+ if (user_ret || host_ret)
+ {
+ char *id = 0;
+ const char *user = 0;
+ const char *host = 0;
+
+ XGetWindowProperty (dpy, window, XA_SCREENSAVER_ID, 0, 512,
+ False, XA_STRING, &type, &format, &nitems,
+ &bytesafter, (unsigned char **) &id);
+ if (id && *id)
+ {
+ const char *old_tag = " on host ";
+ const char *s = strstr (id, old_tag);
+ if (s)
+ {
+ /* found ID of the form "1234 on host xyz". */
+ user = 0;
+ host = s + strlen (old_tag);
+ }
+ else
+ {
+ char *o = 0, *p = 0, *c = 0;
+ o = strchr (id, '(');
+ if (o) p = strchr (o, '@');
+ if (p) c = strchr (p, ')');
+ if (c)
+ {
+ /* found ID of the form "1234 (user@host)". */
+ user = o+1;
+ host = p+1;
+ *p = 0;
+ *c = 0;
+ }
+ }
+
+ }
+
+ if (user && *user && *user != '?')
+ *user_ret = strdup (user);
+ else
+ *user_ret = 0;
+
+ if (host && *host && *host != '?')
+ *host_ret = strdup (host);
+ else
+ *host_ret = 0;
+
+ if (id)
+ XFree (id);
+ }
+}
--- /dev/null
+/* xscreensaver-command, Copyright (c) 1991-1998
+ * by Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation. No representations are made about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#ifndef _XSCREENSAVER_REMOTE_H_
+#define _XSCREENSAVER_REMOTE_H_
+
+extern int xscreensaver_command (Display *dpy, Atom command, long arg,
+ Bool verbose_p);
+
+extern void server_xscreensaver_version (Display *dpy,
+ char **version_ret,
+ char **user_ret,
+ char **host_ret);
+
+#endif /* _XSCREENSAVER_REMOTE_H_ */
static const char *
-uid_gid_string(uid_t uid, gid_t gid)
+uid_gid_string (uid_t uid, gid_t gid)
{
static char buf[255];
struct passwd *p = 0;
don't get special privileges. (On some systems it is necessary to install
this program as setuid root in order to read the passwd file to implement
lock-mode.)
+
+ *** WARNING: DO NOT DISABLE ANY OF THE FOLLOWING CODE!
+ If you do so, you will open a security hole. See the sections
+ of the xscreensaver manual titled "LOCKING AND ROOT LOGINS",
+ and "USING XDM".
*/
void
hack_uid (saver_info *si)
saver_exit (si, 1, 0);
}
+
/* Locking can't work when running as root, because we have no way of
knowing what the user id of the logged in user is (so we don't know
whose password to prompt for.)
+
+ *** WARNING: DO NOT DISABLE THIS CODE!
+ If you do so, you will open a security hole. See the sections
+ of the xscreensaver manual titled "LOCKING AND ROOT LOGINS",
+ and "USING XDM".
*/
if (getuid() == (uid_t) 0)
{
si->nolock_reason = "running as root";
}
+
/* If we're running as root, switch to a safer user. This is above and
beyond the fact that we've disabling locking, above -- the theory is
that running graphics demos as root is just always a stupid thing
to do, since they have probably never been security reviewed and are
more likely to be buggy than just about any other kind of program.
+ (And that assumes non-malicious code. There are also attacks here.)
+
+ *** WARNING: DO NOT DISABLE THIS CODE!
+ If you do so, you will open a security hole. See the sections
+ of the xscreensaver manual titled "LOCKING AND ROOT LOGINS",
+ and "USING XDM".
*/
if (getuid() == (uid_t) 0)
{
and not normal end-users) then disable locking. If it was possible,
switching to "nobody" would be the thing to do, but only root itself has
the privs to do that.
+
+ *** WARNING: DO NOT DISABLE THIS CODE!
+ If you do so, you will open a security hole. See the sections
+ of the xscreensaver manual titled "LOCKING AND ROOT LOGINS",
+ and "USING XDM".
*/
{
uid_t uid = getuid (); /* get it again */
}
-static void
-send_self_clientmessage (saver_info *si, Atom command)
-{
- Display *dpy = si->dpy;
- Window window = si->default_screen->screensaver_window;
- XEvent event;
- event.xany.type = ClientMessage;
- event.xclient.display = si->dpy;
- event.xclient.window = window;
- event.xclient.message_type = XA_SCREENSAVER;
- event.xclient.format = 32;
- memset (&event.xclient.data, 0, sizeof(event.xclient.data));
- event.xclient.data.l[0] = (long) command;
- if (! XSendEvent (dpy, window, False, 0L, &event))
- fprintf (stderr, "%s: XSendEvent(dpy, 0x%x ...) failed.\n",
- progname, (unsigned int) window);
-}
-
-
-static void
-get_help (saver_info *si)
-{
- saver_preferences *p = &si->prefs;
-
- if (!p->help_url || !*p->help_url)
- fprintf (stderr, "%s: no Help URL has been specified.\n", blurb());
- else if (!p->load_url_command || !*p->load_url_command)
- fprintf (stderr, "%s: no URL-loading command has been specified.\n",
- blurb());
- else
- {
- char *buf = (char *) malloc (strlen(p->load_url_command) +
- (strlen(p->help_url) * 2) + 10);
- sprintf (buf, p->load_url_command, p->help_url, p->help_url);
- system (buf);
- }
-}
-
static void update_splash_window (saver_info *si);
static void draw_splash_window (saver_info *si);
static void destroy_splash_window (saver_info *si);
static void unsplash_timer (XtPointer closure, XtIntervalId *id);
+static void do_demo (saver_info *si);
+static void do_prefs (saver_info *si);
+static void do_help (saver_info *si);
+
struct splash_dialog_data {
XtIntervalId timer;
destroy_splash_window (si);
switch (which)
{
- case 1: send_self_clientmessage (si, XA_DEMO); break;
- case 2: send_self_clientmessage (si, XA_PREFS); break;
- case 3: get_help (si); break;
+ case 1: do_demo (si); break;
+ case 2: do_prefs (si); break;
+ case 3: do_help (si); break;
default: abort();
}
}
if (si && si->sp_data)
destroy_splash_window (si);
}
+
+\f
+/* Button callbacks */
+
+#ifdef VMS
+# define pid_t int
+# define fork vfork
+#endif /* VMS */
+
+static void
+fork_and_exec (saver_info *si, const char *command, const char *desc)
+{
+ saver_preferences *p = &si->prefs;
+ pid_t forked;
+ char buf [512];
+ char *av[5];
+ int ac;
+
+ if (!command || !*command)
+ {
+ fprintf (stderr, "%s: no %s command has been specified.\n",
+ blurb(), desc);
+ return;
+ }
+
+ switch ((int) (forked = fork ()))
+ {
+ case -1:
+ sprintf (buf, "%s: couldn't fork", blurb());
+ perror (buf);
+ break;
+
+ case 0:
+ close (ConnectionNumber (si->dpy)); /* close display fd */
+ hack_subproc_environment (si->default_screen); /* set $DISPLAY */
+ ac = 0;
+ av [ac++] = (char *) p->shell;
+ av [ac++] = (char *) "-c";
+ av [ac++] = (char *) command;
+ av [ac] = 0;
+ execvp (av[0], av); /* shouldn't return. */
+
+ sprintf (buf, "%s: execvp(\"%s\", \"%s\", \"%s\") failed",
+ blurb(), av[0], av[1], av[2]);
+ perror (buf);
+ fflush (stderr);
+ fflush (stdout);
+ exit (1); /* Note that this only exits a child fork. */
+ break;
+
+ default:
+ /* parent fork. */
+ break;
+ }
+}
+
+
+static void
+do_demo (saver_info *si)
+{
+ saver_preferences *p = &si->prefs;
+ fork_and_exec (si, p->demo_command, "demo-mode");
+}
+
+static void
+do_prefs (saver_info *si)
+{
+ saver_preferences *p = &si->prefs;
+ fork_and_exec (si, p->prefs_command, "preferences");
+}
+
+static void
+do_help (saver_info *si)
+{
+ saver_preferences *p = &si->prefs;
+ char *help_command;
+
+ if (!p->help_url || !*p->help_url)
+ {
+ fprintf (stderr, "%s: no Help URL has been specified.\n", blurb());
+ return;
+ }
+
+ help_command = (char *) malloc (strlen (p->load_url_command) +
+ (strlen (p->help_url) * 2) + 10);
+ sprintf (help_command, p->load_url_command, p->help_url, p->help_url);
+ fork_and_exec (si, help_command, "URL-loading");
+ free (help_command);
+}
extern saver_info *global_si_kludge; /* I hate C so much... */
-static void hack_subproc_environment (saver_screen_info *ssi);
-
-
static void
nice_subproc (int nice_level)
{
saver_preferences *p = &si->prefs;
#ifndef VMS
- Bool hairy_p = !!strpbrk (command, "*?$&!<>[];`'\\\"");
+ Bool hairy_p = !!strpbrk (command, "*?$&!<>[];`'\\\"=");
+ /* note: = is in the above because of the sh syntax "FOO=bar cmd". */
if (p->verbose_p)
fprintf (stderr, "%s: spawning \"%s\" in pid %lu%s.\n",
\f
+static Bool
+hack_enabled_p (const char *hack)
+{
+ const char *s = hack;
+ while (isspace(*s)) s++;
+ return (*s != '-');
+}
+
static Bool
select_visual_of_hack (saver_screen_info *ssi, const char *hack)
{
const char *in = hack;
char *out = vis;
while (isspace(*in)) in++; /* skip whitespace */
+ if (*in == '-') in++; /* skip optional "-" */
+ while (isspace(*in)) in++; /* skip whitespace */
+
while (!isspace(*in) && *in != ':')
*out++ = *in++; /* snarf first token */
while (isspace(*in)) in++; /* skip whitespace */
else
selected = select_visual(ssi, 0);
- if (!selected && (p->verbose_p || si->demo_mode_p))
+ if (!selected && (p->verbose_p || si->demoing_p))
{
if (*in == ':') in++;
while (isspace(*in)) in++;
fprintf (stderr,
- (si->demo_mode_p
+ (si->demoing_p
? "%s: warning, no \"%s\" visual for \"%s\".\n"
: "%s: no \"%s\" visual; skipping \"%s\".\n"),
blurb(), (vis ? vis : "???"), in);
raise_window (si, first_time_p, True, False);
XFlush (si->dpy);
- if (p->screenhacks_count || si->demo_mode_p)
+ if (p->screenhacks_count)
{
char *hack;
pid_t forked;
char buf [255];
int new_hack;
+ int retry_count = 0;
+ Bool force = False;
- if (si->demo_mode_p)
- {
- hack = si->demo_hack;
+ AGAIN:
+
+ if (p->screenhacks_count == 1)
+ /* If there is only one hack in the list, there is no choice. */
+ new_hack = 0;
+
+ else if (si->selection_mode == -1)
+ /* Select the next hack, wrapping. */
+ new_hack = (ssi->current_hack + 1) % p->screenhacks_count;
+
+ else if (si->selection_mode == -2)
+ /* Select the previous hack, wrapping. */
+ new_hack = ((ssi->current_hack + p->screenhacks_count - 1)
+ % p->screenhacks_count);
- /* Ignore visual-selection failure if in demo mode. */
- (void) select_visual_of_hack (ssi, hack);
+ else if (si->selection_mode > 0)
+ /* Select a specific hack, by number. No negotiation. */
+ {
+ new_hack = ((si->selection_mode - 1) % p->screenhacks_count);
+ force = True;
}
else
{
- int retry_count = 0;
-
- AGAIN:
- if (p->screenhacks_count == 1)
- new_hack = 0;
- else if (si->selection_mode == -1)
- new_hack = (ssi->current_hack + 1) % p->screenhacks_count;
- else if (si->selection_mode == -2)
- new_hack = ((ssi->current_hack + p->screenhacks_count - 1)
- % p->screenhacks_count);
- else if (si->selection_mode > 0)
- new_hack = ((si->selection_mode - 1) % p->screenhacks_count);
- else
- while ((new_hack = random () % p->screenhacks_count)
- == ssi->current_hack)
- ;
- ssi->current_hack = new_hack;
- hack = p->screenhacks[ssi->current_hack];
+ /* Select a random hack (but not the one we just ran.) */
+ while ((new_hack = random () % p->screenhacks_count)
+ == ssi->current_hack)
+ ;
+ }
- if (!select_visual_of_hack (ssi, hack))
+ ssi->current_hack = new_hack;
+ hack = p->screenhacks[ssi->current_hack];
+
+ /* If the hack is disabled, or there is no visual for this hack,
+ then try again (move forward, or backward, or re-randomize.)
+ Unless this hack was specified explicitly, in which case,
+ use it regardless.
+ */
+ if (!force &&
+ (!hack_enabled_p (hack) ||
+ !select_visual_of_hack (ssi, hack)))
+ {
+ if (++retry_count > (p->screenhacks_count*4))
{
- if (++retry_count > (p->screenhacks_count*4))
- {
- /* Uh, oops. Odds are, there are no suitable visuals,
- and we're looping. Give up. (This is totally lame,
- what we should do is make a list of suitable hacks at
- the beginning, then only loop over them.)
- */
- if (p->verbose_p)
- fprintf(stderr,
- "%s: no suitable visuals for these programs.\n",
- blurb());
- return;
- }
- else
- goto AGAIN;
+ /* Uh, oops. Odds are, there are no suitable visuals,
+ and we're looping. Give up. (This is totally lame,
+ what we should do is make a list of suitable hacks at
+ the beginning, then only loop over them.)
+ */
+ if (p->verbose_p)
+ fprintf(stderr,
+ "%s: no suitable visuals for these programs.\n",
+ blurb());
+ return;
}
+ else
+ goto AGAIN;
}
+ /* Turn off "next" and "prev" modes now, but "demo" mode is only
+ turned off by explicit action.
+ */
if (si->selection_mode < 0)
si->selection_mode = 0;
{
char *in = hack;
while (isspace(*in)) in++; /* skip whitespace */
+ if (*in == '-') in++; /* skip optional "-" */
+ while (isspace(*in)) in++; /* skip whitespace */
hack = in;
while (!isspace(*in) && *in != ':') in++; /* snarf first token */
while (isspace(*in)) in++; /* skip whitespace */
}
-static void
+void
hack_subproc_environment (saver_screen_info *ssi)
{
/* Store $DISPLAY into the environment, so that the $DISPLAY variable that
void
save_argv (int argc, char **argv)
{
- /* Leave room for one more argument, the -initial-demo-mode switch. */
saved_argv = (char **) calloc (argc+2, sizeof (char *));
saved_argv [argc] = 0;
while (argc--)
}
}
-/* Modifies saved_argv to either contain or not contain "-initial-demo-mode".
+
+/* Re-execs the process with the arguments in saved_argv.
+ Does not return unless there was an error.
*/
-static void
-hack_saved_argv (Bool demo_mode_p)
+void
+restart_process (saver_info *si)
{
- static char *demo_mode_switch = "-initial-demo-mode";
-
- if (demo_mode_p) /* We want the switch to be in the args. */
- {
- /* See if the switch is there already. If so, we're done. */
- int i;
- for (i = 0; saved_argv[i]; i++)
- if (!strcmp (saved_argv[i], demo_mode_switch))
- return;
-
- /* If it wasn't there, add it to the end. save_argv() made room. */
- saved_argv [i] = demo_mode_switch;
- saved_argv [i+1] = 0;
- }
- else /* We want the switch to not be in the args. */
+ if (si->prefs.verbose_p)
{
int i;
+ fprintf (real_stderr, "%s: re-executing", blurb());
for (i = 0; saved_argv[i]; i++)
- while (!strcmp (saved_argv [i], demo_mode_switch))
- {
- int j;
- for (j = i; saved_argv[j]; j++)
- saved_argv [j] = saved_argv [j+1];
- }
+ fprintf (real_stderr, " %s", saved_argv[i]);
+ fprintf (real_stderr, "\n");
}
-}
-
+ describe_uids (si, real_stderr);
+ fprintf (real_stderr, "\n");
-/* Re-execs the process with the arguments in saved_argv.
- Does not return unless there was an error.
- */
-static void
-restart_process_1 (saver_info *si)
-{
fflush (real_stdout);
fflush (real_stderr);
execvp (saved_argv [0], saved_argv); /* shouldn't return */
}
XBell(si->dpy, 0);
}
-
-
-/* Re-execs the process with the arguments in saved_argv,
- minus -initial-demo-mode.
- Does not return unless there was an error.
- */
-void
-restart_process (saver_info *si)
-{
- hack_saved_argv (True);
- restart_process_1 (si);
-}
-
-/* Re-execs the process with the arguments in saved_argv,
- plus -initial-demo-mode.
- Does not return unless there was an error.
- */
-void
-demo_mode_restart_process (saver_info *si)
-{
- hack_saved_argv (False);
- restart_process_1 (si);
-}
itself.
*/
-#define WHICH 0
+#define WHICH 2
#ifdef HAVE_CONFIG_H
# include "config.h"
FILE *real_stderr, *real_stdout;
-void reset_stderr(saver_screen_info *ssi) {}
-void clear_stderr(saver_screen_info *ssi) {}
-void reset_watchdog_timer(saver_info *si, Bool on_p) {}
void monitor_power_on (saver_info *si) {}
-void grab_keyboard_and_mouse (saver_info *si, Window w, Cursor c) {}
-void ungrab_keyboard_and_mouse (saver_info *si) {}
-Bool select_visual (saver_screen_info *ssi, const char *v) { return False; }
-void raise_window (saver_info *si, Bool i, Bool b, Bool d) {}
-void restore_real_vroot (saver_info *si) {}
-void saver_exit (saver_info *si, int status, const char *core) { exit(status);}
-const char * signal_name(int signal) { return "???"; }
Bool monitor_powered_on_p (saver_info *si) { return True; }
-void start_notice_events_timer (saver_info *si, Window w) {}
void initialize_screensaver_window (saver_info *si) {}
+void raise_window (saver_info *si, Bool i, Bool b, Bool d) {}
void blank_screen (saver_info *si) {}
void unblank_screen (saver_info *si) {}
+Bool select_visual (saver_screen_info *ssi, const char *v) { return False; }
+Bool window_exists_p (Display *dpy, Window window) {return True;}
+void start_notice_events_timer (saver_info *si, Window w) {}
Bool handle_clientmessage (saver_info *si, XEvent *e, Bool u) { return False; }
int BadWindow_ehandler (Display *dpy, XErrorEvent *error) { exit(1); }
-int write_init_file (saver_info *si) { return 0;}
-Bool window_exists_p (Display *dpy, Window window) {return True;}
+const char *signal_name(int signal) { return "???"; }
+void restore_real_vroot (saver_info *si) {}
+void saver_exit (saver_info *si, int status, const char *core) { exit(status);}
const char *blurb(void) { return progname; }
Atom XA_SCREENSAVER, XA_DEMO, XA_PREFS;
}
-static char *
-reformat_hack (const char *hack)
-{
- int i;
- const char *in = hack;
- int indent = 13;
- char *h2 = (char *) malloc(strlen(in) + indent + 2);
- char *out = h2;
-
- while (isspace(*in)) in++; /* skip whitespace */
- while (*in && !isspace(*in) && *in != ':')
- *out++ = *in++; /* snarf first token */
- while (isspace(*in)) in++; /* skip whitespace */
-
- if (*in == ':')
- *out++ = *in++; /* copy colon */
- else
- {
- in = hack;
- out = h2; /* reset to beginning */
- }
-
- *out = 0;
-
- while (isspace(*in)) in++; /* skip whitespace */
- for (i = strlen(h2); i < indent; i++) /* indent */
- *out++ = ' ';
-
- /* copy the rest of the line. */
- while (*in)
- {
- /* shrink all whitespace to one space, for the benefit of the "demo"
- mode display. We only do this when we can easily tell that the
- whitespace is not significant (no shell metachars).
- */
- switch (*in)
- {
- case '\'': case '"': case '`': case '\\':
- {
- /* Metachars are scary. Copy the rest of the line unchanged. */
- while (*in)
- *out++ = *in++;
- }
- break;
- case ' ': case '\t':
- {
- while (*in == ' ' || *in == '\t')
- in++;
- *out++ = ' ';
- }
- break;
- default:
- *out++ = *in++;
- break;
- }
- }
- *out = 0;
-
- /* strip trailing whitespace. */
- out = out-1;
- while (out > h2 && (*out == ' ' || *out == '\t' || *out == '\n'))
- *out-- = 0;
-
- return h2;
-}
-
-
-static void
-get_screenhacks (saver_info *si)
-{
- saver_preferences *p = &si->prefs;
- int i = 0;
- int start = 0;
- int end = 0;
- int size;
- char *d;
-
- d = get_string_resource ("monoPrograms", "MonoPrograms");
- if (d && !*d) { free(d); d = 0; }
- if (!d)
- d = get_string_resource ("colorPrograms", "ColorPrograms");
- if (d && !*d) { free(d); d = 0; }
-
- if (d)
- {
- fprintf (stderr,
- "%s: the `monoPrograms' and `colorPrograms' resources are obsolete;\n\
- see the manual for details.\n", blurb());
- free(d);
- }
-
- d = get_string_resource ("programs", "Programs");
-
- if (p->screenhacks)
- {
- for (i = 0; i < p->screenhacks_count; i++)
- if (p->screenhacks[i])
- free (p->screenhacks[i]);
- free(p->screenhacks);
- p->screenhacks = 0;
- }
-
- if (!d || !*d)
- {
- p->screenhacks_count = 0;
- p->screenhacks = 0;
- return;
- }
-
- size = strlen (d);
-
-
- /* Count up the number of newlines (which will be equal to or larger than
- the number of hacks.)
- */
- i = 0;
- for (i = 0; d[i]; i++)
- if (d[i] == '\n')
- i++;
- i++;
-
- p->screenhacks = (char **) calloc (sizeof (char *), i+1);
-
- /* Iterate over the lines in `d' (the string with newlines)
- and make new strings to stuff into the `screenhacks' array.
- */
- p->screenhacks_count = 0;
- while (start < size)
- {
- /* skip forward over whitespace. */
- while (d[start] == ' ' || d[start] == '\t' || d[start] == '\n')
- start++;
-
- /* skip forward to newline or end of string. */
- end = start;
- while (d[end] != 0 && d[end] != '\n')
- end++;
-
- /* null terminate. */
- d[end] = 0;
-
- p->screenhacks[p->screenhacks_count++] = reformat_hack (d + start);
- if (p->screenhacks_count >= i)
- abort();
-
- start = end+1;
- }
-
- if (p->screenhacks_count == 0)
- {
- free (p->screenhacks);
- p->screenhacks = 0;
- }
-}
-
-
-
static char *fallback[] = {
#include "XScreenSaver_ad.h"
0
0, 0);
si->dpy = XtDisplay (toplevel_shell);
- si->db = XtDatabase (si->dpy);
+ p->db = XtDatabase (si->dpy);
si->default_screen->toplevel_shell = toplevel_shell;
si->default_screen->screen = XtScreen(toplevel_shell);
si->default_screen->default_visual =
si->default_screen->screensaver_window =
RootWindowOfScreen(si->default_screen->screen);
- db = si->db;
+ db = p->db;
XtGetApplicationNameAndClass (si->dpy, &progname, &progclass);
- p->debug_p = True;
- p->verbose_p = True;
- p->timestamp_p = True;
- p->lock_p = True;
-
- p->fade_p = get_boolean_resource ("fade", "Boolean");
- p->unfade_p = get_boolean_resource ("unfade", "Boolean");
- p->fade_seconds = 1000 * get_seconds_resource ("fadeSeconds", "Time");
- p->fade_ticks = get_integer_resource ("fadeTicks", "Integer");
- p->install_cmap_p = get_boolean_resource ("installColormap", "Boolean");
- p->nice_inferior = get_integer_resource ("nice", "Nice");
-
- p->initial_delay = 1000 * get_seconds_resource ("initialDelay", "Time");
- p->splash_duration = 1000 * get_seconds_resource ("splashDuration", "Time");
- p->timeout = 1000 * get_minutes_resource ("timeout", "Time");
- p->lock_timeout = 1000 * get_minutes_resource ("lockTimeout", "Time");
- p->cycle = 1000 * get_minutes_resource ("cycle", "Time");
- p->passwd_timeout = 1000 * get_seconds_resource ("passwdTimeout", "Time");
- p->passwd_timeout = 1000 * get_seconds_resource ("passwdTimeout", "Time");
- p->splash_duration = 1000 * get_seconds_resource ("splashDuration", "Time");
- p->shell = get_string_resource ("bourneShell", "BourneShell");
- p->help_url = get_string_resource("helpURL", "URL");
- p->load_url_command = get_string_resource("loadURL", "LoadURL");
-
- get_screenhacks(si);
+ load_init_file (&si->prefs);
while (1)
{
sleep (1);
}
#else
- si->demo_mode_p = True;
make_screenhack_dialog (si);
XtAppMainLoop(si->app);
#endif
blurb(), p->timeout, si->timer_id);
#endif /* DEBUG_TIMERS */
- XtRemoveTimeOut (si->timer_id);
+ if (si->timer_id)
+ XtRemoveTimeOut (si->timer_id);
si->timer_id = XtAppAddTimeOut (si->app, p->timeout, idle_timer,
(XtPointer) si);
if (si->cycle_id) abort (); /* no cycle timer when inactive */
/* If any widgets want to handle this event, let them. */
dispatch_event (si, &event);
- /* We got a user event */
+ /* We got a user event.
+ If we're waiting for the user to become active, this is it.
+ If we're waiting until the user becomes idle, reset the timers
+ (since now we have longer to wait.)
+ */
if (!until_idle_p)
- goto DONE;
+ {
+ if (si->demoing_p && event.xany.type == MotionNotify)
+ /* When we're demoing a single hack, mouse motion doesn't
+ cause deactivation. Only clicks and keypresses do. */
+ ;
+ else
+ /* If we're not demoing, then any activity causes deactivation.
+ */
+ goto DONE;
+ }
else
reset_timers (si);
+
break;
default:
(XScreenSaverNotifyEvent *) &event;
if (sevent->state == ScreenSaverOn)
{
-# ifdef DEBUG_TIMERS
+ int i = 0;
if (p->verbose_p)
- fprintf (stderr, "%s: ScreenSaverOn event received at %s\n",
- blurb(), timestring ());
-# endif /* DEBUG_TIMERS */
+ fprintf (stderr, "%s: MIT ScreenSaverOn event received.\n",
+ blurb());
/* Get the "real" server window(s) out of the way as soon
as possible. */
- int i = 0;
for (i = 0; i < si->nscreens; i++)
{
saver_screen_info *ssi = &si->screens[i];
if (sevent->kind != ScreenSaverExternal)
{
-# ifdef DEBUG_TIMERS
fprintf (stderr,
"%s: ScreenSaverOn event wasn't of type External!\n",
blurb());
-# endif /* DEBUG_TIMERS */
}
if (until_idle_p)
}
else if (sevent->state == ScreenSaverOff)
{
-# ifdef DEBUG_TIMERS
if (p->verbose_p)
- fprintf (stderr, "%s: ScreenSaverOff event received at %s\n",
- blurb(), timestring ());
-# endif /* DEBUG_TIMERS */
+ fprintf (stderr, "%s: MIT ScreenSaverOff event received.\n",
+ blurb());
if (!until_idle_p)
goto DONE;
}
-# ifdef DEBUG_TIMERS
- else if (p->verbose_p)
+ else
fprintf (stderr,
- "%s: unknown MIT-SCREEN-SAVER event received at %s\n",
- blurb(), timestring ());
-# endif /* DEBUG_TIMERS */
+ "%s: unknown MIT-SCREEN-SAVER event %d received!\n",
+ blurb(), sevent->state);
}
else
#ifdef HAVE_SGI_SAVER_EXTENSION
if (event.type == (si->sgi_saver_ext_event_number + ScreenSaverStart))
{
-# ifdef DEBUG_TIMERS
if (p->verbose_p)
- fprintf (stderr, "%s: ScreenSaverStart event received at %s\n",
- blurb(), timestring ());
-# endif /* DEBUG_TIMERS */
+ fprintf (stderr, "%s: SGI ScreenSaverStart event received.\n",
+ blurb());
if (until_idle_p)
goto DONE;
else if (event.type == (si->sgi_saver_ext_event_number +
ScreenSaverEnd))
{
-# ifdef DEBUG_TIMERS
if (p->verbose_p)
- fprintf (stderr, "%s: ScreenSaverEnd event received at %s\n",
- blurb(), timestring ());
-# endif /* DEBUG_TIMERS */
+ fprintf (stderr, "%s: SGI ScreenSaverEnd event received.\n",
+ blurb());
if (!until_idle_p)
goto DONE;
}
watchdog_timer (XtPointer closure, XtIntervalId *id)
{
saver_info *si = (saver_info *) closure;
- if (!si->demo_mode_p)
+
+ disable_builtin_screensaver (si, False);
+
+ if (si->screen_blanked_p)
{
- disable_builtin_screensaver (si, False);
- if (si->screen_blanked_p)
- {
- Bool running_p = screenhack_running_p(si);
+ Bool running_p = screenhack_running_p(si);
#ifdef DEBUG_TIMERS
- if (si->prefs.verbose_p)
- fprintf (stderr, "%s: watchdog timer raising %sscreen.\n",
- blurb(), (running_p ? "" : "and clearing "));
+ if (si->prefs.verbose_p)
+ fprintf (stderr, "%s: watchdog timer raising %sscreen.\n",
+ blurb(), (running_p ? "" : "and clearing "));
#endif /* DEBUG_TIMERS */
- raise_window (si, True, True, running_p);
+ raise_window (si, True, True, running_p);
- if (!monitor_powered_on_p (si))
- {
- if (si->prefs.verbose_p)
- fprintf (stderr,
- "%s: server reports that monitor has powered down; "
- "killing running hacks.\n", blurb());
- kill_screenhack (si);
- }
+ if (!monitor_powered_on_p (si))
+ {
+ if (si->prefs.verbose_p)
+ fprintf (stderr,
+ "%s: server reports that monitor has powered down; "
+ "killing running hacks.\n", blurb());
+ kill_screenhack (si);
}
}
}
# include "vms-gtod.h" /* for gettimeofday() */
#endif /* VMS */
-# ifdef HAVE_UNAME
-# include <sys/utsname.h> /* for uname() */
-# endif /* HAVE_UNAME */
+#ifndef VMS
+# include <pwd.h> /* for getpwuid() */
+#else /* VMS */
+# include "vms-pwd.h"
+#endif /* VMS */
+
+#ifdef HAVE_UNAME
+# include <sys/utsname.h> /* for uname() */
+#endif /* HAVE_UNAME */
#include <stdio.h>
#include <X11/Xproto.h> /* for CARD32 */
}
-void
+Bool
grab_keyboard_and_mouse (saver_info *si, Window window, Cursor cursor)
{
- Status status;
+ Status mstatus, kstatus;
XSync (si->dpy, False);
- status = grab_kbd (si, window);
- if (status != GrabSuccess)
+ kstatus = grab_kbd (si, window);
+ if (kstatus != GrabSuccess)
{ /* try again in a second */
sleep (1);
- status = grab_kbd (si, window);
- if (status != GrabSuccess)
+ kstatus = grab_kbd (si, window);
+ if (kstatus != GrabSuccess)
fprintf (stderr, "%s: couldn't grab keyboard! (%s)\n",
- blurb(), grab_string(status));
+ blurb(), grab_string(kstatus));
}
- status = grab_mouse (si, window, cursor);
- if (status != GrabSuccess)
+ mstatus = grab_mouse (si, window, cursor);
+ if (mstatus != GrabSuccess)
{ /* try again in a second */
sleep (1);
- status = grab_mouse (si, window, cursor);
- if (status != GrabSuccess)
+ mstatus = grab_mouse (si, window, cursor);
+ if (mstatus != GrabSuccess)
fprintf (stderr, "%s: couldn't grab pointer! (%s)\n",
- blurb(), grab_string(status));
+ blurb(), grab_string(mstatus));
}
+
+ return (kstatus == GrabSuccess ||
+ mstatus == GrabSuccess);
}
void
Window root = RootWindowOfScreen (screen);
Window root2, parent, *kids;
unsigned int nkids;
+ XErrorHandler old_handler;
+
+ /* It's possible that a window might be deleted between our call to
+ XQueryTree() and our call to XGetWindowProperty(). Don't die if
+ that happens (but just ignore that window, it's not the one we're
+ interested in anyway.)
+ */
+ XSync (dpy, False);
+ old_handler = XSetErrorHandler (BadWindow_ehandler);
+ XSync (dpy, False);
ssi->real_vroot = 0;
ssi->real_vroot_value = 0;
ssi->real_vroot_value = *vrootP;
}
+ XSync (dpy, False);
+ XSetErrorHandler (old_handler);
+ XSync (dpy, False);
+
if (ssi->real_vroot)
{
handle_signals (si, True);
return (xgwa.screen != 0);
}
+static void
+store_saver_id (saver_screen_info *ssi)
+{
+ XClassHint class_hints;
+ saver_info *si = ssi->global;
+ unsigned long pid = (unsigned long) getpid ();
+ char buf[20];
+ struct passwd *p = getpwuid (getuid ());
+ const char *name, *host;
+ char *id;
+
+ /* First store the name and class on the window.
+ */
+ class_hints.res_name = progname;
+ class_hints.res_class = progclass;
+ XSetClassHint (si->dpy, ssi->screensaver_window, &class_hints);
+ XStoreName (si->dpy, ssi->screensaver_window, "screensaver");
+
+ /* Then store the xscreensaver version number.
+ */
+ XChangeProperty (si->dpy, ssi->screensaver_window,
+ XA_SCREENSAVER_VERSION,
+ XA_STRING, 8, PropModeReplace,
+ (unsigned char *) si->version,
+ strlen (si->version));
+
+ /* Now store the XSCREENSAVER_ID property, that says what user and host
+ xscreensaver is running as.
+ */
+
+ if (p && p->pw_name && *p->pw_name)
+ name = p->pw_name;
+ else if (p)
+ {
+ sprintf (buf, "%lu", (unsigned long) p->pw_uid);
+ name = buf;
+ }
+ else
+ name = "???";
+
+# if defined(HAVE_UNAME)
+ {
+ struct utsname uts;
+ if (uname (&uts) < 0)
+ host = "???";
+ else
+ host = uts.nodename;
+ }
+# elif defined(VMS)
+ host = getenv("SYS$NODE");
+# else /* !HAVE_UNAME && !VMS */
+ host = "???";
+# endif /* !HAVE_UNAME && !VMS */
+
+ id = (char *) malloc (strlen(name) + strlen(host) + 50);
+ sprintf (id, "%lu (%s@%s)", pid, name, host);
+
+ XChangeProperty (si->dpy, ssi->screensaver_window,
+ XA_SCREENSAVER_ID, XA_STRING,
+ 8, PropModeReplace,
+ (unsigned char *) id, strlen (id));
+ free (id);
+}
+
+
static void
initialize_screensaver_window_1 (saver_screen_info *ssi)
{
its own set of problems...
*/
XColor black;
- XClassHint class_hints;
XSetWindowAttributes attrs;
unsigned long attrmask;
int width = WidthOfScreen (ssi->screen);
int height = HeightOfScreen (ssi->screen);
- char id [2048];
static Bool printed_visual_info = False; /* only print the message once. */
black.red = black.green = black.blue = 0;
{
if (! ssi->cmap)
{
- ssi->cmap = XCreateColormap (si->dpy, RootWindowOfScreen (ssi->screen),
+ ssi->cmap = XCreateColormap (si->dpy,
+ RootWindowOfScreen (ssi->screen),
ssi->current_visual, AllocNone);
if (! XAllocColor (si->dpy, ssi->cmap, &black)) abort ();
ssi->black_pixel = black.pixel;
blurb(), (unsigned long) ssi->screensaver_window);
}
-#ifdef HAVE_MIT_SAVER_EXTENSION
- if (!p->use_mit_saver_extension ||
- window_exists_p (si->dpy, ssi->screensaver_window))
- /* When using the MIT-SCREEN-SAVER extension, the window pointed to
- by screensaver_window only exists while the saver is active.
- So we must be careful to only try and manipulate it while it
- exists...
- (#### The above comment would be true if the MIT extension actually
- worked, but it's not true today -- see `server_mit_saver_window'.)
- */
-#endif /* HAVE_MIT_SAVER_EXTENSION */
- {
- class_hints.res_name = progname;
- class_hints.res_class = progclass;
- XSetClassHint (si->dpy, ssi->screensaver_window, &class_hints);
- XStoreName (si->dpy, ssi->screensaver_window, "screensaver");
- XChangeProperty (si->dpy, ssi->screensaver_window,
- XA_SCREENSAVER_VERSION,
- XA_STRING, 8, PropModeReplace,
- (unsigned char *) si->version,
- strlen (si->version));
-
- sprintf (id, "%lu on host ", (unsigned long) getpid ());
-# if defined(HAVE_UNAME)
- {
- struct utsname uts;
- if (uname (&uts) < 0)
- strcat (id, "???");
- else
- strcat (id, uts.nodename);
- }
-# elif defined(VMS)
- strcat (id, getenv("SYS$NODE"));
-# else /* !HAVE_UNAME && !VMS */
- strcat (id, "???");
-# endif /* !HAVE_UNAME && !VMS */
+ store_saver_id (ssi);
- XChangeProperty (si->dpy, ssi->screensaver_window,
- XA_SCREENSAVER_ID, XA_STRING,
- 8, PropModeReplace, (unsigned char *) id, strlen (id));
+ if (!ssi->cursor)
+ {
+ Pixmap bit;
+ bit = XCreatePixmapFromBitmapData (si->dpy, ssi->screensaver_window,
+ "\000", 1, 1,
+ BlackPixelOfScreen (ssi->screen),
+ BlackPixelOfScreen (ssi->screen),
+ 1);
+ ssi->cursor = XCreatePixmapCursor (si->dpy, bit, bit, &black, &black,
+ 0, 0);
+ XFreePixmap (si->dpy, bit);
+ }
- if (!ssi->cursor)
- {
- Pixmap bit;
- bit = XCreatePixmapFromBitmapData (si->dpy, ssi->screensaver_window,
- "\000", 1, 1,
- BlackPixelOfScreen (ssi->screen),
- BlackPixelOfScreen (ssi->screen),
- 1);
- ssi->cursor = XCreatePixmapCursor (si->dpy, bit, bit, &black, &black,
- 0, 0);
- XFreePixmap (si->dpy, bit);
- }
+ XSetWindowBackground (si->dpy, ssi->screensaver_window, ssi->black_pixel);
- XSetWindowBackground (si->dpy, ssi->screensaver_window,
- ssi->black_pixel);
- if (si->demo_mode_p)
- XUndefineCursor (si->dpy, ssi->screensaver_window);
- else
- XDefineCursor (si->dpy, ssi->screensaver_window, ssi->cursor);
- }
+ if (si->demoing_p)
+ XUndefineCursor (si->dpy, ssi->screensaver_window);
+ else
+ XDefineCursor (si->dpy, ssi->screensaver_window, ssi->cursor);
}
void
saver_preferences *p = &si->prefs;
int i;
+ if (si->demoing_p)
+ inhibit_fade = True;
+
initialize_screensaver_window (si);
reset_watchdog_timer (si, True);
- if (p->fade_p && si->fading_possible_p && !inhibit_fade && !si->demo_mode_p)
+ if (p->fade_p && p->fading_possible_p && !inhibit_fade)
{
Window *current_windows = (Window *)
calloc(sizeof(Window), si->nscreens);
grab_keyboard_and_mouse (si,
/*si->screens[0].screensaver_window,*/
RootWindowOfScreen(si->screens[0].screen),
- (si->demo_mode_p ? 0 : si->screens[0].cursor));
+ (si->demoing_p
+ ? 0
+ : si->screens[0].cursor));
for (i = 0; i < si->nscreens; i++)
{
unblank_screen (saver_info *si)
{
saver_preferences *p = &si->prefs;
+ Bool unfade_p = (p->fading_possible_p && p->unfade_p);
int i;
monitor_power_on (si);
store_activate_time (si, True);
reset_watchdog_timer (si, False);
- if (p->unfade_p && si->fading_possible_p && !si->demo_mode_p)
+ if (si->demoing_p)
+ unfade_p = False;
+
+ if (unfade_p)
{
Window *current_windows = (Window *)
calloc(sizeof(Window), si->nscreens);
if (old_w == si->mouse_grab_window)
{
XGrabServer (si->dpy); /* ############ DANGER! */
- ungrab_mouse(si);
- grab_mouse(si, ssi->screensaver_window,
- (si->demo_mode_p ? 0 : ssi->cursor));
+ ungrab_mouse (si);
+ grab_mouse (si, ssi->screensaver_window,
+ (si->demoing_p
+ ? 0
+ : ssi->cursor));
XUngrabServer (si->dpy);
XSync (si->dpy, False); /* ###### (danger over) */
}
* implied warranty.
*/
-#define STANDALONE
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <X11/Intrinsic.h> /* only needed to get through xscreensaver.h */
+#include "remote.h"
#include "version.h"
-#ifdef STANDALONE
- static char *progname;
- static Atom XA_VROOT;
- static Atom XA_SCREENSAVER, XA_SCREENSAVER_RESPONSE, XA_SCREENSAVER_VERSION;
- static Atom XA_SCREENSAVER_TIME, XA_SELECT;
-#else /* !STANDALONE */
-# include "xscreensaver.h"
-#endif /* !STANDALONE */
-
-
#ifdef _VROOT_H_
ERROR! you must not include vroot.h in this file
#endif
+char *progname;
+Atom XA_VROOT;
+Atom XA_SCREENSAVER, XA_SCREENSAVER_VERSION, XA_SCREENSAVER_RESPONSE;
+Atom XA_SCREENSAVER_ID, XA_SCREENSAVER_TIME, XA_SELECT, XA_DEMO;
+static Atom XA_ACTIVATE, XA_DEACTIVATE, XA_CYCLE, XA_NEXT, XA_PREV, XA_EXIT;
+static Atom XA_RESTART, XA_PREFS, XA_LOCK;
-static Window
-find_screensaver_window (Display *dpy, char **version)
-{
- int i;
- Window root = RootWindowOfScreen (DefaultScreenOfDisplay (dpy));
- Window root2, parent, *kids;
- unsigned int nkids;
-
- if (version) *version = 0;
-
- if (! XQueryTree (dpy, root, &root2, &parent, &kids, &nkids))
- abort ();
- if (root != root2)
- abort ();
- if (parent)
- abort ();
- if (! (kids && nkids))
- abort ();
- for (i = 0; i < nkids; i++)
- {
- Atom type;
- int format;
- unsigned long nitems, bytesafter;
- char *v;
-
- if (XGetWindowProperty (dpy, kids[i],
- XA_SCREENSAVER_VERSION,
- 0, 200, False, XA_STRING,
- &type, &format, &nitems, &bytesafter,
- (unsigned char **) &v)
- == Success
- && type != None)
- {
- if (version)
- *version = v;
- return kids[i];
- }
- }
- fprintf (stderr, "%s: no screensaver is running on display %s\n", progname,
- DisplayString (dpy));
- return 0;
-}
-
-
-static int
-send_xscreensaver_command (Display *dpy, Atom command, long argument,
- Window *window_ret)
-{
- char *v = 0;
- Window window = find_screensaver_window (dpy, &v);
- XWindowAttributes xgwa;
-
- if (window_ret)
- *window_ret = window;
-
- if (!window)
- return -1;
-
- /* Select for property change events, so that we can read the response. */
- XGetWindowAttributes (dpy, window, &xgwa);
- XSelectInput (dpy, window, xgwa.your_event_mask | PropertyChangeMask);
-
- if (command == XA_SCREENSAVER_TIME ||
- command == XA_SCREENSAVER_VERSION)
- {
- XClassHint hint;
- memset (&hint, 0, sizeof(hint));
- if (!v || !*v)
- {
- fprintf (stderr, "%s: version property not set on window 0x%x?\n",
- progname, (unsigned int) window);
- return -1;
- }
-
- XGetClassHint(dpy, window, &hint);
- if (!hint.res_class)
- {
- fprintf (stderr, "%s: class hints not set on window 0x%x?\n",
- progname, (unsigned int) window);
- return -1;
- }
-
- fprintf (stdout, "%s %s", hint.res_class, v);
-
- if (command != XA_SCREENSAVER_TIME)
- {
- fprintf (stdout, "\n");
- }
- else
- {
- Atom type;
- int format;
- unsigned long nitems, bytesafter;
- unsigned char *data = 0;
- Bool active_p = False;
-
- if (XGetWindowProperty (dpy, window, XA_VROOT,
- 0, 0, False, XA_WINDOW,
- &type, &format, &nitems, &bytesafter,
- &data)
- == Success
- && type != None)
- active_p = True;
-
- if (data) free (data);
- data = 0;
-
- if (XGetWindowProperty (dpy, window,
- XA_SCREENSAVER_TIME,
- 0, 1, False, XA_INTEGER,
- &type, &format, &nitems, &bytesafter,
- &data)
- == Success
- && type == XA_INTEGER
- && data)
- {
- CARD32 time32 = *((CARD32 *)data);
- time_t tt = (time_t) time32;
-
- if (active_p)
- fprintf (stdout, ": screen blanked since ");
- else
- /* suggestions for a better way to phrase this are welcome. */
- fprintf (stdout, ": screen non-blanked since ");
- fprintf (stdout, "%s", ctime(&tt));
- if (data) free (data);
- }
- else
- {
- if (data) free (data);
- fprintf (stdout, "\n");
- fflush (stdout);
- fprintf (stderr, "%s: no time on window 0x%x (%s %s).\n",
- progname, (unsigned int) window,
- hint.res_class, (v ? v : "???"));
- return -1;
- }
- }
-
- /* No need to read a response for these commands. */
- return 1;
- }
- else
- {
- XEvent event;
- long arg1 = (command == XA_SELECT ? argument : 0L);
- event.xany.type = ClientMessage;
- event.xclient.display = dpy;
- event.xclient.window = window;
- event.xclient.message_type = XA_SCREENSAVER;
- event.xclient.format = 32;
- memset (&event.xclient.data, 0, sizeof(event.xclient.data));
- event.xclient.data.l[0] = (long) command;
- event.xclient.data.l[1] = arg1;
- if (! XSendEvent (dpy, window, False, 0L, &event))
- {
- fprintf (stderr, "%s: XSendEvent(dpy, 0x%x ...) failed.\n",
- progname, (unsigned int) window);
- return -1;
- }
- }
- XSync (dpy, 0);
- return 0;
-}
-
-
-static XErrorHandler old_handler = 0;
-static Bool got_badwindow = False;
-static int
-BadWindow_ehandler (Display *dpy, XErrorEvent *error)
-{
- /* When we notice a window being created, we spawn a timer that waits
- 30 seconds or so, and then selects events on that window. This error
- handler is used so that we can cope with the fact that the window
- may have been destroyed <30 seconds after it was created.
- */
- if (error->error_code == BadWindow)
- {
- got_badwindow = True;
- return 0;
- }
- else
- {
- fprintf (stderr, "%s: ", progname);
- return (*old_handler) (dpy, error);
- }
-}
-
-
-static int
-xscreensaver_command_response (Display *dpy, Window window)
-{
- int fd = ConnectionNumber (dpy);
- int timeout = 10;
- int status;
- fd_set fds;
- struct timeval tv;
-
- while (1)
- {
- FD_ZERO(&fds);
- FD_SET(fd, &fds);
- memset(&tv, 0, sizeof(tv));
- tv.tv_sec = timeout;
- status = select (fd+1, &fds, 0, &fds, &tv);
-
- if (status < 0)
- {
- char buf[1024];
- sprintf (buf, "%s: waiting for reply", progname);
- perror (buf);
- return status;
- }
- else if (status == 0)
- {
- fprintf (stderr, "%s: no response to command.\n", progname);
- return -1;
- }
- else
- {
- XEvent event;
- XNextEvent (dpy, &event);
- switch (event.xany.type) {
- case PropertyNotify:
- if (event.xproperty.state == PropertyNewValue &&
- event.xproperty.atom == XA_SCREENSAVER_RESPONSE)
- {
- Status st2;
- Atom type;
- int format;
- unsigned long nitems, bytesafter;
- char *msg = 0;
-
- old_handler = XSetErrorHandler (BadWindow_ehandler);
- XSync (dpy, False);
-
- st2 = XGetWindowProperty (dpy, window,
- XA_SCREENSAVER_RESPONSE,
- 0, 1024, True,
- AnyPropertyType,
- &type, &format, &nitems, &bytesafter,
- (unsigned char **) &msg);
-
- if (got_badwindow)
- {
- fprintf (stdout,
- "%s: xscreensaver window has been deleted.\n",
- progname);
- return 0;
- }
-
- if (st2 == Success && type != None)
- {
- if (type != XA_STRING || format != 8)
- {
- fprintf (stderr,
- "%s: unrecognized response property.\n",
- progname);
- if (msg) XFree (msg);
- return -1;
- }
- else if (!msg || (msg[0] != '+' && msg[0] != '-'))
- {
- fprintf (stderr,
- "%s: unrecognized response message.\n",
- progname);
- if (msg) XFree (msg);
- return -1;
- }
- else
- {
- int ret = (msg[0] == '+' ? 0 : -1);
- fprintf ((ret < 0 ? stderr : stdout),
- "%s: %s\n",
- progname,
- msg+1);
- XFree (msg);
- return ret;
- }
- }
- }
- break;
-
- default:
- fprintf (stderr, "%s: got unexpected response event %d.\n",
- progname, event.xany.type);
- return -1;
- break;
- }
- }
- }
-}
-
-
-int
-xscreensaver_command (Display *dpy, Atom command, long argument)
-{
- Window w = 0;
- int status = send_xscreensaver_command (dpy, command, argument, &w);
- if (status == 0)
- status = xscreensaver_command_response (dpy, w);
- fflush (stdout);
- fflush (stderr);
- return status;
-}
-
-\f
-#ifdef STANDALONE
-static Atom XA_ACTIVATE, XA_DEACTIVATE, XA_CYCLE, XA_NEXT, XA_PREV;
-static Atom XA_EXIT, XA_RESTART, XA_DEMO, XA_PREFS, XA_LOCK;
-
-static char *progname;
static char *screensaver_version;
static char *usage = "\n\
usage: %s -<option>\n\
For updates, check http://www.jwz.org/xscreensaver/\n\
\n";
-#define USAGE() \
- { fprintf (stderr, usage, progname, screensaver_version); exit (1); }
+#define USAGE() do { \
+ fprintf (stderr, usage, progname, screensaver_version); exit (1); \
+ } while(0)
int
main (int argc, char **argv)
L = strlen (s);
if (L < 2) USAGE ();
if (!strncmp (s, "-display", L)) dpyname = argv [++i];
- else if (cmd) USAGE ()
+ else if (cmd) USAGE();
else if (!strncmp (s, "-activate", L)) cmd = &XA_ACTIVATE;
else if (!strncmp (s, "-deactivate", L)) cmd = &XA_DEACTIVATE;
else if (!strncmp (s, "-cycle", L)) cmd = &XA_CYCLE;
else if (!strncmp (s, "-time", L)) cmd = &XA_SCREENSAVER_TIME;
else USAGE ();
- if (cmd == &XA_SELECT)
+ if (cmd == &XA_SELECT || cmd == &XA_DEMO)
{
- char junk;
- i++;
- if (i >= argc ||
- (1 != sscanf(argv[i], " %ld %c", &arg, &junk)))
- USAGE ();
+ long a;
+ char c;
+ if (i+1 < argc && (1 == sscanf(argv[i+1], " %ld %c", &a, &c)))
+ {
+ arg = a;
+ i++;
+ }
}
}
+
if (!cmd)
USAGE ();
+ if (arg < 0)
+ /* no command may have a negative argument. */
+ USAGE();
+ else if (arg == 0)
+ {
+ /* SELECT must have a non-zero argument. */
+ if (cmd == &XA_SELECT)
+ USAGE();
+ }
+ else /* arg > 0 */
+ {
+ /* no command other than SELECT and DEMO may have a non-zero argument. */
+ if (cmd != &XA_DEMO && cmd != &XA_SELECT)
+ USAGE();
+ }
+
+
+
+ /* For backward compatibility: -demo with no arguments used to send a
+ "DEMO 0" ClientMessage to the xscreensaver process, which brought up
+ the built-in demo mode dialog. Now that the demo mode dialog is no
+ longer built in, we bring it up by just running the "xscreensaver-demo"
+ program.
+
+ Note that "-DEMO <n>" still sends a ClientMessage.
+ */
+ if (cmd == &XA_PREFS ||
+ (cmd == &XA_DEMO && arg == 0))
+ {
+ char buf [512];
+ char *new_argv[] = { "xscreensaver-demo", 0, 0, 0, 0, 0 };
+ int ac = 1;
+
+ if (dpyname)
+ {
+ new_argv[ac++] = "-display";
+ new_argv[ac++] = dpyname;
+ }
+
+ if (cmd == &XA_PREFS)
+ new_argv[ac++] = "-prefs";
+
+ fflush(stdout);
+ fflush(stderr);
+ execvp (new_argv[0], new_argv); /* shouldn't return */
+
+ sprintf (buf, "%s: could not exec %s", progname, new_argv[0]);
+ perror(buf);
+ fflush(stdout);
+ fflush(stderr);
+ exit (-1);
+ }
+
+
+
if (!dpyname) dpyname = (char *) getenv ("DISPLAY");
dpy = XOpenDisplay (dpyname);
if (!dpy)
XA_VROOT = XInternAtom (dpy, "__SWM_VROOT", False);
XA_SCREENSAVER = XInternAtom (dpy, "SCREENSAVER", False);
+ XA_SCREENSAVER_ID = XInternAtom (dpy, "_SCREENSAVER_ID", False);
XA_SCREENSAVER_VERSION = XInternAtom (dpy, "_SCREENSAVER_VERSION",False);
XA_SCREENSAVER_TIME = XInternAtom (dpy, "_SCREENSAVER_TIME", False);
XA_SCREENSAVER_RESPONSE = XInternAtom (dpy, "_SCREENSAVER_RESPONSE", False);
so if we're issuing an activation command, wait a second. */
sleep (1);
- i = xscreensaver_command (dpy, *cmd, arg);
+ i = xscreensaver_command (dpy, *cmd, arg, True);
if (i < 0) exit (i);
else exit (0);
}
-
-#endif /* STANDALONE */
.if n .sp 1
.if t .sp .5
..
-.TH XScreenSaver 1 "08-Oct-98 (2.34)" "X Version 11"
+.TH XScreenSaver 1 "24-Oct-98 (3.01)" "X Version 11"
.SH NAME
xscreensaver-command - control a running xscreensaver process
.SH SYNOPSIS
.BR xscreensaver (1)
has a client-server model: the xscreensaver process is a
-daemon that runs in the background; it is controlled by the
-foreground \fIxscreensaver-command\fP program.
+daemon that runs in the background; it is controlled by other
+foreground programs such as \fIxscreensaver-command\fP and
+.BR xscreensaver\-demo (1).
+
+This program, \fIxscreensaver-command\fP, is a command-line-oriented tool; the
+.BR xscreensaver\-demo (1).
+program is a graphical tool.
.SH OPTIONS
.I xscreensaver-command
accepts the following command-line options:
Prints a brief summary of command-line options.
.TP 8
.B \-demo
-Cause the screensaver to enter its interactive demo mode, in which one
-can experiment with the various graphics hacks available. See
+This just launches the
+.BR xscreensaver\-demo (1)
+program, in which one can experiment with the various graphics hacks
+available, and edit parameters.
+.TP 8
+.B \-demo \fP\fInumber\fP
+When the \fI\-demo\fP option is followed by an integer, it instructs
+the \fIxscreensaver\fP daemon to run that hack, and wait for the user
+to click the mouse before deactivating (i.e., mouse motion does not
+deactivate.) This is the mechanism by which
+.BR xscreensaver\-demo (1)
+communicates with the
.BR xscreensaver (1)
-for details.
+daemon. (The first hack in the list is numbered 1, not 0.)
.TP 8
.B \-prefs
-Cause the screensaver to enter its interactive demo mode, and bring up
-the Preferences control panel, in which one can change most of the settings
-that control the xscreensaver daemon's behavior. See
-.BR xscreensaver (1)
-for details.
+Like the no-argument form of \fI\-demo\fP, but brings up that program's
+Preferences panel by default.
.TP 8
.B \-activate
Tell xscreensaver to turn on immediately (that is, blank the screen, as if
.EX
sleep 5 ; xscreensaver-command -activate
.EE
-to be sure that you have time to remove your hand from the mouse before
+to be sure that you have time to take your hand off the mouse before
the screensaver comes on. (Because if you jiggle the mouse, xscreensaver
will notice, and deactivate.)
.TP 8
things in an inconsistent state, and you may need to restart your window
manager to repair the damage.
.TP 8
-.B \-restart
-Causes the screensaver process to exit and then restart with the same command
-line arguments as last time. Do this after you've changed the resource
-database, to cause xscreensaver to notice the changes.
-
-If the screensaver is run from \fIxdm(1)\fP (that is, it is already running
-before you log in) then you may want to issue the \fI\-restart\fP command from
-one of your startup scripts, so that the screensaver gets your resource
-settings instead of the default ones.
-.TP 8
.B \-lock
Tells the running xscreensaver process to lock the screen immediately.
This is like \fI\-activate\fP, but forces locking as well, even if locking
is not the default (that is, even if xscreensaver's \fIlock\fP resource is
false, and even if the \fIlockTimeout\fP resource is non-zero.)
+
+Note that locking doesn't work unless the \fIxscreensaver\fP process is
+running as you. See
+.BR xscreensaver (1)
+for details.
.TP 8
.B \-version
Prints the version of xscreensaver that is currently running on the display:
deactivated (roughly, how long the user has been idle or non-idle: but
not quite, since it only tells you when the screen became blanked or
un-blanked.)
+.TP 8
+.B \-restart
+Causes the screensaver process to exit and then restart with the same command
+line arguments as last time. Do this after you've changed the resource
+database, to cause xscreensaver to notice the changes.
+
+.B Warning:
+if you have a \fI.xscreensaver\fP file, this might not do what you
+expect. You're probably better off killing the existing
+xscreensaver (with \fIxscreensaver\-command -exit\fP) and then
+launching it again.
+
+The important point is, you need to make sure that the xscreensaver
+process is running as you. If it's not, it won't be reading the
+right \fI.xscreensaver\fP file.
.SH DIAGNOSTICS
If an error occurs while communicating with the \fIxscreensaver\fP daemon, or
if the daemon reports an error, a diagnostic message will be printed to
.SH UPGRADES
The latest version of
.BR xscreensaver (1)
-and \fIxscreensaver\-command\fP can always be found at
-http://www.jwz.org/xscreensaver/
+and related tools can always be found at http://www.jwz.org/xscreensaver/
.SH "SEE ALSO"
.BR X (1),
.BR xscreensaver (1)
+.BR xscreensaver\-demo (1)
.SH COPYRIGHT
Copyright \(co 1992, 1993, 1997, 1998
by Jamie Zawinski. Permission to use, copy, modify, distribute, and sell
--- /dev/null
+.de EX \"Begin example
+.ne 5
+.if n .sp 1
+.if t .sp .5
+.nf
+.in +.5i
+..
+.de EE
+.fi
+.in -.5i
+.if n .sp 1
+.if t .sp .5
+..
+.TH XScreenSaver 1 "24-Oct-98 (3.01)" "X Version 11"
+.SH NAME
+xscreensaver-demo - interactively control the background xscreensaver daemon
+.SH SYNOPSIS
+.B xscreensaver\-demo
+[\-display \fIhost:display.screen\fP] [\-prefs] [\-xrm \fIresources\fP]
+.SH DESCRIPTION
+The \fIxscreensaver\-demo\fP program is a graphical front-end for
+setting the parameters used by the background
+.BR xscreensaver (1)
+daemon.
+It is essentially two things: a tool for editing the \fI~/.xscreensaver\fP
+file; and a tool for demoing the various graphics hacks that
+the \fIxscreensaver\fP daemon will launch.
+
+The main dialog box contains a scrolling list, a text field, and a number
+of buttons.
+
+Double-clicking on one of the programs in the list will run it. The screen
+will go black, and the program will run in full-screen mode, just as it would
+if the \fIxscreensaver\fP daemon had launched it. Clicking the mouse again
+will stop the demo and un-blank the screen, making the dialog box visible
+again.
+
+Single-clicking in the list will place the indicated program and its args
+in the text field to be edited. Edit the arguments and hit return to run
+the program with the parameters you have specified. This will also save
+your changes to your \fI~/.xscreensaver\fP file: so any changes you make
+in this way are persistent.
+
+If one of the lines in the scrolling list begins with the character "-",
+then that means that the program is disabled: \fIxscreensaver\fP will not
+select it to be run (though you can still try it out by clicking on it.)
+Rather than just deleting the programs you don't want to run, you might
+want to disable them in this way instead, so that you can more easily change
+your mind later.
+
+If the line begins with the name of a visual, followed by a colon, then
+that program will only be run on that kind of visual. For example, you can
+specify that a particular program should only be run if color is available,
+and another should only be run in monochrome. See the discussion of
+the \fIprograms\fP parameter in the \fIConfiguration\fP section of the
+.BR xscreensaver (1)
+manual.
+
+The buttons are:
+.TP 8
+.B Run Next
+Clicking this button will run the next program in the list after the
+currently-selected one, and will wrap around to the top when it reaches
+the bottom.
+.TP 8
+.B Run Previous
+Opposite of Run Next; at the top, it wraps around to the bottom.
+.TP 8
+.B Preferences
+This pops up a second dialog box, in which you have the option to
+interactively change most of the screensaver's operational parameters,
+such as its timeouts, and whether it should lock the screen. When you
+click OK, your chosen settings will take effect immediately, and will
+also be saved to the \fI~/.xscreensaver\fP file in your home directory,
+so that the settings will persist next time.
+.TP 8
+.B Quit
+Exits the \fIxscreensaver-demo\fP program. The background \fIxscreensaver\fP
+daemon will continue running as before.
+.BR xscreensaver\-command (1).
+
+.P
+The Preferences dialog box lets you change the following settings.
+
+(There are more settings available, but these are the most commonly used
+ones; see the manual for
+.BR xscreensaver (1)
+for other parameters that can be set by editing the \fI~/.xscreensaver\fP
+file, or the X resource database.)
+.TP 8
+.B Saver Timeout
+After the user has been idle this long, the \fIxscreensaver\fP daemon
+will blank the screen.
+.TP 8
+.B Cycle Timeout
+After the screensaver has been running for this long, the currently
+running graphics demo will be killed, and a new one started.
+If this is 0, then the graphics demo will never be changed:
+only one demo will run until the screensaver is deactivated by user
+activity.
+.TP 8
+.B Verbose\
+Whether to print lots of debugging information.
+.TP 8
+.B Install Colormap
+Whether to install a private colormap while the screensaver is active, so
+that the graphics hacks can get as many colors as possible. (This only
+applies when the screen's default visual is being used, since non-default
+visuals get their own colormaps automatically.) This can also be overridden
+on a per-demo basis.
+.TP 8
+.B Fade Colormap
+If selected, then when the screensaver activates, the current contents
+of the screen will fade to black instead of simply winking out. This only
+works on displays with writable colormaps, that is, if the screen's default
+visual is a PseudoColor visual. A fade will also be done when
+switching graphics hacks (when the \fICycle Timeout\fP expires.)
+.TP 8
+.B Unfade Colormap
+The complement to \fIFade Colormap\fP: if selected, then when the screensaver
+deactivates, the original contents of the screen will fade in from black
+instead of appearing immediately. This only works on displays with writable
+colormaps, and when \fIFade Colormap\fP is also selected.
+.TP 8
+.B Fade Duration
+When fading or unfading are selected, this controls how long the fade will
+take.
+.TP 8
+.B Fade Ticks
+This controls how many times a second the colormap will be changed to
+effect a fade. Higher numbers yield smoother fades, but may make the
+fades take longer than the specified number of seconds, if your server
+isn't fast enough to keep up.
+.TP 8
+.B Require Password
+Whether the screen saver should lock the screen when it activates.
+.TP 8
+.B Lock Timeout
+If \fIRequire Password\fP is selected, this controls the length of
+the ``grace period'' between when the screensaver activates, and when the
+screen becomes locked. For example, if this is 0:05:00,
+and \fISaver Timeout\fP is 0:10:00, then after 10 minutes, the screen
+would blank. If there was user activity at 12 minutes, no password
+would be required to un-blank the screen. But, if there was user activity
+at 15 minutes or later (that is, \fILock Timeout\fP minutes after
+activation) then a password would be required. The default is 0, meaning
+that if locking is enabled, then a password will be required as soon as the
+screen blanks.
+.TP 8
+.B Password Timeout
+When the screensaver is prompting for a password, the prompt dialog box will
+stay on the screen for this long before giving up, and reverting to
+screen-saving mode.
+.SH COMMAND-LINE OPTIONS
+.I xscreensaver\-demo
+accepts the following command line options.
+.TP 8
+.B \-display \fIhost:display.screen\fP
+The X display to use. The \fIxscreensaver\-demo\fP program will control
+the \fIxscreensaver\fP daemon that is running on that same display.
+
+It's important that the \fIxscreensaver\fP and \fIxscreensaver\-demo\fP
+processes be running on the same machine, or at least, on two machines
+that share a file system: when \fIxscreensaver\-demo\fP writes a new version
+of the \fI~/.xscreensaver\fP file, it's important that the \fIxscreensaver\fP
+see that same file. If the two processes are seeing
+different \fI~/.xscreensaver\fP files, things will malfunction.
+.TP 8
+.B \-prefs
+Start up in Preferences mode: this is just like launching the program with
+no arguments, and then pressing the \fIPreferences\fP button.
+.SH ENVIRONMENT
+.PP
+.TP 8
+.B DISPLAY
+to get the default host and display number. See the comments about
+the \fI\-display\fP command-line option above.
+.TP 8
+.B PATH
+to find the sub-programs to run. However, note that the sub-programs
+are actually launched by the \fIxscreensaver\fP daemon, not
+by \fIxscreensaver-demo\fP itself. So, what matters is what \fB$PATH\fP
+the \fIxscreensaver\fP program sees.
+.TP 8
+.B HOME
+for the directory in which to read and write the \fI.xscreensaver\fP file.
+.TP 8
+.B XENVIRONMENT
+to get the name of a resource file that overrides the global resources
+stored in the RESOURCE_MANAGER property.
+.SH UPGRADES
+The latest version can always be found at
+http://www.jwz.org/xscreensaver/
+.SH SEE ALSO
+.BR X (1),
+.BR xscreensaver (1),
+.BR xscreensaver\-command (1)
+.SH COPYRIGHT
+Copyright \(co 1992, 1993, 1997, 1998
+by Jamie Zawinski. Permission to use, copy, modify, distribute, and sell
+this software and its documentation for any purpose is hereby granted without
+fee, provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in supporting
+documentation. No representations are made about the suitability of this
+software for any purpose. It is provided "as is" without express or implied
+warranty.
+.SH AUTHOR
+Jamie Zawinski <jwz@jwz.org>, 13-aug-92.
+
+Please let me know if you find any bugs or make any improvements.
{ "-cycle", ".cycle", XrmoptionSepArg, 0 },
{ "-lock-mode", ".lock", XrmoptionNoArg, "on" },
{ "-no-lock-mode", ".lock", XrmoptionNoArg, "off" },
+ { "-no-lock", ".lock", XrmoptionNoArg, "off" },
{ "-lock-timeout", ".lockTimeout", XrmoptionSepArg, 0 },
{ "-lock-vts", ".lockVTs", XrmoptionNoArg, "on" },
{ "-no-lock-vts", ".lockVTs", XrmoptionNoArg, "off" },
See the manual for other options and X resources.\n\
\n\
The `xscreensaver' program should be left running in the background.\n\
-Use the `xscreensaver-command' program to manipulate a running xscreensaver.\n\
+Use the `xscreensaver-demo' and `xscreensaver-command' programs to\n\
+manipulate a running xscreensaver.\n\
\n\
The `*programs' resource controls which graphics demos will be launched by\n\
the screensaver. See `man xscreensaver' or the web page for more details.\n\
Just getting started? Try this:\n\
\n\
xscreensaver &\n\
- xscreensaver-command -demo\n\
+ xscreensaver-demo\n\
\n\
For updates, check http://www.jwz.org/xscreensaver/\n\
\n",
/* The zillions of initializations.
*/
-static void get_screenhacks (saver_info *si);
-
-
-
/* Set progname, version, etc. This is done very early.
*/
static void
argc, argv, defaults, 0, 0);
si->dpy = XtDisplay (toplevel_shell);
- si->db = XtDatabase (si->dpy);
+ si->prefs.db = XtDatabase (si->dpy);
XtGetApplicationNameAndClass (si->dpy, &progname, &progclass);
if(strlen(progname) > 100) /* keep it short. */
progname [99] = 0;
- db = si->db; /* resources.c needs this */
+ db = si->prefs.db; /* resources.c needs this */
XA_VROOT = XInternAtom (si->dpy, "__SWM_VROOT", False);
XA_SCREENSAVER = XInternAtom (si->dpy, "SCREENSAVER", False);
/* no resource for this one, out of paranoia. */
si->prefs.debug_p = True;
- else if (!strcmp (argv[i], "-initial-demo-mode"))
- /* This isn't an advertized option; it is used internally to implement
- the "Reinitialize" button on the Demo Mode window. */
- si->demo_mode_p = True;
-
else if (!strcmp (argv[i], "-h") ||
!strcmp (argv[i], "-help") ||
!strcmp (argv[i], "--help"))
!strcmp (s, "-version") ||
!strcmp (s, "-time"))
{
- fprintf (stderr, "\n\
- However, %s is an option to the `xscreensaver-command' program.\n\
+
+ if (!strcmp (s, "-demo") || !strcmp (s, "-prefs"))
+ fprintf (stderr, "\n\
+ Perhaps you meant to run the `xscreensaver-demo' program instead?\n");
+ else
+ fprintf (stderr, "\n\
+ However, `%s' is an option to the `xscreensaver-command' program.\n", s);
+
+ fprintf (stderr, "\
The `xscreensaver' program is a daemon that runs in the background.\n\
You control a running xscreensaver process by sending it messages\n\
- with `xscreensaver-command'. See the man pages for details,\n\
- or check the web page: http://www.jwz.org/xscreensaver/\n\n",
- s);
+ with `xscreensaver-demo' or `xscreensaver-command'.\n\
+. See the man pages for details, or check the web page:\n\
+ http://www.jwz.org/xscreensaver/\n\n");
/* Since version 1.21 renamed the "-lock" option to "-lock-mode",
suggest that explicitly. */
Or perhaps you meant either the \"-lock-mode\" or the\n\
\"-lock-timeout <minutes>\" options to xscreensaver?\n\n");
}
+
exit (1);
}
}
if (p->verbose_p)
fprintf (stderr,
- "%s %s, copyright (c) 1991-1998 by Jamie Zawinski <jwz@jwz.org>\n"
- " pid = %d.\n",
- blurb(), si->version, (int) getpid ());
+ "%s %s, copyright (c) 1991-1998 "
+ "by Jamie Zawinski <jwz@jwz.org>.\n",
+ progname, si->version);
if (p->debug_p)
fprintf (stderr, "\n"
blurb(), si->orig_uid);
fprintf (stderr, "%s: %s\n", blurb(), si->uid_message);
}
+
+ fprintf (stderr, "%s: in process %lu.\n", blurb(),
+ (unsigned long) getpid());
}
/* If locking was not able to be initalized for some reason, explain why.
}
}
- si->fading_possible_p = found_any_writable_cells;
-}
-
-
-/* Populate `saver_preferences' with the contents of the resource database.
- Note that this may be called multiple times -- it is re-run each time
- the ~/.xscreensaver file is reloaded.
-
- This function can be very noisy, since it issues resource syntax errors
- and so on.
- */
-void
-get_resources (saver_info *si)
-{
- char *s;
- saver_preferences *p = &si->prefs;
-
- if (si->init_file_date == 0)
- /* The date will be 0 the first time this is called; and when this is
- called subsequent times, the file will have already been reloaded. */
- read_init_file (si);
-
- p->xsync_p = get_boolean_resource ("synchronous", "Synchronous");
- if (p->xsync_p)
- XSynchronize(si->dpy, True);
-
- p->verbose_p = get_boolean_resource ("verbose", "Boolean");
- p->timestamp_p = get_boolean_resource ("timestamp", "Boolean");
- p->lock_p = get_boolean_resource ("lock", "Boolean");
- p->lock_vt_p = get_boolean_resource ("lockVTs", "Boolean");
- p->fade_p = get_boolean_resource ("fade", "Boolean");
- p->unfade_p = get_boolean_resource ("unfade", "Boolean");
- p->fade_seconds = 1000 * get_seconds_resource ("fadeSeconds", "Time");
- p->fade_ticks = get_integer_resource ("fadeTicks", "Integer");
- p->install_cmap_p = get_boolean_resource ("installColormap", "Boolean");
- p->nice_inferior = get_integer_resource ("nice", "Nice");
-
- p->initial_delay = 1000 * get_seconds_resource ("initialDelay", "Time");
- p->splash_duration = 1000 * get_seconds_resource ("splashDuration", "Time");
- p->timeout = 1000 * get_minutes_resource ("timeout", "Time");
- p->lock_timeout = 1000 * get_minutes_resource ("lockTimeout", "Time");
- p->cycle = 1000 * get_minutes_resource ("cycle", "Time");
- p->passwd_timeout = 1000 * get_seconds_resource ("passwdTimeout", "Time");
- p->pointer_timeout = 1000 * get_seconds_resource ("pointerPollTime", "Time");
- p->notice_events_timeout = 1000*get_seconds_resource("windowCreationTimeout",
- "Time");
- p->shell = get_string_resource ("bourneShell", "BourneShell");
-
- p->help_url = get_string_resource("helpURL", "URL");
- p->load_url_command = get_string_resource("loadURL", "LoadURL");
-
- if ((s = get_string_resource ("splash", "Boolean")))
- if (!get_boolean_resource("splash", "Boolean"))
- p->splash_duration = 0;
- if (s) free (s);
-
- if (p->verbose_p && !si->fading_possible_p && (p->fade_p || p->unfade_p))
- {
- fprintf (stderr,
- (si->nscreens == 1
- ? "%s: the screen has no PseudoColor or GrayScale visuals.\n"
- : "%s: no screens have PseudoColor or GrayScale visuals.\n"),
- blurb());
- fprintf (stderr, "%s: ignoring the request for fading/unfading.\n",
- blurb());
- }
-
- /* don't set use_xidle_extension unless it is explicitly specified */
- if ((s = get_string_resource ("xidleExtension", "Boolean")))
- p->use_xidle_extension = get_boolean_resource ("xidleExtension","Boolean");
- else
-#ifdef HAVE_XIDLE_EXTENSION /* pick a default */
- p->use_xidle_extension = True; /* if we have it, use it */
-#else /* !HAVE_XIDLE_EXTENSION */
- p->use_xidle_extension = False;
-#endif /* !HAVE_XIDLE_EXTENSION */
- if (s) free (s);
-
- /* don't set use_mit_extension unless it is explicitly specified */
- if ((s = get_string_resource ("mitSaverExtension", "Boolean")))
- p->use_mit_saver_extension = get_boolean_resource ("mitSaverExtension",
- "Boolean");
- else
-#ifdef HAVE_MIT_SAVER_EXTENSION /* pick a default */
- p->use_mit_saver_extension = False; /* Default false, because it sucks */
-#else /* !HAVE_MIT_SAVER_EXTENSION */
- p->use_mit_saver_extension = False;
-#endif /* !HAVE_MIT_SAVER_EXTENSION */
- if (s) free (s);
-
-
- /* don't set use_mit_extension unless it is explicitly specified */
- if ((s = get_string_resource ("sgiSaverExtension", "Boolean")))
- p->use_sgi_saver_extension = get_boolean_resource ("sgiSaverExtension",
- "Boolean");
- else
-#ifdef HAVE_SGI_SAVER_EXTENSION /* pick a default */
- p->use_sgi_saver_extension = True; /* if we have it, use it */
-#else /* !HAVE_SGI_SAVER_EXTENSION */
- p->use_sgi_saver_extension = False;
-#endif /* !HAVE_SGI_SAVER_EXTENSION */
- if (s) free (s);
-
-
- /* Throttle the various timeouts to reasonable values.
- */
- if (p->passwd_timeout == 0) p->passwd_timeout = 30000; /* 30 secs */
- if (p->timeout < 10000) p->timeout = 10000; /* 10 secs */
- if (p->cycle != 0 && p->cycle < 2000) p->cycle = 2000; /* 2 secs */
- if (p->pointer_timeout == 0) p->pointer_timeout = 5000; /* 5 secs */
- if (p->notice_events_timeout == 0)
- p->notice_events_timeout = 10000; /* 10 secs */
- if (p->fade_seconds == 0 || p->fade_ticks == 0)
- p->fade_p = False;
- if (! p->fade_p) p->unfade_p = False;
-
- p->watchdog_timeout = p->cycle;
- if (p->watchdog_timeout < 30000) p->watchdog_timeout = 30000; /* 30 secs */
- if (p->watchdog_timeout > 3600000) p->watchdog_timeout = 3600000; /* 1 hr */
-
- get_screenhacks (si);
-
- if (p->debug_p)
- {
- XSynchronize(si->dpy, True);
- p->xsync_p = True;
- p->verbose_p = True;
- p->timestamp_p = True;
- p->initial_delay = 0;
- }
-
- blurb_timestamp_p = p->timestamp_p;
+ si->prefs.fading_possible_p = found_any_writable_cells;
}
{
saver_preferences *p = &si->prefs;
- if (p->use_sgi_saver_extension)
- {
+ Bool server_has_xidle_extension_p = False;
+ Bool server_has_sgi_saver_extension_p = False;
+ Bool server_has_mit_saver_extension_p = False;
+
+#ifdef HAVE_XIDLE_EXTENSION
+ server_has_xidle_extension_p = query_xidle_extension (si);
+#endif
#ifdef HAVE_SGI_SAVER_EXTENSION
- if (! query_sgi_saver_extension (si))
- {
- fprintf (stderr,
- "%s: display %s does not support the SGI SCREEN_SAVER extension.\n",
- blurb(), DisplayString (si->dpy));
- p->use_sgi_saver_extension = False;
- }
- else if (p->use_mit_saver_extension)
- {
- fprintf (stderr,
- "%s: SGI SCREEN_SAVER extension used instead"
- " of MIT-SCREEN-SAVER extension.\n",
- blurb());
- p->use_mit_saver_extension = False;
- }
- else if (p->use_xidle_extension)
- {
- fprintf (stderr,
- "%s: SGI SCREEN_SAVER extension used instead of XIDLE extension.\n",
- blurb());
- p->use_xidle_extension = False;
- }
-#else /* !HAVE_MIT_SAVER_EXTENSION */
- fprintf (stderr,
- "%s: not compiled with support for the SGI SCREEN_SAVER"
- " extension.\n",
- blurb());
- p->use_sgi_saver_extension = False;
-#endif /* !HAVE_SGI_SAVER_EXTENSION */
- }
+ server_has_sgi_saver_extension_p = query_sgi_saver_extension (si);
+#endif
+#ifdef HAVE_MIT_SAVER_EXTENSION
+ server_has_mit_saver_extension_p = query_mit_saver_extension (si);
+#endif
- if (p->use_mit_saver_extension)
+ if (!server_has_xidle_extension_p)
+ p->use_xidle_extension = False;
+ else if (p->verbose_p)
{
-#ifdef HAVE_MIT_SAVER_EXTENSION
- if (! query_mit_saver_extension (si))
- {
- fprintf (stderr,
- "%s: display %s does not support the MIT-SCREEN-SAVER"
- " extension.\n",
- blurb(), DisplayString (si->dpy));
- p->use_mit_saver_extension = False;
- }
- else if (p->use_xidle_extension)
- {
- fprintf (stderr,
- "%s: MIT-SCREEN-SAVER extension used instead of XIDLE"
- " extension.\n",
- blurb());
- p->use_xidle_extension = False;
- }
-#else /* !HAVE_MIT_SAVER_EXTENSION */
- fprintf (stderr,
- "%s: not compiled with support for the MIT-SCREEN-SAVER"
- " extension.\n",
- blurb());
- p->use_mit_saver_extension = False;
-#endif /* !HAVE_MIT_SAVER_EXTENSION */
+ if (p->use_xidle_extension)
+ fprintf (stderr, "%s: using XIDLE extension.\n", blurb());
+ else
+ fprintf (stderr, "%s: not using server's XIDLE extension.\n", blurb());
}
- if (p->use_xidle_extension)
+ if (!server_has_sgi_saver_extension_p)
+ p->use_sgi_saver_extension = False;
+ else if (p->verbose_p)
{
-#ifdef HAVE_XIDLE_EXTENSION
- int first_event, first_error;
- if (! XidleQueryExtension (si->dpy, &first_event, &first_error))
- {
- fprintf (stderr,
- "%s: display %s does not support the XIdle extension.\n",
- blurb(), DisplayString (si->dpy));
- p->use_xidle_extension = False;
- }
-#else /* !HAVE_XIDLE_EXTENSION */
- fprintf (stderr, "%s: not compiled with support for XIdle.\n", blurb());
- p->use_xidle_extension = False;
-#endif /* !HAVE_XIDLE_EXTENSION */
+ if (p->use_sgi_saver_extension)
+ fprintf (stderr, "%s: using SGI SCREEN_SAVER extension.\n", blurb());
+ else
+ fprintf (stderr,
+ "%s: not using server's SGI SCREEN_SAVER extension.\n",
+ blurb());
}
- if (p->verbose_p && p->use_mit_saver_extension)
- fprintf (stderr, "%s: using MIT-SCREEN-SAVER server extension.\n",
- blurb());
- if (p->verbose_p && p->use_sgi_saver_extension)
- fprintf (stderr, "%s: using SGI SCREEN_SAVER server extension.\n",
- blurb());
- if (p->verbose_p && p->use_xidle_extension)
- fprintf (stderr, "%s: using XIdle server extension.\n",
- blurb());
+ if (!server_has_mit_saver_extension_p)
+ p->use_mit_saver_extension = False;
+ else if (p->verbose_p)
+ {
+ if (p->use_mit_saver_extension)
+ fprintf (stderr, "%s: using lame MIT-SCREEN-SAVER extension.\n",
+ blurb());
+ else
+ fprintf (stderr,
+ "%s: not using server's lame MIT-SCREEN-SAVER extension.\n",
+ blurb());
+ }
}
p->use_sgi_saver_extension)
return;
- if (p->initial_delay && !si->demo_mode_p)
+ if (p->initial_delay)
{
if (p->verbose_p)
{
}
+void
+maybe_reload_init_file (saver_info *si)
+{
+ saver_preferences *p = &si->prefs;
+ if (init_file_changed_p (p))
+ {
+ if (p->verbose_p)
+ fprintf (stderr, "%s: file \"%s\" has changed, reloading.\n",
+ blurb(), init_file_name());
+
+ load_init_file (p);
+
+ /* If a server extension is in use, and p->timeout has changed,
+ we need to inform the server of the new timeout. */
+ disable_builtin_screensaver (si, False);
+ }
+}
+
+
/* Loop forever:
- wait until the user is idle;
main_loop (saver_info *si)
{
saver_preferences *p = &si->prefs;
+ Bool ok_to_unblank;
+
while (1)
{
- if (! si->demo_mode_p)
- sleep_until_idle (si, True);
+ sleep_until_idle (si, True);
+
+ if (p->verbose_p)
+ {
+ if (si->demoing_p)
+ fprintf (stderr, "%s: demoing %d at %s.\n", blurb(),
+ si->selection_mode, timestring());
+ else
+ if (p->verbose_p)
+ fprintf (stderr, "%s: blanking screen at %s.\n", blurb(),
+ timestring());
+ }
maybe_reload_init_file (si);
-#ifndef NO_DEMO_MODE
- if (si->demo_mode_p)
- demo_mode (si);
- else
-#endif /* !NO_DEMO_MODE */
- {
- if (p->verbose_p)
- fprintf (stderr, "%s: user is idle; waking up at %s.\n", blurb(),
- timestring());
- maybe_reload_init_file (si);
- blank_screen (si);
- spawn_screenhack (si, True);
- if (p->cycle)
- si->cycle_id = XtAppAddTimeOut (si->app, p->cycle, cycle_timer,
- (XtPointer) si);
+ blank_screen (si);
+ kill_screenhack (si);
+ spawn_screenhack (si, True);
+
+ /* Don't start the cycle timer in demo mode. */
+ if (!si->demoing_p && p->cycle)
+ si->cycle_id = XtAppAddTimeOut (si->app, p->cycle, cycle_timer,
+ (XtPointer) si);
+
#ifndef NO_LOCKING
- if (p->lock_p &&
- !si->locking_disabled_p &&
- p->lock_timeout == 0)
- si->locked_p = True;
-
- if (p->lock_p && !si->locked_p)
- /* locked_p might be true already because of ClientMessage */
- si->lock_id = XtAppAddTimeOut (si->app, p->lock_timeout,
- activate_lock_timer,
- (XtPointer) si);
+ if (!si->demoing_p && /* if not going into demo mode */
+ p->lock_p && /* and locking is enabled */
+ !si->locking_disabled_p && /* and locking is possible */
+ p->lock_timeout == 0) /* and locking is not timer-deferred */
+ si->locked_p = True; /* then lock right now. */
+
+ /* locked_p might be true already because of the above, or because of
+ the LOCK ClientMessage. But if not, and if we're supposed to lock
+ after some time, set up a timer to do so.
+ */
+ if (p->lock_p &&
+ !si->locked_p &&
+ p->lock_timeout > 0)
+ si->lock_id = XtAppAddTimeOut (si->app, p->lock_timeout,
+ activate_lock_timer,
+ (XtPointer) si);
#endif /* !NO_LOCKING */
- PASSWD_INVALID:
- sleep_until_idle (si, False); /* until not idle */
- maybe_reload_init_file (si);
+ ok_to_unblank = True;
+ do {
+
+ sleep_until_idle (si, False); /* until not idle */
+ maybe_reload_init_file (si);
#ifndef NO_LOCKING
- if (si->locked_p)
- {
- Bool val;
- if (si->locking_disabled_p) abort ();
- si->dbox_up_p = True;
-
- {
- saver_screen_info *ssi = si->default_screen;
- suspend_screenhack (si, True);
- XUndefineCursor (si->dpy, ssi->screensaver_window);
- if (p->verbose_p)
- fprintf (stderr, "%s: prompting for password.\n", blurb());
- val = unlock_p (si);
- if (p->verbose_p && val == False)
- fprintf (stderr, "%s: password incorrect!\n", blurb());
- si->dbox_up_p = False;
- XDefineCursor (si->dpy, ssi->screensaver_window, ssi->cursor);
- suspend_screenhack (si, False);
- }
-
- if (! val)
- goto PASSWD_INVALID;
- si->locked_p = False;
- }
+ if (si->locked_p)
+ {
+ saver_screen_info *ssi = si->default_screen;
+ if (si->locking_disabled_p) abort ();
+
+ si->dbox_up_p = True;
+ suspend_screenhack (si, True);
+ XUndefineCursor (si->dpy, ssi->screensaver_window);
+
+ ok_to_unblank = unlock_p (si);
+
+ si->dbox_up_p = False;
+ XDefineCursor (si->dpy, ssi->screensaver_window, ssi->cursor);
+ suspend_screenhack (si, False); /* resume */
+ }
#endif /* !NO_LOCKING */
- if (p->verbose_p)
- fprintf (stderr, "%s: user is active at %s.\n",
- blurb(), timestring ());
+ } while (!ok_to_unblank);
- /* Let's kill it before unblanking, to get it to stop drawing as
- soon as possible... */
- kill_screenhack (si);
- unblank_screen (si);
- si->selection_mode = 0;
- if (si->cycle_id)
- {
- XtRemoveTimeOut (si->cycle_id);
- si->cycle_id = 0;
- }
+ if (p->verbose_p)
+ fprintf (stderr, "%s: unblanking screen at %s.\n",
+ blurb(), timestring ());
-#ifndef NO_LOCKING
- if (si->lock_id)
- {
- XtRemoveTimeOut (si->lock_id);
- si->lock_id = 0;
- }
-#endif /* !NO_LOCKING */
+ /* Kill before unblanking, to stop drawing as soon as possible. */
+ kill_screenhack (si);
+ unblank_screen (si);
+
+ si->locked_p = False;
+ si->demoing_p = 0;
+ si->selection_mode = 0;
+
+ if (si->cycle_id)
+ {
+ XtRemoveTimeOut (si->cycle_id);
+ si->cycle_id = 0;
+ }
- if (p->verbose_p)
- fprintf (stderr, "%s: going to sleep.\n", blurb());
+ if (si->lock_id)
+ {
+ XtRemoveTimeOut (si->lock_id);
+ si->lock_id = 0;
}
+
+ if (p->verbose_p)
+ fprintf (stderr, "%s: awaiting idleness.\n", blurb());
}
}
+static void analyze_display (saver_info *si);
int
main (int argc, char **argv)
Widget shell;
saver_info the_si;
saver_info *si = &the_si;
+ saver_preferences *p = &si->prefs;
int i;
memset(si, 0, sizeof(*si));
srandom ((int) time ((time_t *) 0));
- set_version_string (si, &argc, argv);
save_argv (argc, argv);
+ set_version_string (si, &argc, argv);
privileged_initialization (si, &argc, argv);
hack_environment (si);
shell = connect_to_server (si, &argc, argv);
process_command_line (si, &argc, argv);
print_banner (si);
- initialize_per_screen_info (si, shell);
- get_resources (si);
+
+ initialize_per_screen_info (si, shell); /* also sets p->fading_possible_p */
for (i = 0; i < si->nscreens; i++)
if (ensure_no_screensaver_running (si->dpy, si->screens[i].screen))
exit (1);
+ load_init_file (p);
+
+ if (p->xsync_p) XSynchronize (si->dpy, True);
+ blurb_timestamp_p = p->timestamp_p; /* kludge */
+
+ if (p->verbose_p) analyze_display (si);
initialize_server_extensions (si);
initialize_screensaver_window (si);
select_events (si);
disable_builtin_screensaver (si, True);
initialize_stderr (si);
- if (!si->demo_mode_p)
- make_splash_dialog (si);
+ make_splash_dialog (si);
main_loop (si); /* doesn't return */
return 0;
}
-\f
-/* Parsing the programs resource.
- */
-
-static char *
-reformat_hack (const char *hack)
-{
- int i;
- const char *in = hack;
- int indent = 13;
- char *h2 = (char *) malloc(strlen(in) + indent + 2);
- char *out = h2;
-
- while (isspace(*in)) in++; /* skip whitespace */
- while (*in && !isspace(*in) && *in != ':')
- *out++ = *in++; /* snarf first token */
- while (isspace(*in)) in++; /* skip whitespace */
-
- if (*in == ':')
- *out++ = *in++; /* copy colon */
- else
- {
- in = hack;
- out = h2; /* reset to beginning */
- }
-
- *out = 0;
-
- while (isspace(*in)) in++; /* skip whitespace */
- for (i = strlen(h2); i < indent; i++) /* indent */
- *out++ = ' ';
-
- /* copy the rest of the line. */
- while (*in)
- {
- /* shrink all whitespace to one space, for the benefit of the "demo"
- mode display. We only do this when we can easily tell that the
- whitespace is not significant (no shell metachars).
- */
- switch (*in)
- {
- case '\'': case '"': case '`': case '\\':
- {
- /* Metachars are scary. Copy the rest of the line unchanged. */
- while (*in)
- *out++ = *in++;
- }
- break;
- case ' ': case '\t':
- {
- while (*in == ' ' || *in == '\t')
- in++;
- *out++ = ' ';
- }
- break;
- default:
- *out++ = *in++;
- break;
- }
- }
- *out = 0;
-
- /* strip trailing whitespace. */
- out = out-1;
- while (out > h2 && (*out == ' ' || *out == '\t' || *out == '\n'))
- *out-- = 0;
-
- return h2;
-}
-
-
-static void
-get_screenhacks (saver_info *si)
-{
- saver_preferences *p = &si->prefs;
- int i = 0;
- int start = 0;
- int end = 0;
- int size;
- char *d;
-
- d = get_string_resource ("monoPrograms", "MonoPrograms");
- if (d && !*d) { free(d); d = 0; }
- if (!d)
- d = get_string_resource ("colorPrograms", "ColorPrograms");
- if (d && !*d) { free(d); d = 0; }
-
- if (d)
- {
- fprintf (stderr,
- "%s: the `monoPrograms' and `colorPrograms' resources are obsolete;\n\
- see the manual for details.\n", blurb());
- free(d);
- }
-
- d = get_string_resource ("programs", "Programs");
-
- if (p->screenhacks)
- {
- for (i = 0; i < p->screenhacks_count; i++)
- if (p->screenhacks[i])
- free (p->screenhacks[i]);
- free(p->screenhacks);
- p->screenhacks = 0;
- }
-
- if (!d || !*d)
- {
- p->screenhacks_count = 0;
- p->screenhacks = 0;
- return;
- }
-
- size = strlen (d);
-
-
- /* Count up the number of newlines (which will be equal to or larger than
- the number of hacks.)
- */
- i = 0;
- for (i = 0; d[i]; i++)
- if (d[i] == '\n')
- i++;
- i++;
-
- p->screenhacks = (char **) calloc (sizeof (char *), i+1);
-
- /* Iterate over the lines in `d' (the string with newlines)
- and make new strings to stuff into the `screenhacks' array.
- */
- p->screenhacks_count = 0;
- while (start < size)
- {
- /* skip forward over whitespace. */
- while (d[start] == ' ' || d[start] == '\t' || d[start] == '\n')
- start++;
-
- /* skip forward to newline or end of string. */
- end = start;
- while (d[end] != 0 && d[end] != '\n')
- end++;
-
- /* null terminate. */
- d[end] = 0;
-
- p->screenhacks[p->screenhacks_count++] = reformat_hack (d + start);
- if (p->screenhacks_count >= i)
- abort();
-
- start = end+1;
- }
-
- if (p->screenhacks_count == 0)
- {
- free (p->screenhacks);
- p->screenhacks = 0;
- }
-}
-
-
\f
/* Processing ClientMessage events.
*/
"ACTIVATE ClientMessage received.",
"activating.");
si->selection_mode = 0;
+ si->demoing_p = False;
if (p->use_mit_saver_extension || p->use_sgi_saver_extension)
{
XForceScreenSaver (si->dpy, ScreenSaverActive);
"CYCLE ClientMessage received.",
"cycling.");
si->selection_mode = 0; /* 0 means randomize when its time. */
+ si->demoing_p = False;
if (si->cycle_id)
XtRemoveTimeOut (si->cycle_id);
si->cycle_id = 0;
: "PREV ClientMessage received."),
"cycling.");
si->selection_mode = (type == XA_NEXT ? -1 : -2);
+ si->demoing_p = False;
if (! until_idle_p)
{
if (which < 0) which = 0; /* 0 == "random" */
si->selection_mode = which;
+ si->demoing_p = False;
if (! until_idle_p)
{
}
else if (type == XA_DEMO)
{
-#ifdef NO_DEMO_MODE
- clientmessage_response (si, window, True,
- "not compiled with support for DEMO mode.",
- "demo mode not enabled.");
-#else /* !NO_DEMO_MODE */
- if (until_idle_p)
+ long arg = event->xclient.data.l[1];
+ Bool demo_one_hack_p = (arg == 300);
+
+ if (demo_one_hack_p)
{
- clientmessage_response (si, window, False,
- "DEMO ClientMessage received.",
- "Demo mode.");
- si->demo_mode_p = True;
- return True;
+ if (until_idle_p)
+ {
+ long which = event->xclient.data.l[2];
+ char buf [255];
+ char buf2 [255];
+ sprintf (buf, "DEMO %ld ClientMessage received.", which);
+ sprintf (buf2, "demoing (%ld).", which);
+ clientmessage_response (si, window, False, buf, buf2);
+
+ if (which < 0) which = 0; /* 0 == "random" */
+ si->selection_mode = which;
+ si->demoing_p = True;
+
+ return True;
+ }
+
+ clientmessage_response (si, window, True,
+ "DEMO ClientMessage received while active.",
+ "already active.");
+ }
+ else
+ {
+ clientmessage_response (si, window, True,
+ "obsolete form of DEMO ClientMessage.",
+ "obsolete form of DEMO ClientMessage.");
}
- clientmessage_response (si, window, True,
- "DEMO ClientMessage received while active.",
- "already active.");
-#endif /* !NO_DEMO_MODE */
}
else if (type == XA_PREFS)
{
-#ifdef NO_DEMO_MODE
- clientmessage_response (si, window, True,
- "not compiled with support for DEMO mode.",
- "preferences mode not enabled.");
-#else /* !NO_DEMO_MODE */
- if (until_idle_p)
- {
- clientmessage_response (si, window, False,
- "PREFS ClientMessage received.",
- "preferences mode.");
- si->demo_mode_p = (Bool) 2; /* kludge, so sue me. */
- return True;
- }
clientmessage_response (si, window, True,
- "PREFS ClientMessage received while active.",
- "already active.");
-#endif /* !NO_DEMO_MODE */
+ "the PREFS client-message is obsolete.",
+ "the PREFS client-message is obsolete.");
}
else if (type == XA_LOCK)
{
: "locking.");
si->locked_p = True;
si->selection_mode = 0;
+ si->demoing_p = False;
sprintf (buf, "LOCK ClientMessage received; %s", response);
clientmessage_response (si, window, False, buf, response);
}
return False;
}
+
+\f
+/* Some random diagnostics printed in -verbose mode.
+ */
+
+static void
+analyze_display (saver_info *si)
+{
+ int i, j;
+ static const char *exts[][2] = {
+ { "SCREEN_SAVER", "SGI Screen-Saver" },
+ { "SCREEN-SAVER", "SGI Screen-Saver" },
+ { "MIT-SCREEN-SAVER", "MIT Screen-Saver" },
+ { "XIDLE", "XIdle" },
+ { "SGI-VIDEO-CONTROL", "SGI Video-Control" },
+ { "READDISPLAY", "SGI Read-Display" },
+ { "MIT-SHM", "Shared Memory" },
+ { "DOUBLE-BUFFER", "Double-Buffering" },
+ { "DPMS", "Power Management" },
+ { "GLX", "GLX" }
+ };
+
+ fprintf (stderr, "%s: running on display \"%s\"\n", blurb(),
+ DisplayString(si->dpy));
+ fprintf (stderr, "%s: vendor is %s, %d\n", blurb(),
+ ServerVendor(si->dpy), VendorRelease(si->dpy));
+
+ fprintf (stderr, "%s: useful extensions:\n", blurb());
+ for (i = 0; i < countof(exts); i++)
+ {
+ int op = 0, event = 0, error = 0;
+ if (XQueryExtension (si->dpy, exts[i][0], &op, &event, &error))
+ fprintf (stderr, "%s: %s\n", blurb(), exts[i][1]);
+ }
+
+ for (i = 0; i < si->nscreens; i++)
+ {
+ unsigned long colormapped_depths = 0;
+ unsigned long non_mapped_depths = 0;
+ XVisualInfo vi_in, *vi_out;
+ int out_count;
+ vi_in.screen = i;
+ vi_out = XGetVisualInfo (si->dpy, VisualScreenMask, &vi_in, &out_count);
+ if (!vi_out) continue;
+ for (j = 0; j < out_count; j++)
+ if (vi_out[j].class == PseudoColor)
+ colormapped_depths |= (1 << vi_out[j].depth);
+ else
+ non_mapped_depths |= (1 << vi_out[j].depth);
+ XFree ((char *) vi_out);
+
+ if (colormapped_depths)
+ {
+ fprintf (stderr, "%s: screen %d colormapped depths:", blurb(), i);
+ for (j = 0; j < 32; j++)
+ if (colormapped_depths & (1 << j))
+ fprintf (stderr, " %d", j);
+ fprintf (stderr, "\n");
+ }
+ if (non_mapped_depths)
+ {
+ fprintf (stderr, "%s: screen %d non-mapped depths:", blurb(), i);
+ for (j = 0; j < 32; j++)
+ if (non_mapped_depths & (1 << j))
+ fprintf (stderr, " %d", j);
+ fprintf (stderr, "\n");
+ }
+ }
+}
#include <string.h>
#include <stdio.h>
+#include "prefs.h"
+
extern char *progname;
extern char *progclass;
-typedef struct saver_preferences saver_preferences;
typedef struct saver_info saver_info;
typedef struct saver_screen_info saver_screen_info;
typedef struct passwd_dialog_data passwd_dialog_data;
-/* This structure holds all the user-specified parameters, read from the
- command line, the resource database, or entered through a dialog box.
- */
-struct saver_preferences {
- Bool verbose_p; /* whether to print out lots of status info */
- Bool timestamp_p; /* whether to mark messages with a timestamp */
- Bool debug_p; /* pay no mind to the man behind the curtain */
- Bool xsync_p; /* whether XSynchronize has been called */
-
- Bool lock_p; /* whether to lock as well as save */
- Bool lock_vt_p; /* whether to lock VTs too, if possible */
- Bool fade_p; /* whether to fade to black, if possible */
- Bool unfade_p; /* whether to fade from black, if possible */
- int fade_seconds; /* how long that should take */
- int fade_ticks; /* how many ticks should be used */
-
- Bool install_cmap_p; /* whether we should use our own colormap
- when using the screen's default visual. */
-
- char **screenhacks; /* the programs to run */
- int screenhacks_count;
-
- int nice_inferior; /* nice value for subprocs */
-
- Time initial_delay; /* how long to sleep after launch */
- Time splash_duration; /* how long the splash screen stays up */
- Time timeout; /* how much idle time before activation */
- Time lock_timeout; /* how long after activation locking starts */
- Time cycle; /* how long each hack should run */
- Time passwd_timeout; /* how much time before pw dialog goes down */
- Time pointer_timeout; /* how often to check mouse position */
- Time notice_events_timeout; /* how long after window creation to select */
- Time watchdog_timeout; /* how often to re-raise and re-blank screen */
-
- Bool use_xidle_extension; /* which extension to use, if possible */
- Bool use_mit_saver_extension;
- Bool use_sgi_saver_extension;
-
- char *shell; /* where to find /bin/sh */
-
- char *help_url; /* Where the help document resides. */
- char *load_url_command; /* How one loads URLs. */
-};
-
-
/* This structure holds all the data that applies to the program as a whole,
or to the non-screen-specific parts of the display connection.
+
+ The saver_preferences structure (prefs.h) holds all the user-specified
+ parameters, read from the command line, the resource database, or entered
+ through a dialog box.
*/
struct saver_info {
char *version;
saver_screen_info *screens;
saver_screen_info *default_screen; /* ...on which dialogs will appear. */
- time_t init_file_date; /* The date (from stat()) of the .xscreensaver
- file the last time this process read or
- wrote it. */
/* =======================================================================
global connection info
XtAppContext app;
Display *dpy;
- XrmDatabase db;
/* =======================================================================
server extension info
Bool screen_blanked_p; /* Whether the saver is currently active. */
Window mouse_grab_window; /* Window holding our mouse grab */
Window keyboard_grab_window; /* Window holding our keyboard grab */
- Bool fading_possible_p; /* Whether fading to/from black is possible. */
/* =======================================================================
Window passwd_dialog; /* The password dialog, if its up. */
passwd_dialog_data *pw_data; /* Other info necessary to draw it. */
+ int unlock_failures; /* Counts failed login attempts while the
+ screen is locked. */
+
/* =======================================================================
demoing
======================================================================= */
- Bool demo_mode_p; /* Whether demo-mode is active */
- char *demo_hack; /* The hack that has been selected from the
- dialog box, which should be run next. */
+ Bool demoing_p; /* Whether we are demoing a single hack
+ (without UI.) */
Window splash_dialog; /* The splash dialog, if its up. */
splash_dialog_data *sp_data; /* Other info necessary to draw it. */
int selection_mode; /* Set to -1 if the NEXT ClientMessage has just
been received; set to -2 if PREV has just
- been received; set to N if SELECT has
- been received. (This is kind of nasty.) */
+ been received; set to N if SELECT or DEMO N
+ has been received. (This is kind of nasty.)
+ */
/* =======================================================================
subprocs
======================================================================= */
extern void restore_real_vroot (saver_info *si);
-extern void disable_builtin_screensaver (saver_info *si, Bool turn_off_p);
+extern void disable_builtin_screensaver (saver_info *, Bool unblank_screen_p);
extern Bool ensure_no_screensaver_running (Display *, Screen *);
#ifdef HAVE_MIT_SAVER_EXTENSION
#ifdef HAVE_SGI_SAVER_EXTENSION
extern Bool query_sgi_saver_extension (saver_info *);
#endif
+#ifdef HAVE_XIDLE_EXTENSION
+extern Bool query_xidle_extension (saver_info *);
+#endif
/* Display Power Management System (DPMS) interface. */
extern Bool monitor_powered_on_p (saver_info *si);
Bool dont_clear);
extern void blank_screen (saver_info *si);
extern void unblank_screen (saver_info *si);
-extern void grab_keyboard_and_mouse (saver_info *si, Window, Cursor);
+extern Bool grab_keyboard_and_mouse (saver_info *si, Window, Cursor);
extern void ungrab_keyboard_and_mouse (saver_info *si);
/* =======================================================================
unsigned long bottom_color);
extern int string_width (XFontStruct *font, char *s);
-
-#ifndef NO_DEMO_MODE
-extern void demo_mode (saver_info *si);
-extern void demo_mode_restart_process (saver_info *si);
-extern void create_demo_dialog (Widget, Visual *, Colormap);
-extern void create_resources_dialog (Widget, Visual *, Colormap);
-#endif
-
-#if !defined(NO_LOCKING) || !defined(NO_DEMO_MODE)
-extern void pop_up_dialog_box (Widget dialog, Widget form, int where);
-extern void format_into_label (Widget label, const char *arg);
-extern void steal_focus_and_colormap (Widget dialog);
-#endif
-
extern void make_splash_dialog (saver_info *si);
extern void handle_splash_event (saver_info *si, XEvent *e);
extern void skull (Display *, Window, GC, GC, int, int, int, int);
======================================================================= */
extern Bool handle_clientmessage (saver_info *, XEvent *, Bool);
+extern void maybe_reload_init_file (saver_info *);
/* =======================================================================
subprocs
======================================================================= */
extern void hack_environment (saver_info *si);
+extern void hack_subproc_environment (saver_screen_info *ssi);
extern void init_sigchld (void);
extern void spawn_screenhack (saver_info *si, Bool first_time_p);
extern void kill_screenhack (saver_info *si);
extern void reset_stderr (saver_screen_info *ssi);
extern void clear_stderr (saver_screen_info *ssi);
-/* =======================================================================
- the .xscreensaver file
- ======================================================================= */
-
-extern int read_init_file (saver_info *si);
-extern int write_init_file (saver_info *si);
-extern int maybe_reload_init_file (saver_info *si);
-extern void get_resources (saver_info *si);
-
/* =======================================================================
misc
.if n .sp 1
.if t .sp .5
..
-.TH XScreenSaver 1 "08-Oct-98 (2.34)" "X Version 11"
+.TH XScreenSaver 1 "24-Oct-98 (3.01)" "X Version 11"
.SH NAME
xscreensaver - graphics hack and screen locker, launched when the user is idle
.SH SYNOPSIS
For the impatient, try this:
.EX
xscreensaver &
-xscreensaver-command -demo
+xscreensaver-demo
.EE
-After a few seconds, the screen should go black, and a dialog box should
-appear in the upper right corner. This is \fIDemo Mode\fP.
+The \fIxscreensaver\-demo\fP program should pop up a dialog box
+that lets you experiment with the xscreensaver settings and graphics
+modes.
.B Note:
unlike
.BR xlock (1),
-xscreensaver has a client-server model: the xscreensaver process is a
+xscreensaver has a client-server model: the \fIxscreensaver\fP program is a
daemon that runs in the background; it is controlled by the foreground
+.BR xscreensaver-demo (1)
+and
.BR xscreensaver-command (1)
-program.
-.SH DEMO MODE
-If \fIxscreensaver\fP receives the \fBDEMO\fP ClientMessage, which is done
-by running the
-.BR xscreensaver\-command (1)
-program with the \fB\-demo\fP option, the screensaver will black the screen
-and pop up a dialog box from which you can examine and experiment with the
-client programs.
-
-The dialog box contains a scrolling list, a text field, and a number of
-buttons.
-
-Double-clicking on one of the programs in the list will run it. The dialog
-box will disappear, allowing the program access to the full screen. Clicking
-the mouse again will bring the dialog box back.
-
-Single-clicking in the list will place the indicated program and its args
-in the text field to be edited. Edit the arguments and hit return to run
-the program with the parameters you have specified. (Note that these are
-one-time changes and won't be remembered; to make the changes permanent,
-you need to edit your \fI~/.xscreensaver\fP file by hand.)
-
-The buttons are:
-.TP 8
-.B Run Next
-Clicking this button will run the next program in the list after the
-currently-selected one, and will wrap around to the top when it reaches
-the bottom.
-.TP 8
-.B Run Previous
-Opposite of Run Next; at the top, it wraps around to the bottom.
-.TP 8
-.B Preferences
-This pops up a second dialog box, in which you have the option to
-interactively change most of the screensaver's operational parameters,
-such as its timeouts, and whether it should lock the screen. When you
-click OK, your chosen settings will take effect immediately, and will
-also be saved to the \fI~/.xscreensaver\fP file in your home directory,
-so that the settings will persist next time. (For more details, see
-the \fIConfiguration\fP section, below.)
-.TP 8
-.B Exit Demo Mode
-Returns to normal screensaver operation.
-.TP 8
-.B Reinitialize
-This causes the X resource database to be re-read, to pick up any changes
-you might have made. This works by causing the screensaver process to exit
-and then restart itself with the same command-line arguments. This is just
-like the \fI\-restart\fP argument to
-.BR xscreensaver\-command (1)
-except that when executed from this button, the screensaver will
-automatically return to Demo Mode after restarting.
+programs.
.SH CONFIGURATION
Options to \fIxscreensaver\fP are specified in one of two places: in
a \fI.xscreensaver\fP file in your home directory; or in the X resource
The default setting will load it into Netscape if it is already running,
otherwise, will launch a new Netscape looking at the \fIhelpURL\fP.
.TP 8
+.B demoCommand\fP (class \fBDemoCommand\fP)
+This is the shell command run when the \fIDemo\fP button on the splash window
+is pressed. It defaults to \fIxscreensaver\-demo\fP.
+.TP 8
+.B prefsCommand\fP (class \fBPrefsCommand\fP)
+This is the shell command run when the \fIPrefs\fP button on the splash window
+is pressed. It defaults to \fIxscreensaver\-demo\ \-prefs\fP.
+.TP 8
.B nice\fP (class \fBNice\fP)
The sub-processes created by \fIxscreensaver\fP will be ``niced'' to this
level, so that they are given lower priority than other processes on the
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.
-Simply add \fB"xscreensaver &"\fP to your \fI/usr/lib/X11/xdm/Xsetup\fP
-file. Because \fIxdm\fP grabs the keyboard, keypresses will not make
-the screensaver deactivate, but any mouse activity will.
+You can run \fIxscreensaver\fP from your
+.BR xdm (1)
+session, so that the screensaver will run even when nobody is logged
+in on the console.
+
+The trick to using xscreensaver with \fIxdm\fP is this: keep in mind the
+two very different states in which xscreensaver will be running:
+.RS 4
+.TP 3
+.B 1: Nobody logged in.
+
+If you're thinking of running xscreensaver from XDM at all, then it's
+probably because you want graphics demos to be running on the console
+when nobody is logged in there. In this case, xscreensaver will function
+only as a screen saver, not a screen locker: it doesn't make sense
+for xscreensaver to lock the screen, since nobody is logged in yet!
+The only thing on the screen is the XDM login prompt.
+.TP 3
+.B 2: Somebody logged in.
+
+Once someone has logged in through the XDM login window, the situation is
+very different. For example: now it makes sense to lock the screen (and
+prompt for the logged in user's password); and now xscreensaver should
+consult that user's \fI~/.xscreensaver\fP file; and so on.
+.RE
+
+The difference between these two states comes down to a question of,
+which user is the \fIxscreensaver\fP process running as? For the first
+state, it doesn't matter. If you start \fIxscreensaver\fP in the usual
+XDM way, then xscreensaver will probably end up running as root, which
+is fine for the first case (the ``nobody logged in'' case.)
+
+However, once someone is logged in, running as root is no longer fine:
+because xscreensaver will be consulting root's \fI.xscreensaver\fP file
+instead of that of the logged in user, and won't be prompting for the
+logged in user's password, and so on. (This is not a security problem,
+it's just not what you want.)
+
+So, once someone has logged in, you want xscreensaver to be running as that
+user. The way to accomplish this is to kill the old xscreensaver process
+and start a new one (as the new user.)
+
+The simplest way to accomplish all of this is as follows:
+.RS 4
+.TP 3
+.B 1: Launch xscreensaver before anyone logs in.
+
+To the file \fI/usr/lib/X11/xdm/Xsetup\fP, add the lines
+.EX
+xscreensaver-command -exit
+xscreensaver &
+.EE
+This will run xscreensaver as root, over the XDM login window.
+Moving the mouse will cause the screen to un-blank, and allow the user
+to type their password at XDM to log in.
+.TP 3
+.B 2: Restart xscreensaver when someone logs in.
-Make sure you have \fB$PATH\fP set up correctly in the Xsetup script, or
-\fIxdm\fP won't be able to find \fIxscreensaver\fP, and/or \fIxscreensaver\fP
-won't be able to find its graphics hacks.
+Near the top of the file \fI/usr/lib/X11/xdm/Xsession\fP, add those same lines:
+.EX
+xscreensaver-command -exit
+xscreensaver &
+.EE
+When someone logs in, this will kill off the existing (root) xscreensaver
+process, and start a new one, running as the user who has just logged in.
+If the user's .xscreensaver file requests locking, they'll get it. They
+will also get their own choice of timeouts, and graphics demos, and so on.
+
+Alternately, each user could just put those lines in their
+personal \fI~/.xsession\fP files.
+.RE
+
+Make sure you have \fB$PATH\fP set up correctly in the \fIXsetup\fP
+and \fIXsession\fP scripts, or \fIxdm\fP won't be able to
+find \fIxscreensaver\fP, and/or \fIxscreensaver\fP won't be able to
+find its graphics demos.
(If your system does not seem to be executing the \fIXsetup\fP file, you
may need to configure it to do so: the traditional way to do this is
.BR xdm (1)
for more details.)
-Users may want to add \fB"xscreensaver-command -restart"\fP to their
-startup scripts, so that the screensaver will be reinitialized with
-their private resource settings when they log in. Users who don't do
-this will get the system-wide defaults instead.
-
-It is safe to run this program as root (as \fIxdm\fP is likely to do.) If
-run as root, \fIxscreensaver\fP changes its effective user and group ids to
-something safe (like \fI"nobody"\fP) before connecting to the X server
+It is safe to run \fIxscreensaver\fP as root (as \fIxdm\fP is likely to do.)
+If run as root, \fIxscreensaver\fP changes its effective user and group ids
+to something safe (like \fI"nobody"\fP) before connecting to the X server
or launching user-specified programs.
-Locking doesn't work if the screensaver is launched by \fIxdm\fP. To get
-around this, you can run the screensaver from \fIxdm\fP without locking,
-and kill and restart it from your personal X startup script to enable
-locking; for example, by using this pair of commands:
+An unfortunate side effect of this (important) security precaution is that
+it may conflict with cookie-based authentication.
-.EX
-xscreensaver-command -exit
-xscreensaver
-.EE
If you get "connection refused" errors when running \fIxscreensaver\fP
from \fIxdm\fP, then this probably means that you have
.BR xauth (1)
Note that this will give access to the X server to anyone capable of logging
in to the local machine, so in some environments, this might not be
appropriate. If turning off file-system-based access control is not
-acceptable, then running \fIxscreensaver\fP from \fIxdm\fP might not be
-possible, and users will have to launch it themselves instead of having it
-be launched by \fIxdm\fP before anyone logs in.
+acceptable, then running \fIxscreensaver\fP from the \fIXsetup\fP file
+might not be possible, and xscreensaver will only work when running as
+a normal, unprivileged user.
For more information on the X server's access control mechanisms, see the
man pages for
.TP 3
\fB2: Edit sessionetc\fP
Edit the file \fI~/.dt/sessions/sessionetc\fP and add to it the line
-
.EX
xscreensaver &
.EE
\fB3: Create XScreenSaver.dt\fP
Create a file called \fI~/.dt/types/XScreenSaver.dt\fP with the following
contents:
-
.EX
ACTION XScreenSaver
{
\fB4: Create Lock.fp\fP
Create a file called \fI~/.dt/types/Lock.fp\fP with the following
contents:
-
.EX
CONTROL Lock
{
.SH USING HP VUE (VISUAL USER ENVIRONMENT)
Since CDE is a descendant of VUE, the instructions for using xscreensaver
under VUE are similar to the above:
-
.RS 4
.TP 3
\fB1: Switch off VUE's locker\fP
{
"Blank Screen Now" !"sleep 3; xscreensaver-command -activate"
"Lock Screen Now" !"sleep 3; xscreensaver-command -lock"
- "Screen Saver Demo" !"xscreensaver-command -demo"
- "Screen Saver Preferences" !"xscreensaver-command -prefs"
+ "Screen Saver Demo" !"xscreensaver-demo"
+ "Screen Saver Preferences" !"xscreensaver-demo -prefs"
"Reinitialize Screen Saver" !"xscreensaver-command -restart"
"Kill Screen Saver" !"xscreensaver-command -exit"
"Launch Screen Saver" !"xscreensaver &"
"XScreenSaver" f.menu XScreenSaver
.EE
then this will add an XScreenSaver sub-menu to your default root-window
-popup menu. Alternately, you could just put the \fIxscreensaver-command\fP
-menu items directly into the root menu.
+popup menu. Alternately, you could just put the xscreensaver menu items
+directly into the root menu.
.RE
-Other window managers might (and probably do) do things differently.
+Other window managers are guaranteed to do things gratuitously differently.
.SH BUGS
-(This is not a bug, but) note that as of release 1.32, the \fBcolorPrograms\fP
-and \fBmonoPrograms\fP resources are no longer used: they have been
-supplanted by the extended syntax of the \fBprograms\fP resource (which is
-described in the \fIConfiguration\fP section, above.)
-.TP 8
-.B Extensions
-If you are not making use of one of the server extensions (\fBXIDLE\fP,
-\fBSGI SCREEN_SAVER\fP, or \fBMIT-SCREEN-SAVER\fP), then it is possible, in
-rare situations, for \fIxscreensaver\fP to interfere with event propagation
-and make another X program malfunction. For this to occur, that other
-application would need to \fInot\fP select \fBKeyPress\fP events on its
-non-leaf windows within the first 30 seconds of their existence, but then
-select for them later. In this case, that client \fImight\fP fail to receive
-those events. This isn't very likely, since programs generally select a
-constant set of events immediately after creating their windows and then
-don't change them, but this is the reason that it's a good idea to install
-and use one of the server extensions instead, to work around this shortcoming
-in the X protocol.
-.TP 8
-.B Machine Load
-Although this program ``nices'' the subprocesses that it starts,
-graphics-intensive subprograms can still overload the machine by causing
-the X server process itself (which is not ``niced'') to suck a lot of
-cycles. Care should be taken to slow down programs intended for use as
-screensavers by inserting strategic calls to
-.BR sleep (3)
-or
-.BR usleep (3)
-(or making liberal use of any \fI\-delay\fP options which the programs
-may provide.)
-
-Also, an active screensaver will cause your X server to be pretty much
-permanently swapped in; but the same is true of any program that draws
-periodically, like
-.BR xclock (1)
-or
-.BR xload (1).
-.TP 8
-.B Latency and Responsiveness
-If the subprocess is drawing too quickly and the connection to the X
-server is a slow one (such as an X terminal running over a phone line) then
-the screensaver might not turn off right away when the user becomes active
-again (the
-.BR ico (1)
-demo has this problem if being run in full-speed mode). This can be
-alleviated by inserting strategic calls to
-.BR XSync (3)
-in code intended for use as a screensaver. This prevents too much graphics
-activity from being buffered up.
+Bugs? There are no bugs. Ok, well, maybe. If you find one, please let
+me know. http://www.jwz.org/xscreensaver/bugs.html explains how to
+construct the most useful bug reports.
.TP 8
.B Locking and XDM
If xscreensaver has been launched from
-.BR xdm (1),
-you will need to cause the xscreensaver daemon to exit and restart in
-order to lock the screen.
+.BR xdm (1)
+before anyone has logged in, you will need to kill and then restart the
+xscreensaver daemon after you have logged in, or you will be confused by
+the results. (For example, locking won't work, and your \fI~/.xscreensaver\fP
+file will be ignored.)
-The reason for this is, if xscreensaver has been launched by
-.BR xdm (1),
-that means it was launched \fIbefore\fP you logged in: so it has no way of
-knowing who the logged-in user is, and therefore, whose password it should
-prompt for.
+When you are logged in, you want the \fIxscreensaver\fP daemon to be
+running under \fIyour\fP user id, not as root or some other user.
-So if you want to use it as a locker, you must start it with your user id.
If it has already been started by \fIxdm\fP, you can kill it by sending
it the \fBexit\fP command, and then re-launching it as you, by putting
something like the following in your personal X startup script:
xscreensaver-command -exit
xscreensaver &
.EE
-See the ``\fIUsing XDM(1)\fP'' section, above, for more details.
+The ``\fIUsing XDM(1)\fP'' section, above, goes into more detail, and explains
+how to configure the system to do this for all users automatically.
.TP 8
.B Locking and root logins
-An implication of the above is that if you log in as \fIroot\fP on the
-console, xscreensaver will refuse to lock the screen (because it can't tell
+In order for it to be safe for xscreensaver to be launched by \fIxdm\fP,
+certain precautions had to be taken, among them that xscreensaver never
+runs as \fIroot\fP. In particular, if it is launched as root (as \fIxdm\fP
+is likely to do), xscreensaver will disavow its privileges, and switch to
+a safe user id (such as \fInobody\fP.)
+
+An implication of this is that if you log in as \fIroot\fP on the console,
+xscreensaver will refuse to lock the screen (because it can't tell
the difference between \fIroot\fP being logged in on the console, and a
-normal user being logged in on the console but xscreensaver having been run
-by
-.BR xdm (1)).
+normal user being logged in on the console but xscreensaver having been
+launched by the
+.BR xdm (1)
+.I Xsetup
+file.)
The solution to this is simple: you shouldn't be logging in on the console
-as \fIroot\fP in the first place! (What, are you crazy or something?) You
-should log in as you, and
+as \fIroot\fP in the first place! (What, are you crazy or something?)
+
+Proper Unix hygiene dictates that you should log in as yourself, and
.BR su (1)
-to \fIroot\fP as necessary. People who spend their day logged in
+to \fIroot\fP as necessary. People who spend their day logged in
as \fIroot\fP are just begging for disaster.
.TP 8
.B XAUTH and XDM
For xscreensaver to work when launched by
.BR xdm (1),
programs running on the local machine as user \fI"nobody"\fP must be
-able to connect to the X server. This means that \fB"xhost +localhost"\fP
-is required if xscreensaver is to be launched by
-.BR xdm (1).
-This is \fInot\fP required if \fIxscreensaver\fP is launched by the
-individual users: it is only necessary when it is launched by
-.BR xdm (1),
-before any user has logged in. See the ``\fIUsing XDM(1)\fP'' section,
+able to connect to the X server. This means that if you want to run
+xscreensaver on the console while nobody is logged in, you may need
+to disable cookie-based access control (and allow all users who can log
+in to the local machine to connect to the display.)
+
+You should be sure that this is an acceptable thing to do in your
+environment before doing it. See the ``\fIUsing XDM(1)\fP'' section,
above, for more details.
If anyone has suggestions on how xscreensaver could be made to work with
then \fIxscreensaver\fP must be installed as setuid to root. Care has
been taken to make this a safe thing to do.
-It also may mean that your system uses shadow passwords instead of the
-standard \fIgetpwent\fP interface; in that case, you may need to change
-some options with \fIconfigure\fP and recompile.
+It also may mean that your system uses shadow passwords instead of the standard
+.BR getpwent (3)
+interface; in that case, you may need to change some options
+with \fIconfigure\fP and recompile.
If you change your password after xscreensaver has been launched, it will
continue using your old password to unlock the screen until xscreensaver
but that would deny extra colors to those programs that \fIcan\fP take
advantage of them.
.TP 8
+.B Machine Load
+Although this program ``nices'' the subprocesses that it starts,
+graphics-intensive subprograms can still overload the machine by causing
+the X server process itself (which is not ``niced'') to suck a lot of
+cycles. Care should be taken to slow down programs intended for use as
+screensavers by inserting strategic calls to
+.BR sleep (3)
+or
+.BR usleep (3)
+(or making liberal use of any \fI\-delay\fP options which the programs
+may provide.)
+
+Note that the OpenGL-based graphics demos are real pigs on machines that
+don't have texture hardware.
+
+Also, an active screensaver will cause your X server to be pretty much
+permanently swapped in; but the same is true of any program that draws
+periodically, like
+.BR xclock (1)
+or
+.BR xload (1).
+.TP 8
+.B Doom and Quake
+On some systems, Doom, Quake, and other games intercept the keyboard in
+ways that X programs can never detect. Therefore, when running these games,
+xscreensaver might think the console is idle, and activate. In the worst
+case, xscreensaver might blank the screen and mess up the game. Alternately,
+xscreensaver might activate on the X display while leaving the game visible,
+and merely cause the game to slow down.
+
+I don't know how to fix this, because I don't know how to detect the kind
+of keyboard activity that occurs during these games. Suggestions are welcome.
+.TP 8
+.B Latency and Responsiveness
+If the subprocess is drawing too quickly and the connection to the X
+server is a slow one (such as an X terminal running over a phone line) then
+the screensaver might not turn off right away when the user becomes active
+again (the
+.BR ico (1)
+demo has this problem if being run in full-speed mode). This can be
+alleviated by inserting strategic calls to
+.BR XSync (3)
+in code intended for use as a screensaver. This prevents too much graphics
+activity from being buffered up.
+.TP 8
.B XView Clients
Apparently there are some problems with XView programs getting confused
and thinking that the screensaver window is the real root window even when
implements the (quite abominable) Sun OpenLook look-and-feel.)
.TP 8
.B MIT Extension and Fading
+The \fBMIT-SCREEN-SAVER\fP extension is junk. Don't use it.
+
When using the \fBMIT-SCREEN-SAVER\fP extension in conjunction with
-the \fBfade\fP option, you may notice an unattractive flicker just before
+the \fBfade\fP option, you'll notice an unattractive flicker just before
the fade begins. This is because the server maps a black window just before
it tells the \fIxscreensaver\fP process to activate. The \fIxscreensaver\fP
process immediately unmaps that window, but this results in a flicker. I
property of the (mis-) design of this server extension.
It sure would be nice if someone would implement the \fBSGI SCREEN_SAVER\fP
-extension in XFree86; it's dead simple, and works far better than the
+extension in XFree86; it's dead simple, and works far better than the
overengineered and broken \fBMIT-SCREEN-SAVER\fP extension.
.TP 8
-.B Lesstif (Motif clone)
-\fIDemo Mode\fP is buggy if XScreenSaver was compiled against really old
-versions Lesstif; if you use Lesstif, make sure you use version 0.82 or newer.
-.TP 8
-.B Athena Widgets
-If you compiled against the Athena widget toolkit, the dialog boxes are
-pretty ugly, especially the password dialog. Use Motif! If you don't
-have OSF Motif, use GNU Lesstif, it's free: http://www.lesstif.org/
-.TP 8
.B SGI Power Saver
If you're running Irix 6.3, you might find that your monitor is powering down
after an hour or two even if you've told it not to. This is fixed by SGI
For example, on a screen that supports both 24-bit TrueColor and 12-bit
PseudoColor visuals, the 12-bit visual will probably work best (this is true
-of base-model SGI Indys: the 0x29 visual is the one you want.) Oddly, on
-SGI O2s (machines that have serious hardware support for GL), the 12-bit
-PseudoColor visual looks awful (you get a black and white, flickery image.)
-On these machines, the visual you want turns out to be 0x31. However, 0x31
-is but \fIone\fP of the \fIeight\fP 15-bit TrueColor visuals (yes, 8, and
-yes, 15) that the O2 X server provides. This is the only visual that works
-properly: as far as
+of base-model SGI Indys: the 0x29 visual is the one you want.)
+
+Oddly, on SGI O2s (machines that have serious hardware support for GL), the
+12-bit PseudoColor visual looks awful (you get a black and white, flickery
+image.) On these machines, the visual you want turns out to be 0x31.
+However, 0x31 is but \fIone\fP of the \fIeight\fP 15-bit TrueColor visuals
+(yes, 8, and yes, 15) that the O2 X server provides. This is the only visual
+that works properly: as far as
.BR xdpyinfo (1)
is concerned, all of the 15-bit TrueColor visuals are identical, but some
flicker like mad, and some have deeply weird artifacts (such as hidden
Your mileage, therefore, may vary dramatically.
.TP 8
+.B MesaGL and Voodoo Cards
+If you have a 3Dfx/Voodoo card, the default settings for xscreensaver will run
+the GL-based graphics demos in such a way that they will not take advantage
+of the 3D acceleration hardware. The solution is to change the \fBprograms\fP
+entries for the GL hacks from this:
+.EX
+ gears -root \\n\\
+.EE
+to this:
+.EX
+ MESA_GLX_FX=fullscreen gears \\n\\
+.EE
+That is, make sure that \fB$MESA_GLX_FX\fP is set to \fIfullscreen\fP, and
+don't tell the program to draw on the root window. This may seem strange,
+but the setup used by Mesa and these kinds of cards \fIis\fP strange!
+
+For those who don't know, these cards work by sitting between your normal
+video card and the monitor, and seizing control of the monitor when it's
+time to do 3D. But this means that accelerated 3D only happens in full-screen
+mode (you can't do it in a window) and that 3D will probably drive your
+monitor at a lower resolution, as well. It's bizarre.
+.TP 8
+.B Extensions
+If you are not making use of one of the server extensions (\fBXIDLE\fP,
+\fBSGI SCREEN_SAVER\fP, or \fBMIT-SCREEN-SAVER\fP), then it is possible, in
+rare situations, for \fIxscreensaver\fP to interfere with event propagation
+and make another X program malfunction. For this to occur, that other
+application would need to \fInot\fP select \fBKeyPress\fP events on its
+non-leaf windows within the first 30 seconds of their existence, but then
+select for them later. In this case, that client \fImight\fP fail to receive
+those events. This isn't very likely, since programs generally select a
+constant set of events immediately after creating their windows and then
+don't change them, but this is the reason that it's a good idea to install
+and use one of the server extensions instead, to work around this shortcoming
+in the X protocol.
+
+In all these years, I've not heard of even a single case of this happening,
+but it is theoretically possible, so I'm mentioning it for completeness...
+.TP 8
.B Red Hot Lava
There need to be a lot more graphics hacks. In particular, there should be
a simulation of a Lavalite (tm).
.B PATH
to find the sub-programs to run.
.TP 8
-.TP 8
.B HOME
for the directory in which to read and write the \fI.xscreensaver\fP file.
.TP 8
http://www.jwz.org/xscreensaver/
.SH SEE ALSO
.BR X (1),
+.BR xscreensaver\-demo (1),
.BR xscreensaver\-command (1),
.BR xdm (1),
.BR xset (1),
#endif /* HAVE_SGI_SAVER_EXTENSION */
+\f
+/* XIDLE server extension hackery.
+ */
+
+#ifdef HAVE_XIDLE_EXTENSION
+
+# include <X11/extensions/xidle.h>
+
+Bool
+query_xidle_extension (saver_info *si)
+{
+ int event_number;
+ int error_number;
+ return XidleQueryExtension (si->dpy, &event_number, &error_number);
+}
+
+#endif /* HAVE_XIDLE_EXTENSION */
+
+
\f
/* Figuring out what the appropriate XSetScreenSaver() parameters are
(one wouldn't expect this to be rocket science.)
*/
void
-disable_builtin_screensaver (saver_info *si, Bool turn_off_p)
+disable_builtin_screensaver (saver_info *si, Bool unblank_screen_p)
{
saver_preferences *p = &si->prefs;
int current_server_timeout, current_server_interval;
desired_server_interval = 0;
/* I suspect (but am not sure) that DontAllowExposures might have
- something to do with powering off the monitor as well. */
+ something to do with powering off the monitor as well, at least
+ on some systems that don't support XDPMS? Who know... */
desired_allow_exp = AllowExposures;
-#if defined(HAVE_MIT_SAVER_EXTENSION) || defined(HAVE_SGI_SAVER_EXTENSION)
if (p->use_mit_saver_extension || p->use_sgi_saver_extension)
{
desired_server_timeout = (p->timeout / 1000);
desired_prefer_blank = DontPreferBlanking;
}
else
-#endif /* HAVE_MIT_SAVER_EXTENSION || HAVE_SGI_SAVER_EXTENSION */
{
+ /* When we're not using an extension, set the server-side timeout to 0,
+ so that the server never gets involved with screen blanking, and we
+ do it all ourselves. (However, when we *are* using an extension,
+ we tell the server when to notify us, and rather than blanking the
+ screen, the server will send us an X event telling us to blank.)
+ */
desired_server_timeout = 0;
}
desired_prefer_blank != current_prefer_blank ||
desired_allow_exp != current_allow_exp)
{
- if (desired_server_timeout == 0)
+ if (unblank_screen_p)
fprintf (stderr,
- "%s%sisabling server builtin screensaver.\n"
- "\tYou can re-enable it with \"xset s on\".\n",
- (p->verbose_p ? "" : blurb()),
- (p->verbose_p ? "\n\tD" : ": d"));
+ "%s disabling server builtin screensaver.\n"
+ "%s: you can re-enable it with \"xset s on\".\n",
+ blurb(), blurb());
if (p->verbose_p)
- fprintf (stderr, "%s: (xset s %d %d %s %s)\n", blurb(),
+ fprintf (stderr, "%s: (xset s %d %d; xset s %s; xset s %s)\n", blurb(),
desired_server_timeout, desired_server_interval,
(desired_prefer_blank ? "blank" : "noblank"),
- (desired_allow_exp ? "noexpose" : "expose"));
+ (desired_allow_exp ? "expose" : "noexpose"));
XSetScreenSaver (si->dpy,
desired_server_timeout, desired_server_interval,
}
#endif /* HAVE_MIT_SAVER_EXTENSION || HAVE_SGI_SAVER_EXTENSION */
- if (turn_off_p)
+ if (unblank_screen_p)
/* Turn off the server builtin saver if it is now running. */
XForceScreenSaver (si->dpy, ScreenSaverReset);
}
* this version written by jwz, 4-Jun-98.
*
* TODO:
- * - Should have a "macsbug" mode.
* - Should simulate a Unix kernel panic and reboot.
* - Making various boot noises would be fun, too.
* - Maybe scatter some random bits across the screen,
}
-static void
+static Bool
windows (Display *dpy, Window window, int delay, Bool w95p)
{
XGCValues gcv;
"contact your system administrator or technical support group."
);
+ if (!get_boolean_resource((w95p? "doWindows" : "doNT"), "DoWindows"))
+ return False;
+
XGetWindowAttributes (dpy, window, &xgwa);
fontname = get_string_resource ((xgwa.height > 600
bsod_sleep(dpy, delay);
XClearWindow(dpy, window);
XFreeFont(dpy, font);
+ return True;
}
/* SCO OpenServer 5 panic, by Tom Kelly <tom@ancilla.toronto.on.ca>
*/
-static void
-openserver (Display *dpy, Window window, int delay)
+static Bool
+sco (Display *dpy, Window window, int delay)
{
XGCValues gcv;
XWindowAttributes xgwa;
const char *def_font = "fixed";
XFontStruct *font;
GC gc;
+ int lines = 1;
+ const char *s;
- const char *openserver_panic =
- ("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
- "Unexpected trap in kernel mode:\n"
+ const char *sco_panic =
+ ("Unexpected trap in kernel mode:\n"
"\n"
"cr0 0x80010013 cr2 0x00000014 cr3 0x00000000 tlb 0x00000000\n"
"ss 0x00071054 uesp 0x00012055 efl 0x00080888 ipl 0x00000005\n"
"** Press Any Key to Reboot **\n"
);
+ if (!get_boolean_resource("doSCO", "DoSCO"))
+ return False;
+
+ for (s = sco_panic; *s; s++) if (*s == '\n') lines++;
XGetWindowAttributes (dpy, window, &xgwa);
fontname = get_string_resource ((xgwa.height > 600
- ? "openserver.font2"
- : "openserver.font"),
- "OpenServer.Font");
+ ? "sco.font2"
+ : "sco.font"),
+ "SCO.Font");
if (!fontname || !*fontname) fontname = (char *)def_font;
font = XLoadQueryFont (dpy, fontname);
if (!font) font = XLoadQueryFont (dpy, def_font);
free (fontname);
gcv.font = font->fid;
- gcv.foreground = get_pixel_resource(("openserver.foreground"),
- "OpenServer.Foreground",
+ gcv.foreground = get_pixel_resource(("sco.foreground"),
+ "SCO.Foreground",
dpy, xgwa.colormap);
- gcv.background = get_pixel_resource(("openserver.background"),
- "OpenServer.Background",
+ gcv.background = get_pixel_resource(("sco.background"),
+ "SCO.Background",
dpy, xgwa.colormap);
XSetWindowBackground(dpy, window, gcv.background);
XClearWindow(dpy, window);
gc = XCreateGC(dpy, window, GCFont|GCForeground|GCBackground, &gcv);
draw_string(dpy, window, gc, &gcv, font,
- 0, 0, xgwa.width, xgwa.height, openserver_panic, 0);
+ 10, xgwa.height - (lines * (font->ascent + font->descent + 1)),
+ 10, 10,
+ sco_panic, 0);
XFreeGC(dpy, gc);
XSync(dpy, False);
bsod_sleep(dpy, delay);
XClearWindow(dpy, window);
XFreeFont(dpy, font);
+ return True;
}
/* Linux (sparc) panic, by Tom Kelly <tom@ancilla.toronto.on.ca>
*/
-static void
+static Bool
sparc_linux (Display *dpy, Window window, int delay)
{
XGCValues gcv;
const char *def_font = "fixed";
XFontStruct *font;
GC gc;
+ int lines = 1;
+ const char *s;
const char *linux_panic =
("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
"l4: 0000ffff l5: f0131550 l6: f012c000 l7: f0130400\n"
"i0: f1b13fb0 i1: 00000001 i2: 00000002 i3: 0007c000\n"
"i4: f01457c0 i5: 00000004 i6: f1b13f70 i7: f0015360\n"
- "Instruction DUMP:"
-
+ "Instruction DUMP:\n"
);
+ if (!get_boolean_resource("doSparcLinux", "DoSparcLinux"))
+ return False;
+
+ for (s = linux_panic; *s; s++) if (*s == '\n') lines++;
XGetWindowAttributes (dpy, window, &xgwa);
gc = XCreateGC(dpy, window, GCFont|GCForeground|GCBackground, &gcv);
draw_string(dpy, window, gc, &gcv, font,
- 0, 0, xgwa.width, xgwa.height, linux_panic, 0);
+ 10, xgwa.height - (lines * (font->ascent + font->descent + 1)),
+ 10, 10,
+ linux_panic, 0);
XFreeGC(dpy, gc);
XSync(dpy, False);
bsod_sleep(dpy, delay);
XClearWindow(dpy, window);
XFreeFont(dpy, font);
+ return True;
}
-static void
+static Bool
amiga (Display *dpy, Window window, int delay)
{
XGCValues gcv;
("_Software failure. Press left mouse button to continue.\n"
"_Guru Meditation #00000003.00C01570");
+ if (!get_boolean_resource("doAmiga", "DoAmiga"))
+ return False;
+
XGetWindowAttributes (dpy, window, &xgwa);
fontname = get_string_resource ((xgwa.height > 600
XSync(dpy, False);
XClearWindow(dpy, window);
XFreeFont(dpy, font);
+ return True;
}
Perhaps somebody else can tell you more about it.. its just
a quick hack :-}
*/
-static void
+static Bool
atari (Display *dpy, Window window, int delay)
{
Pixmap pixmap = 0;
int pix_w = atari_width;
int pix_h = atari_height;
- int offset = atari_width + 2;
+ int offset;
int i, x, y;
+ if (!get_boolean_resource("doAtari", "DoAtari"))
+ return False;
+
XGetWindowAttributes (dpy, window, &xgwa);
font = XLoadQueryFont (dpy, def_font);
gc = XCreateGC(dpy, window, GCFont|GCForeground|GCBackground, &gcv);
pixmap = XCreatePixmapFromBitmapData(dpy, window, (char *) atari_bits,
- atari_width, atari_height,
- gcv.foreground,
- gcv.background,
+ pix_w, pix_h,
+ gcv.foreground, gcv.background,
xgwa.depth);
+ pixmap = double_pixmap(dpy, gc, xgwa.visual, xgwa.depth,
+ pixmap, pix_w, pix_h);
+ pix_w *= 2;
+ pix_h *= 2;
+ offset = pix_w + 2;
x = 5;
y = (xgwa.height - (xgwa.height / 5));
if (y < 0) y = 0;
bsod_sleep(dpy, delay);
XClearWindow(dpy, window);
XFreeFont(dpy, font);
+ return True;
}
-static void
+static Bool
mac (Display *dpy, Window window, int delay)
{
XGCValues gcv;
const char *string = ("0 0 0 0 0 0 0 F\n"
"0 0 0 0 0 0 0 3");
+ if (!get_boolean_resource("doMac", "DoMac"))
+ return False;
+
XGetWindowAttributes (dpy, window, &xgwa);
fontname = get_string_resource ("mac.font", "Mac.Font");
gcv.background,
xgwa.depth);
- draw_string(dpy, window, gc, &gcv, font, 0, 0,
- xgwa.width, xgwa.height + offset, string, 0);
-
for(i = 0; i < 2; i++)
{
pixmap = double_pixmap(dpy, gc, xgwa.visual, xgwa.depth,
XFreePixmap(dpy, pixmap);
}
+ draw_string(dpy, window, gc, &gcv, font, 0, 0,
+ xgwa.width, xgwa.height + offset, string, 0);
+
XFreeGC(dpy, gc);
XSync(dpy, False);
bsod_sleep(dpy, delay);
XClearWindow(dpy, window);
XFreeFont(dpy, font);
+ return True;
}
-static void
+static Bool
macsbug (Display *dpy, Window window, int delay)
{
XGCValues gcv;
const char *s;
int body_lines = 1;
+ if (!get_boolean_resource("doMacsBug", "DoMacsBug"))
+ return False;
+
for (s = body; *s; s++) if (*s == '\n') body_lines++;
XGetWindowAttributes (dpy, window, &xgwa);
XFreeGC(dpy, gc2);
XClearWindow(dpy, window);
XFreeFont(dpy, font);
+ return True;
}
char *progclass = "BSOD";
char *defaults [] = {
- "*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",
-
- ".Atari.foreground: Black",
- ".Atari.background: White",
-
- ".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",
+ "*delay: 30",
+
+ "*doWindows: True",
+ "*doNT: True",
+ "*doAmiga: True",
+ "*doMac: True",
+ "*doAtari: False", /* boring */
+ "*doMacsBug: True",
+ "*doSCO: True",
+ "*doSparcLinux: False", /* boring */
+
+ ".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",
+
+ ".Atari.foreground: Black",
+ ".Atari.background: White",
+
+ ".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",
- ".OpenServer.font: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*",
- ".OpenServer.font2: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
- ".OpenServer.foreground: White",
- ".OpenServer.background: Black",
+ ".SCO.font: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*",
+ ".SCO.font2: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
+ ".SCO.foreground: White",
+ ".SCO.background: Black",
- ".SparcLinux.font: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*",
- ".SparcLinux.font2: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
+ ".SparcLinux.font: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*",
+ ".SparcLinux.font2: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
".SparcLinux.foreground: White",
".SparcLinux.background: Black",
0
{ 0, 0, 0, 0 }
};
+
void
screenhack (Display *dpy, Window window)
{
+ int loop = 0;
int i = -1;
int j = -1;
int delay = get_integer_resource ("delay", "Integer");
while (1)
{
- while (i == j) i = random() % 8;
- j = i;
-
+ Bool did;
+ do { i = (random() & 0xFF) % 8; } while (i == j);
switch (i)
{
- case 0: windows(dpy, window, delay, True); break;
- 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;
- case 5: openserver(dpy, window, delay); break;
- case 6: sparc_linux(dpy, window, delay); break;
- case 7: atari(dpy, window, delay); break;
+ case 0: did = windows(dpy, window, delay, True); break;
+ case 1: did = windows(dpy, window, delay, False); break;
+ case 2: did = amiga(dpy, window, delay); break;
+ case 3: did = mac(dpy, window, delay); break;
+ case 4: did = macsbug(dpy, window, delay); break;
+ case 5: did = sco(dpy, window, delay); break;
+ case 6: did = sparc_linux(dpy, window, delay); break;
+ case 7: did = atari(dpy, window, delay); break;
default: abort(); break;
}
+ loop++;
+ if (loop > 100) j = -1;
+ if (loop > 200) exit(-1);
+ if (!did) continue;
XSync (dpy, True);
+ j = i;
+ loop = 0;
}
}
static void swamp_thing(int);
static void new_rnd_coo(int);
static void init_round_lense(void);
+static void (*draw) (int) = NULL;
+static void reflect_draw(int);
+static void plain_draw(int);
static void init_distort(Display *dpy, Window window)
{
g_window=window;
g_dpy=dpy;
- delay = get_integer_resource ("delay", "Integer");
- radius = get_integer_resource ("radius", "Integer");
- speed = get_integer_resource ("speed", "Integer");
- number = get_integer_resource ("number", "Integer");
+ delay = get_integer_resource("delay", "Integer");
+ radius = get_integer_resource("radius", "Integer");
+ speed = get_integer_resource("speed", "Integer");
+ number = get_integer_resource("number", "Integer");
#ifdef HAVE_XSHM_EXTENSION
use_shm = get_boolean_resource("useSHM", "Boolean");
magnify = get_boolean_resource("magnify", "Boolean");
reflect = get_boolean_resource("reflect", "Boolean");
- if (get_boolean_resource ("swamp", "Boolean"))
+ if (get_boolean_resource("swamp", "Boolean"))
effect = &swamp_thing;
- if (get_boolean_resource ("bounce", "Boolean") || reflect)
+ if (get_boolean_resource("bounce", "Boolean"))
effect = &move_lense;
if (effect == NULL && radius == 0 && speed == 0 && number == 0
* -radius 50 -number 4 -speed 2 -swamp -vortex
* -radius 50 -number 4 -speed 2 -swamp -vortex -magnify
* -radius 50 -number 4 -speed 2 -swamp -vortex -magnify -blackhole
+ * -radius 80 -number 1 -speed 2 -reflect
+ * -radius 50 -number 3 -speed 2 -reflect
*/
- i = (random() % 15);
+ i = (random() % 17);
+
+ draw = &plain_draw;
switch (i) {
case 0:
case 13:
radius=50;number=4;speed=2;vortex=1;magnify=1;
effect=&swamp_thing;break;
- case 14: default:
+ case 14:
radius=50;number=4;speed=2;vortex=1;magnify=1;blackhole=1;
effect=&swamp_thing;break;
+ case 15:
+ radius=80;number=1;speed=2;reflect=1;
+ draw = &reflect_draw;effect = &move_lense;break;
+ case 16: default:
+ radius=50;number=4;speed=2;reflect=1;
+ draw = &reflect_draw;effect = &move_lense;break;
}
}
number=1;
if (effect == NULL)
effect = &move_lense;
+ if (reflect) {
+ draw = &reflect_draw;
+ effect = &move_lense;
+ }
+ if (draw == NULL)
+ draw = &plain_draw;
XGetWindowAttributes (dpy, window, &xgwa);
black_pixel = BlackPixelOfScreen( xgwa.screen );
static void make_round_lense(int radius, int loop)
{
int i, j;
- double theta;
for (i = 0; i < 2*radius+speed+2; i++) {
for(j = 0; j < 2*radius+speed+2; j++) {
/* 2.5 is just a constant used because it looks good :) */
angle = 2.5*(1-d)*(1-d);
-
/* Avoid atan2: DOMAIN error message */
- if ((radius-j) == 0.0 && (radius-i) == 0.0)
- theta = 0.0;
- else
- theta = atan2(radius-j, radius-i);
- from[i][j][0] = radius +
- cos(angle - theta)*r;
- from[i][j][1] = radius +
- sin(angle - theta)*r;
-
+ if ((radius-j) == 0.0 && (radius-i) == 0.0) {
+ from[i][j][0] = radius + cos(angle)*r;
+ from[i][j][1] = radius + sin(angle)*r;
+ } else {
+ from[i][j][0] = radius +
+ cos(angle - atan2(radius-j, -(radius-i)))*r;
+ from[i][j][1] = radius +
+ sin(angle - atan2(radius-j, -(radius-i)))*r;
+ }
if (magnify) {
r = sin(d*M_PI_2);
if (blackhole && r != 0) /* blackhole effect */
* distortion, a negative value sucks everything into a black hole
*/
/* r = r*r; */
- if (blackhole) /* blackhole effect */
+ if (blackhole && r != 0) /* blackhole effect */
r = 1/r;
/* bubble effect (and blackhole) */
from[i][j][0] = radius + (i-radius)*r;
/* generate an XImage of from[][][] and draw it on the screen */
-void draw(int k)
+void plain_draw(int k)
+{
+ int i, j;
+ for(i = 0 ; i < 2*radius+speed+2; i++) {
+ for(j = 0 ; j < 2*radius+speed+2 ; j++) {
+ if (xy_coo[k].x+from[i][j][0] >= 0 &&
+ xy_coo[k].x+from[i][j][0] < xgwa.width &&
+ xy_coo[k].y+from[i][j][1] >= 0 &&
+ xy_coo[k].y+from[i][j][1] < xgwa.height)
+ XPutPixel(buffer_map, i, j,
+ XGetPixel(orig_map,
+ xy_coo[k].x+from[i][j][0],
+ xy_coo[k].y+from[i][j][1]));
+ }
+ }
+
+ XPutImage(g_dpy, g_window, gc, buffer_map, 0, 0, xy_coo[k].x, xy_coo[k].y,
+ 2*radius+speed+2, 2*radius+speed+2);
+}
+
+/* generate an XImage from the reflect algoritm submitted by
+ * Randy Zack <randy@acucorp.com>
+ * draw really got too big and ugly so I split it up
+ * it should be possible to use the from[][] to speed it up
+ * (once I figure out the algorithm used :)
+ */
+void reflect_draw(int k)
{
int i, j;
int cx, cy;
int ly, lysq, lx, ny, dist, rsq = radius * radius;
- if (reflect) {
- cx = cy = radius;
- if (xy_coo[k].ymove > 0)
- cy += speed;
- if (xy_coo[k].xmove > 0)
- cx += speed;
- }
+
+ cx = cy = radius;
+ if (xy_coo[k].ymove > 0)
+ cy += speed;
+ if (xy_coo[k].xmove > 0)
+ cx += speed;
+
for(i = 0 ; i < 2*radius+speed+2; i++) {
- if (reflect) {
- ly = i - cy;
- lysq = ly * ly;
- ny = xy_coo[k].y + i;
- }
+ ly = i - cy;
+ lysq = ly * ly;
+ ny = xy_coo[k].y + i;
for(j = 0 ; j < 2*radius+speed+2 ; j++) {
- if (reflect) {
- lx = j - cx;
- dist = lx * lx + lysq;
- if (dist > rsq ||
- ly < -radius || ly > radius ||
- lx < -radius || lx > radius)
- XPutPixel( buffer_map, j, i,
- XGetPixel( orig_map, xy_coo[k].x + j, ny ));
- else if (dist == 0)
+ lx = j - cx;
+ dist = lx * lx + lysq;
+ if (dist > rsq ||
+ ly < -radius || ly > radius ||
+ lx < -radius || lx > radius)
+ XPutPixel( buffer_map, j, i,
+ XGetPixel( orig_map, xy_coo[k].x + j, ny ));
+ else if (dist == 0)
+ XPutPixel( buffer_map, j, i, black_pixel );
+ else {
+ int x = xy_coo[k].x + cx + (lx * rsq / dist);
+ int y = xy_coo[k].y + cy + (ly * rsq / dist);
+ if (x < 0 || x > xgwa.width ||
+ y < 0 || y > xgwa.height)
XPutPixel( buffer_map, j, i, black_pixel );
- else {
- int x = xy_coo[k].x + cx + (lx * rsq / dist);
- int y = xy_coo[k].y + cy + (ly * rsq / dist);
- if (x < 0 || x > xgwa.width ||
- y < 0 || y > xgwa.height)
- XPutPixel( buffer_map, j, i, black_pixel );
- else
- XPutPixel( buffer_map, j, i,
- XGetPixel( orig_map, x, y ));
- }
- } else if (xy_coo[k].x+from[i][j][0] >= 0 &&
- xy_coo[k].x+from[i][j][0] < xgwa.width &&
- xy_coo[k].y+from[i][j][1] >= 0 &&
- xy_coo[k].y+from[i][j][1] < xgwa.height) {
- XPutPixel(buffer_map, i, j,
- XGetPixel(orig_map,
- xy_coo[k].x+from[i][j][0],
- xy_coo[k].y+from[i][j][1]));
+ else
+ XPutPixel( buffer_map, j, i,
+ XGetPixel( orig_map, x, y ));
}
}
}
for (i = 0; i < number; i++) {
if ((i != k)
-/* This commented test is for rectangular lenses (not presently used) and
+/* This commented test is for rectangular lenses (not currently used) and
* the one used is for circular ones
&& (abs(xy_coo[k].x - xy_coo[i].x) <= 2*radius)
&& (abs(xy_coo[k].y - xy_coo[i].y) <= 2*radius)) { */
-#define atari_width 34
-#define atari_height 28
+#define atari_width 17
+#define atari_height 14
static char atari_bits[] = {
- 0x00,0x0f,0x00,0x00,0xfc,0x00,0x0f,0x00,0x00,0xfc,0xcc,0x30,0x00,0x00,0xfc,
- 0xcc,0x30,0x00,0x00,0xfc,0x00,0xc0,0x00,0x00,0xfc,0x00,0xc0,0x00,0x00,0xfc,
- 0xc3,0x00,0x03,0x00,0xfc,0xc3,0x00,0x03,0x00,0xfc,0x30,0xf0,0x3f,0x00,0xfc,
- 0x30,0xf0,0x3f,0x00,0xfc,0x00,0xf0,0x3f,0x00,0xfc,0x00,0xf0,0x3f,0x00,0xfc,
- 0x00,0xff,0xff,0x03,0xfc,0x00,0xff,0xff,0x03,0xfc,0xc0,0xff,0xff,0x0f,0xfc,
- 0xc0,0xff,0xff,0x0f,0xfc,0xc0,0xf3,0xff,0x0f,0xfc,0xc0,0xf3,0xff,0x0f,0xfc,
- 0xf0,0xff,0xff,0x3f,0xfc,0xf0,0xff,0xff,0x3f,0xfc,0xf0,0xff,0xcf,0x3f,0xfc,
- 0xf0,0xff,0xcf,0x3f,0xfc,0xc0,0xff,0xcf,0x0f,0xfc,0xc0,0xff,0xcf,0x0f,0xfc,
- 0xc0,0xff,0xf3,0x0f,0xfc,0xc0,0xff,0xf7,0x0f,0xfc,0x00,0xff,0xff,0x03,0xfc,
- 0x00,0xff,0xff,0x03,0xfc};
+ 0x30,0x00,0x00,0x4a,0x00,0x00,0x80,0x00,0x00,0x09,0x01,0x00,0xc4,0x07,0x00,
+ 0xc0,0x07,0x00,0xf0,0x1f,0x00,0xf8,0x3f,0x00,0xd8,0x3f,0x00,0xfc,0x7f,0x00,
+ 0xfc,0x7b,0x00,0xf8,0x3b,0x00,0xf8,0x3d,0x00,0xf0,0x1f,0x00};
static const char screensaver_id[] =
- "@(#)xscreensaver 2.34 (08-Oct-98), by Jamie Zawinski (jwz@jwz.org)";
+ "@(#)xscreensaver 3.01 (24-Oct-98), by Jamie Zawinski (jwz@jwz.org)";
Begin3
Title: xscreensaver
-Version: 2.34
-Entered-date: 08OCT98
+Version: 3.01
+Entered-date: 24OCT98
Description: A modular screen saver and locker for the X Window System.
Highly customizable: allows the use of any program that
can draw on the root window as a display mode.
Comes with more than 80 display modes.
- Home page: http://www.jwz.org/xscreensaver/
Keywords: screen saver, screen lock, lock, xlock, X11
Author: jwz@jwz.org (Jamie Zawinski)
Maintained-by: jwz@jwz.org (Jamie Zawinski)
-Primary-site: ftp.x.org /contrib/applications/
- 927K xscreensaver-2.34.tar.gz
- 22K xscreensaver.README
+Primary-site: http://www.jwz.org/xscreensaver/
+ 957K xscreensaver-3.01.tar.gz
+ 24K xscreensaver.README
1K xscreensaver.lsm
Alternate-site: sunsite.unc.edu /pub/Linux/X11/screensavers/
- 927K xscreensaver-2.34.tar.gz
- 22K xscreensaver.README
+ 957K xscreensaver-3.01.tar.gz
+ 24K xscreensaver.README
+ 1K xscreensaver.lsm
+Alternate-site: ftp.x.org /contrib/applications/
+ 957K xscreensaver-3.01.tar.gz
+ 24K xscreensaver.README
1K xscreensaver.lsm
Platforms: Linux, Irix, SunOS, Solaris, HPUX, AIX, FreeBSD, NetBSD,
BSDI, SCO, OSF1, Ultrix, VMS.
Highly customizable: allows the use of any program that
can draw on the root window as a display mode.
Comes with more than 80 display modes.
- Home page: http://www.jwz.org/xscreensaver/
Keywords: screen saver, screen lock, lock, xlock, X11
Author: jwz@jwz.org (Jamie Zawinski)
Maintained-by: jwz@jwz.org (Jamie Zawinski)
-Primary-site: ftp.x.org /contrib/applications/
+Primary-site: http://www.jwz.org/xscreensaver/
$TAR_SIZE xscreensaver-$VERSION.tar.gz
$README_SIZE xscreensaver.README
$LSM_SIZE xscreensaver.lsm
$TAR_SIZE xscreensaver-$VERSION.tar.gz
$README_SIZE xscreensaver.README
$LSM_SIZE xscreensaver.lsm
+Alternate-site: ftp.x.org /contrib/applications/
+ $TAR_SIZE xscreensaver-$VERSION.tar.gz
+ $README_SIZE xscreensaver.README
+ $LSM_SIZE xscreensaver.lsm
Platforms: Linux, Irix, SunOS, Solaris, HPUX, AIX, FreeBSD, NetBSD,
BSDI, SCO, OSF1, Ultrix, VMS.
Requires X11 and ANSI C.