From c31d10b6605cd8dc1a7b61fef4256f06198767e5 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Mon, 2 Mar 2009 00:42:29 -0500 Subject: [PATCH] http://ftp.x.org/contrib/applications/xscreensaver-3.01.tar.gz -rw-r--r-- 1 zblaxell zblaxell 957208 Oct 23 1998 xscreensaver-3.01.tar.gz 80e173a3c061adfeb076f24815b6019910a5bfee xscreensaver-3.01.tar.gz --- Makefile.in | 6 +- README | 30 + README.debugging | 21 +- config.h.in | 6 + configure | 1059 +++++++++++------------ configure.in | 347 ++++---- driver/Makefile.in | 173 ++-- driver/XScreenSaver.ad.in | 243 +++--- driver/XScreenSaver_ad.h | 156 ++-- driver/demo.c | 1409 +++++++++++++++++-------------- driver/dialogs-Xaw.c | 68 +- driver/dialogs-Xm.c | 132 +-- driver/lock.c | 80 +- driver/{dotfile.c => prefs.c} | 441 ++++++++-- driver/prefs.h | 86 ++ driver/remote.c | 441 ++++++++++ driver/remote.h | 24 + driver/setuid.c | 25 +- driver/splash.c | 137 ++- driver/subprocs.c | 187 ++-- driver/test-passwd.c | 210 +---- driver/timers.c | 90 +- driver/windows.c | 222 +++-- driver/xscreensaver-command.c | 413 ++------- driver/xscreensaver-command.man | 70 +- driver/xscreensaver-demo.man | 210 +++++ driver/xscreensaver.c | 792 +++++++---------- driver/xscreensaver.h | 102 +-- driver/xscreensaver.man | 431 +++++----- driver/xset.c | 47 +- hacks/bsod.c | 201 +++-- hacks/distort.c | 153 ++-- hacks/images/atari.xbm | 17 +- utils/version.h | 2 +- xscreensaver.lsm | 19 +- xscreensaver.lsm.sh | 7 +- 36 files changed, 4547 insertions(+), 3510 deletions(-) rename driver/{dotfile.c => prefs.c} (58%) create mode 100644 driver/prefs.h create mode 100644 driver/remote.c create mode 100644 driver/remote.h create mode 100644 driver/xscreensaver-demo.man diff --git a/Makefile.in b/Makefile.in index 89d3a43b..266f4db1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -127,6 +127,7 @@ bump-version:: 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."; \ @@ -193,6 +194,7 @@ test-tar:: echo --------------------------------------------------------------- ; \ ( cd utils; gmake ) ; \ ( cd driver; gmake ) ; \ + ( cd driver; gmake xscreensaver-demo-Xaw ) ; \ echo --------------------------------------------------------------- ); \ \ ( cd BIN/lesstif ; \ @@ -202,9 +204,10 @@ test-tar:: echo --------------------------------------------------------------- ; \ ( cd utils; gmake ) ; \ ( cd driver; gmake ) ; \ + ( cd driver; gmake xscreensaver-demo-Xaw ) ; \ echo --------------------------------------------------------------- ); \ \ - chmod -R u+w . ; \ + chmod -R u+w . www:: @@ -251,6 +254,7 @@ www:: \ (cd ..; $(MAKE) xscreensaver/changelog.html ); \ cvs diff -u0 changelog.html ; \ + set +x ; \ \ echo -n "Ok? "; \ read line; \ diff --git a/README b/README index 5d64fc62..acd0497a 100644 --- a/README +++ b/README @@ -24,6 +24,10 @@ The most important hint is probably this: 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 @@ -73,6 +77,32 @@ http://www.jwz.org/xscreensaver/. ============ +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. diff --git a/README.debugging b/README.debugging index f5ca66eb..31364dbf 100644 --- a/README.debugging +++ b/README.debugging @@ -78,18 +78,15 @@ RUN-TIME PROBLEMS: * 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)? @@ -138,12 +135,12 @@ RUN-TIME PROBLEMS: * 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 @@ -154,7 +151,7 @@ RUN-TIME PROBLEMS: 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 diff --git a/config.h.in b/config.h.in index b0121fd2..98424f9b 100644 --- a/config.h.in +++ b/config.h.in @@ -210,6 +210,12 @@ #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 ************************************************************************* */ diff --git a/configure b/configure index 73a1ef5f..c340a679 100755 --- a/configure +++ b/configure @@ -616,6 +616,11 @@ fi +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 @@ -642,7 +647,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:657: checking host system type" >&5 +echo "configure:662: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -666,7 +671,7 @@ echo "$ac_t""$host" 1>&6 # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure: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 @@ -695,7 +700,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure: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 @@ -743,7 +748,7 @@ fi 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. @@ -753,11 +758,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -777,12 +782,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure: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 @@ -791,7 +796,7 @@ 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 @@ -806,7 +811,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure: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 @@ -836,7 +841,7 @@ fi 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 @@ -860,16 +865,16 @@ fi 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 <&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 @@ -918,7 +923,7 @@ esac 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= @@ -933,13 +938,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure: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 : @@ -950,13 +955,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure: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 : @@ -989,7 +994,7 @@ echo "$ac_t""$CPP" 1>&6 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure: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 @@ -1040,7 +1045,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' 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 >&- @@ -1051,7 +1056,7 @@ echo "configure:1055: checking whether \"\${INSTALL} -d\" creates intermediate d 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 @@ -1066,7 +1071,7 @@ echo "configure:1066: checking whether \"mkdir -p\" creates intermediate directo 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 @@ -1094,12 +1099,12 @@ fi 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 <&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 @@ -1169,21 +1174,21 @@ EOF 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 <&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 @@ -1210,12 +1215,12 @@ esac 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 < #include @@ -1223,7 +1228,7 @@ else #include 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* @@ -1240,7 +1245,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1258,7 +1263,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1279,7 +1284,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1290,7 +1295,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); 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 @@ -1314,12 +1319,12 @@ EOF 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 < #include @@ -1328,7 +1333,7 @@ int main() { 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 @@ -1349,12 +1354,12 @@ EOF 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 < #include @@ -1370,7 +1375,7 @@ wait (&s); 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 @@ -1395,12 +1400,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure: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 < #include <$ac_hdr> @@ -1408,7 +1413,7 @@ int main() { 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 @@ -1433,7 +1438,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure: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 @@ -1441,7 +1446,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -1474,7 +1479,7 @@ fi 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 @@ -1482,7 +1487,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -1517,12 +1522,12 @@ fi 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 < #if STDC_HEADERS @@ -1550,12 +1555,12 @@ EOF 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 < #if STDC_HEADERS @@ -1583,12 +1588,12 @@ EOF 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 < #if STDC_HEADERS @@ -1616,12 +1621,12 @@ EOF 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 < #include @@ -1638,7 +1643,7 @@ int main() { 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 @@ -1658,12 +1663,12 @@ EOF 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 < #include @@ -1672,7 +1677,7 @@ struct timeval tv; struct timezone tzp; 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 @@ -1680,7 +1685,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < #include @@ -1688,7 +1693,7 @@ int main() { 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 @@ -1704,13 +1709,13 @@ rm -f conftest* 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 @@ -1728,12 +1733,12 @@ fi for ac_func in select fcntl uname nice setpriority getcwd getwd putenv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure: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 <&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 @@ -1780,15 +1785,15 @@ 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 <&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 @@ -1840,17 +1845,17 @@ for ac_hdr in unistd.h crypt.h 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 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* @@ -1909,7 +1914,7 @@ fi # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure: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 @@ -1971,12 +1976,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure: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* @@ -2045,14 +2050,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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. @@ -2158,17 +2163,17 @@ else case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure: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 <&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 @@ -2184,14 +2189,14 @@ rm -f conftest* else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_space=yes else @@ -2223,7 +2228,7 @@ rm -f conftest* # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure: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 @@ -2231,7 +2236,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2264,7 +2269,7 @@ fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure: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 @@ -2272,7 +2277,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2312,12 +2317,12 @@ fi # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure: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 <&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 @@ -2361,7 +2366,7 @@ fi 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 @@ -2369,7 +2374,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2410,12 +2415,12 @@ fi # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure: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 <&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 @@ -2459,7 +2464,7 @@ fi 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 @@ -2467,7 +2472,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2502,12 +2507,12 @@ fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure: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 <&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 @@ -2551,7 +2556,7 @@ fi 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 @@ -2559,7 +2564,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2594,12 +2599,12 @@ fi # 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 <&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 @@ -2643,7 +2648,7 @@ fi 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 @@ -2651,7 +2656,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2695,7 +2700,7 @@ fi # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure: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 @@ -2703,7 +2708,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lICE $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -2751,7 +2756,7 @@ fi 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 @@ -2898,7 +2903,7 @@ APPDEFAULTS=$ac_x_app_defaults fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < EOF @@ -2919,7 +2924,7 @@ rm -f conftest* # Check for the availability of the XPointer typedef, and define it otherwise. # echo $ac_n "checking for XPointer""... $ac_c" 1>&6 -echo "configure: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 @@ -2930,14 +2935,14 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < 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 @@ -2951,7 +2956,7 @@ rm -f conftest* 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 @@ -3071,7 +3076,7 @@ case "$host" in # Some versions of Slowlaris Motif require -lgen. But not all. Why? echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6 -echo "configure: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 @@ -3079,7 +3084,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -3127,17 +3132,17 @@ have_xmu=no CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/Xmu/Error.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xmu/Error.h""... $ac_c" 1>&6 -echo "configure: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 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* @@ -3159,7 +3164,7 @@ else 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 @@ -3177,11 +3182,11 @@ fi # 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 @@ -3194,14 +3199,14 @@ else # with X libraries because we know it's SunOS. LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_sunos_xmu_bug=no else @@ -3215,23 +3220,23 @@ rm -f conftest* 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 <&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 @@ -3245,7 +3250,7 @@ rm -f conftest* 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" @@ -3276,7 +3281,7 @@ fi /*) 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" @@ -3286,7 +3291,7 @@ echo "configure:3291: checking for SGI SCREEN_SAVER headers" >&5 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" @@ -3315,7 +3320,7 @@ echo "configure:3301: checking for SGI SCREEN_SAVER libs" >&5 withval= -if test $with_sgi = yes; then +if test "$with_sgi" = yes; then ac_save_CPPFLAGS="$CPPFLAGS" if test \! -z "$includedir" ; then @@ -3324,17 +3329,17 @@ if test $with_sgi = yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/extensions/XScreenSaver.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/extensions/XScreenSaver.h""... $ac_c" 1>&6 -echo "configure: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 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* @@ -3361,7 +3366,7 @@ fi 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 @@ -3387,7 +3392,7 @@ 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" @@ -3397,7 +3402,7 @@ echo "configure:3402: checking for MIT-SCREEN-SAVER headers" >&5 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" @@ -3426,8 +3431,8 @@ echo "configure:3412: checking for MIT-SCREEN-SAVER libs" >&5 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 @@ -3436,17 +3441,17 @@ if test $have_sgi != yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6 -echo "configure: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 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* @@ -3472,25 +3477,25 @@ fi # 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 @@ -3498,7 +3503,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXext -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -3540,27 +3545,27 @@ fi 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 @@ -3568,7 +3573,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXExExt -lX11 -lXext -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -3603,7 +3608,7 @@ fi 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, @@ -3611,21 +3616,21 @@ fi 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 @@ -3633,7 +3638,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXss -lX11 -lXext -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -3668,7 +3673,7 @@ fi 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 @@ -3677,7 +3682,7 @@ 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 @@ -3704,7 +3709,7 @@ 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" @@ -3714,7 +3719,7 @@ echo "configure:3719: checking for XIDLE headers" >&5 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" @@ -3743,7 +3748,7 @@ echo "configure:3729: checking for XIDLE libs" >&5 withval= -if test $with_xidle = yes; then +if test "$with_xidle" = yes; then ac_save_CPPFLAGS="$CPPFLAGS" if test \! -z "$includedir" ; then @@ -3752,17 +3757,17 @@ if test $with_xidle = yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/extensions/xidle.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/extensions/xidle.h""... $ac_c" 1>&6 -echo "configure: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 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* @@ -3788,7 +3793,7 @@ else 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 @@ -3814,7 +3819,7 @@ 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" @@ -3824,7 +3829,7 @@ echo "configure:3829: checking for XSHM headers" >&5 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" @@ -3853,7 +3858,7 @@ echo "configure:3839: checking for XSHM libs" >&5 withval= -if test $with_xshm = yes; then +if test "$with_xshm" = yes; then # first check for Xshm.h. @@ -3864,17 +3869,17 @@ if test $with_xshm = yes; then 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 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* @@ -3898,7 +3903,7 @@ fi 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" @@ -3908,17 +3913,17 @@ fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6 -echo "configure: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 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* @@ -3943,7 +3948,7 @@ fi 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" @@ -3953,17 +3958,17 @@ fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6 -echo "configure: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 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* @@ -3998,21 +4003,21 @@ fi 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 @@ -4020,7 +4025,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXextSam -lX11 -lXext -lm $LIBS" cat > conftest.$ac_ext <&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 @@ -4057,14 +4062,14 @@ fi 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 @@ -4090,7 +4095,7 @@ 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" @@ -4100,7 +4105,7 @@ echo "configure:4105: checking for SGI-VIDEO-CONTROL headers" >&5 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" @@ -4129,7 +4134,7 @@ echo "configure:4115: checking for SGI-VIDEO-CONTROL libs" >&5 withval= -if test $with_sgivc = yes; then +if test "$with_sgivc" = yes; then # first check for XSGIvc.h @@ -4140,17 +4145,17 @@ if test $with_sgivc = yes; then 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 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* @@ -4174,26 +4179,26 @@ fi 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 @@ -4201,7 +4206,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXsgivc -lXext -lX11 $LIBS" cat > conftest.$ac_ext <&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 @@ -4237,14 +4242,14 @@ fi 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 @@ -4270,7 +4275,7 @@ 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" @@ -4280,7 +4285,7 @@ echo "configure:4285: checking for DPMS headers" >&5 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" @@ -4309,7 +4314,7 @@ echo "configure:4295: checking for DPMS libs" >&5 withval= -if test $with_dpms = yes; then +if test "$with_dpms" = yes; then # first check for dpms.h @@ -4320,17 +4325,17 @@ if test $with_dpms = yes; then 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 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* @@ -4354,26 +4359,26 @@ fi 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 @@ -4381,7 +4386,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXdpms -lXext -lX11 $LIBS" cat > conftest.$ac_ext <&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 @@ -4417,14 +4422,14 @@ fi 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 @@ -4455,7 +4460,7 @@ 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" @@ -4465,7 +4470,7 @@ echo "configure:4470: checking for Motif headers" >&5 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" @@ -4510,7 +4515,7 @@ fi /*) 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" @@ -4520,7 +4525,7 @@ echo "configure:4525: checking for Athena headers" >&5 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" @@ -4549,25 +4554,25 @@ echo "configure:4535: checking for Athena libs" >&5 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 @@ -4583,17 +4588,17 @@ check_motif() { CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure: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 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* @@ -4614,7 +4619,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then #define HAVE_MOTIF 1 EOF - SAVER_LIBS="-lXm $SAVER_LIBS" + TOOLKIT_LIBS="-lXm $TOOLKIT_LIBS" else echo "$ac_t""no" 1>&6 fi @@ -4633,17 +4638,17 @@ check_athena() { CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/Xaw/Dialog.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw/Dialog.h""... $ac_c" 1>&6 -echo "configure: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 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* @@ -4665,24 +4670,25 @@ else 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 @@ -4690,7 +4696,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXaw3d -lXt -lXmu -lXext -lX11 $LIBS" cat > conftest.$ac_ext <&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 @@ -4723,11 +4729,12 @@ fi 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 } @@ -4738,20 +4745,20 @@ 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 @@ -4761,7 +4768,7 @@ elif test $with_athena = yes; then else # asked for neither check_motif - if test $have_motif = yes; then + if test "$have_motif" = yes; then with_athena=no else check_athena @@ -4769,15 +4776,15 @@ else 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 @@ -4789,7 +4796,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < EOF @@ -4804,7 +4811,7 @@ rm -f conftest* 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 @@ -4816,9 +4823,9 @@ 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 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 @@ -4829,14 +4836,14 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < 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 @@ -4860,11 +4867,11 @@ unset ac_cv_lesstif_version_string 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 @@ -4879,7 +4886,7 @@ else ac_cv_lesstif_version_string=unknown else cat > conftest.$ac_ext < #include @@ -4892,7 +4899,7 @@ else 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/ .*//'` @@ -4923,26 +4930,26 @@ fi # 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 @@ -4950,7 +4957,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXp -lX11 -lXext -lm $LIBS" cat > conftest.$ac_ext <&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 @@ -4976,7 +4983,7 @@ LIBS="$ac_save_LIBS" 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 @@ -5006,7 +5013,7 @@ 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" @@ -5016,7 +5023,7 @@ echo "configure:5021: checking for XPM headers" >&5 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" @@ -5045,7 +5052,7 @@ echo "configure:5031: checking for XPM libs" >&5 withval= -if test $with_xpm = yes; then +if test "$with_xpm" = yes; then ac_save_CPPFLAGS="$CPPFLAGS" if test \! -z "$includedir" ; then @@ -5054,17 +5061,17 @@ if test $with_xpm = yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6 -echo "configure: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 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* @@ -5091,7 +5098,7 @@ else 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 @@ -5118,7 +5125,7 @@ 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" @@ -5128,7 +5135,7 @@ echo "configure:5133: checking for GL headers" >&5 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" @@ -5160,7 +5167,7 @@ echo "configure:5143: checking for GL libs" >&5 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 @@ -5169,17 +5176,17 @@ if test $with_gl = yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6 -echo "configure: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 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* @@ -5201,7 +5208,7 @@ else 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 @@ -5210,17 +5217,17 @@ fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6 -echo "configure: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 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* @@ -5246,7 +5253,7 @@ 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 cat >> confdefs.h <<\EOF #define HAVE_GL 1 @@ -5257,7 +5264,7 @@ EOF # 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 @@ -5269,7 +5276,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < EOF @@ -5287,7 +5294,7 @@ fi 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 @@ -5303,26 +5310,36 @@ EOF # 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 < #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 @@ -5331,6 +5348,10 @@ EOF 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 @@ -5348,21 +5369,21 @@ fi 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 @@ -5370,7 +5391,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS" cat > conftest.$ac_ext <&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 @@ -5409,7 +5430,7 @@ fi 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 @@ -5435,7 +5456,7 @@ 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" @@ -5445,7 +5466,7 @@ echo "configure:5450: checking for XReadDisplay headers" >&5 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" @@ -5474,7 +5495,7 @@ echo "configure:5460: checking for XReadDisplay libs" >&5 withval= -if test $with_readdisplay = yes; then +if test "$with_readdisplay" = yes; then ac_save_CPPFLAGS="$CPPFLAGS" if test \! -z "$includedir" ; then @@ -5483,17 +5504,17 @@ if test $with_readdisplay = yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6 -echo "configure: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 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* @@ -5518,7 +5539,7 @@ else 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 @@ -5544,7 +5565,7 @@ 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" @@ -5554,7 +5575,7 @@ echo "configure:5559: checking for Iris Video headers" >&5 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" @@ -5583,7 +5604,7 @@ echo "configure:5569: checking for Iris Video libs" >&5 withval= -if test $with_sgivideo = yes; then +if test "$with_sgivideo" = yes; then ac_save_CPPFLAGS="$CPPFLAGS" if test \! -z "$includedir" ; then @@ -5592,17 +5613,17 @@ if test $with_sgivideo = yes; 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 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* @@ -5624,10 +5645,10 @@ else 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 @@ -5635,7 +5656,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lvl $LIBS" cat > conftest.$ac_ext <&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 @@ -5666,7 +5687,7 @@ 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 @@ -5675,7 +5696,7 @@ 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 @@ -5714,7 +5735,7 @@ if test -n "$with_zippy_req" ; then 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 @@ -5728,7 +5749,7 @@ echo "configure:5729: checking for $with_zippy_req" >&5 # 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 @@ -5774,7 +5795,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure: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 @@ -5807,7 +5828,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure: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 @@ -5841,7 +5862,7 @@ done 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. # @@ -5851,7 +5872,7 @@ echo "configure:5856: checking for emacs yow" >&5 # # 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 @@ -5863,7 +5884,7 @@ echo "configure:5856: checking for emacs yow" >&5 if test -z "$ac_cv_zippy_program" ; then echo $ac_n "checking for xemacs yow""... $ac_c" 1>&6 -echo "configure: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. @@ -5874,7 +5895,7 @@ echo "configure:5878: checking for xemacs yow" >&5 # # 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 @@ -5909,7 +5930,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure: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 @@ -5944,7 +5965,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure: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 @@ -6008,9 +6029,9 @@ 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 @@ -6034,15 +6055,15 @@ else 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 < #include @@ -6051,7 +6072,7 @@ int main() { 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 @@ -6066,25 +6087,26 @@ fi 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. # @@ -6104,7 +6126,7 @@ fi /*) 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" @@ -6114,7 +6136,7 @@ echo "configure:6119: checking for Kerberos headers" >&5 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" @@ -6143,9 +6165,9 @@ echo "configure:6129: checking for Kerberos libs" >&5 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 @@ -6156,14 +6178,14 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < 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 @@ -6177,7 +6199,7 @@ rm -f conftest* 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 @@ -6187,12 +6209,12 @@ EOF # from Tim Showalter 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 <&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 @@ -6233,7 +6255,7 @@ if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then 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 @@ -6241,7 +6263,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&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 @@ -6278,7 +6300,7 @@ fi 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 @@ -6302,7 +6324,7 @@ 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" @@ -6312,7 +6334,7 @@ echo "configure:6317: checking for shadow password headers" >&5 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" @@ -6341,9 +6363,9 @@ echo "configure:6327: checking for shadow password libs" >&5 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 @@ -6351,9 +6373,9 @@ echo "configure:6327: checking for shadow password libs" >&5 # 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 @@ -6364,7 +6386,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < #include @@ -6377,7 +6399,7 @@ struct passwd_adjunct *p = getpwanam("nobody"); 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 @@ -6391,7 +6413,7 @@ rm -f conftest* 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 @@ -6404,9 +6426,9 @@ EOF # 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 @@ -6417,7 +6439,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < #include @@ -6434,7 +6456,7 @@ struct pr_passwd *p; 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 @@ -6460,7 +6482,7 @@ EOF # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx) # (I'm told it needs -lcurses too, but I don't understand why.) echo $ac_n "checking for getprpwnam in -lprot""... $ac_c" 1>&6 -echo "configure: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 @@ -6468,7 +6490,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lprot -lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -6499,7 +6521,7 @@ else echo "$ac_t""no" 1>&6 # On DEC, getprpwnam() is in -lsecurity echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6 -echo "configure: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 @@ -6507,7 +6529,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsecurity $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -6545,9 +6567,9 @@ fi # 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 @@ -6558,7 +6580,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < #include @@ -6571,7 +6593,7 @@ struct s_passwd *p = getspwnam("nobody"); 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 @@ -6585,7 +6607,7 @@ rm -f conftest* 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 @@ -6596,7 +6618,7 @@ EOF # 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 @@ -6604,7 +6626,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsec $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -6640,9 +6662,9 @@ fi # 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 @@ -6653,7 +6675,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < #include @@ -6665,7 +6687,7 @@ struct spwd *p = getspnam("nobody"); 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 @@ -6679,7 +6701,7 @@ rm -f conftest* 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 @@ -6691,7 +6713,7 @@ EOF # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc. have_getspnam=no echo $ac_n "checking for getspnam in -lc""... $ac_c" 1>&6 -echo "configure: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 @@ -6699,7 +6721,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -6730,9 +6752,9 @@ 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 @@ -6740,7 +6762,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -6780,9 +6802,9 @@ 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 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 @@ -6794,7 +6816,7 @@ 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 @@ -6803,7 +6825,7 @@ echo "$ac_t""$ac_cv_master_passwd" 1>&6 # 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 @@ -6811,7 +6833,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -6842,9 +6864,9 @@ 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 @@ -6852,7 +6874,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure: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 @@ -6890,7 +6912,7 @@ 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 @@ -6919,26 +6941,26 @@ DEPEND_DEFINES= # 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 @@ -6946,7 +6968,7 @@ 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 @@ -6954,7 +6976,7 @@ 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 @@ -6963,13 +6985,11 @@ 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 @@ -7013,7 +7033,7 @@ warning=no warnsep=' #################################################################' warnpre() { - if test $warning = no ; then + if test "$warning" = no ; then echo '' ; echo "$warnsep" ; echo '' warning=yes fi @@ -7021,7 +7041,7 @@ warnpre() { warn() { warnpre - if test $warning = long ; then echo '' ; fi + if test "$warning" = long ; then echo '' ; fi warning=yes echo "$warn_prefix $@" } @@ -7030,7 +7050,7 @@ warnL() { was=$warning warnpre warning=yes - if test $was != no ; then echo '' ; fi + if test "$was" != no ; then echo '' ; fi echo "$warn_prefix $@" } @@ -7052,49 +7072,50 @@ noteL() { } -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 ." @@ -7108,24 +7129,24 @@ if test $have_motif = yes -a $have_lesstif = yes ; then 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 ." + 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 ." 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" @@ -7134,10 +7155,10 @@ if test $have_gl = yes -a $ac_have_mesa_gl = yes ; then 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.' @@ -7151,10 +7172,10 @@ if test $have_xpm = no ; then warn2 'X11 archive sites, such as .' 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.' @@ -7171,19 +7192,19 @@ if test $have_gl = no ; then 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 @@ -7194,7 +7215,7 @@ if test -n "$with_zippy_req"; then fi fi -if test $warning != no; then +if test "$warning" != no; then echo '' ; echo "$warnsep" ; echo '' fi @@ -7355,6 +7376,7 @@ s%@xemacs_exe@%$xemacs_exe%g 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 @@ -7364,8 +7386,8 @@ s%@INSTALL_DIRS@%$INSTALL_DIRS%g s%@NEED_SETUID@%$NEED_SETUID%g s%@SGI_VIDEO_OBJS@%$SGI_VIDEO_OBJS%g s%@SGI_VIDEO_LIBS@%$SGI_VIDEO_LIBS%g -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 @@ -7373,8 +7395,7 @@ s%@XMU_OBJS@%$XMU_OBJS%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 @@ -7624,9 +7645,9 @@ eval HACKDIR=${HACKDIR} echo "" echo "$warnsep" echo "" -echo ' When you run "make install", the "xscreensaver" and' -echo ' "xscreensaver-command" executables will be installed in' -echo " ${bindir}." +echo ' 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}." diff --git a/configure.in b/configure.in index d636d21e..62495c42 100644 --- a/configure.in +++ b/configure.in @@ -2,6 +2,11 @@ # AC_INIT(driver/subprocs.c) + +echo -n "current directory: " +pwd +echo "command line was: $0 $@" + AC_CONFIG_HEADER(config.h) AC_CANONICAL_HOST @@ -129,10 +134,10 @@ AC_CACHE_VAL(ac_cv_gettimeofday_args, [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) @@ -142,7 +147,7 @@ fi 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) @@ -322,19 +327,19 @@ AC_DEFUN(AC_TRY_X_COMPILE, [ 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"]) @@ -428,7 +433,7 @@ AC_CACHE_CHECK([for XPointer], ac_cv_xpointer, [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 @@ -555,7 +560,7 @@ esac # 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 @@ -570,7 +575,7 @@ fi # 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], @@ -587,14 +592,14 @@ if test $have_xmu = yes ; then [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" @@ -624,12 +629,12 @@ X Server Extension options: 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 @@ -647,17 +652,17 @@ AC_ARG_WITH(mit-ext, 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, @@ -665,7 +670,7 @@ if test $have_sgi != yes; then [], -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, @@ -675,13 +680,13 @@ if test $have_sgi != yes; then [], -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 @@ -700,11 +705,11 @@ AC_ARG_WITH(xidle-ext, 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 @@ -722,19 +727,19 @@ AC_ARG_WITH(xshm-ext, 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 @@ -754,11 +759,11 @@ if test $with_xshm = yes; then 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 @@ -776,13 +781,13 @@ AC_ARG_WITH(sgivc-ext, 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"], [], @@ -790,11 +795,11 @@ if test $with_sgivc = yes; then 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 @@ -812,13 +817,13 @@ AC_ARG_WITH(dpms-ext, 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"], [], @@ -826,11 +831,11 @@ if test $with_dpms = yes; then 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 @@ -863,25 +868,25 @@ AC_ARG_WITH(athena, 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 @@ -892,21 +897,23 @@ check_motif() { 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 } @@ -917,20 +924,20 @@ check_athena() { # 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 @@ -940,7 +947,7 @@ elif test $with_athena = yes; then else # asked for neither check_motif - if test $have_motif = yes; then + if test "$have_motif" = yes; then with_athena=no else check_athena @@ -948,20 +955,20 @@ else 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 @@ -970,7 +977,7 @@ 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 ], @@ -987,7 +994,7 @@ unset ac_cv_lesstif_version_string 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], @@ -1021,10 +1028,10 @@ fi # 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 @@ -1043,12 +1050,12 @@ Graphics Demo options: 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 @@ -1070,15 +1077,15 @@ HANDLE_X_PATH_ARG(with_gl, --with-gl, GL) 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) @@ -1093,7 +1100,7 @@ if test $with_gl = yes; then 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 @@ -1106,7 +1113,7 @@ if test $with_gl = yes; then # 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 @@ -1121,8 +1128,18 @@ if test $with_gl = yes; then #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 @@ -1131,6 +1148,10 @@ EOF 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 @@ -1148,7 +1169,7 @@ EOF 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 @@ -1167,10 +1188,10 @@ AC_ARG_WITH(readdisplay, 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 @@ -1189,18 +1210,18 @@ AC_ARG_WITH(sgivideo, 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 @@ -1281,7 +1302,7 @@ if test ! -n "$ac_cv_zippy_program"; then # # 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) @@ -1303,7 +1324,7 @@ if test ! -n "$ac_cv_zippy_program"; then # # 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) @@ -1366,9 +1387,9 @@ Screen Locking options: (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" @@ -1388,9 +1409,9 @@ AC_ARG_ENABLE(vt-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 #include @@ -1401,22 +1422,23 @@ if test $enable_vt_locking = yes; then 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. # @@ -1428,12 +1450,12 @@ if test $enable_locking = yes; then 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 ],, [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) @@ -1445,7 +1467,7 @@ if test $enable_locking = yes; then )) 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 @@ -1462,9 +1484,9 @@ if test $enable_locking = yes; then 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 @@ -1472,7 +1494,7 @@ if test $enable_locking = yes; then # 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 #include @@ -1484,7 +1506,7 @@ if test $enable_locking = yes; then 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 @@ -1494,7 +1516,7 @@ if test $enable_locking = yes; then # 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 #include @@ -1529,7 +1551,7 @@ if test $enable_locking = yes; then # 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 #include @@ -1541,7 +1563,7 @@ if test $enable_locking = yes; then 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 @@ -1554,7 +1576,7 @@ if test $enable_locking = yes; then # 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 #include @@ -1565,7 +1587,7 @@ if test $enable_locking = yes; then 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 @@ -1574,7 +1596,7 @@ if test $enable_locking = yes; then # 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 @@ -1586,14 +1608,14 @@ if test $enable_locking = yes; then # 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 @@ -1602,7 +1624,7 @@ if test $enable_locking = yes; then # 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 @@ -1612,7 +1634,7 @@ if test $enable_locking = yes; then # 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 @@ -1641,20 +1663,20 @@ DEPEND_DEFINES= # 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 @@ -1662,7 +1684,7 @@ 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 @@ -1670,7 +1692,7 @@ 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 @@ -1679,18 +1701,17 @@ 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) @@ -1701,8 +1722,8 @@ AC_SUBST(NEED_SETUID) 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) @@ -1710,8 +1731,7 @@ AC_SUBST(XMU_OBJS) 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) @@ -1729,7 +1749,7 @@ warning=no warnsep=' #################################################################' warnpre() { - if test $warning = no ; then + if test "$warning" = no ; then echo '' ; echo "$warnsep" ; echo '' warning=yes fi @@ -1737,7 +1757,7 @@ warnpre() { warn() { warnpre - if test $warning = long ; then echo '' ; fi + if test "$warning" = long ; then echo '' ; fi warning=yes echo "$warn_prefix $@" } @@ -1746,7 +1766,7 @@ warnL() { was=$warning warnpre warning=yes - if test $was != no ; then echo '' ; fi + if test "$was" != no ; then echo '' ; fi echo "$warn_prefix $@" } @@ -1768,49 +1788,50 @@ noteL() { } -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 ." @@ -1824,24 +1845,24 @@ if test $have_motif = yes -a $have_lesstif = yes ; then 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 ." + 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 ." 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" @@ -1850,10 +1871,10 @@ if test $have_gl = yes -a $ac_have_mesa_gl = yes ; then 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.' @@ -1867,10 +1888,10 @@ if test $have_xpm = no ; then warn2 'X11 archive sites, such as .' 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.' @@ -1887,19 +1908,19 @@ if test $have_gl = no ; then 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 @@ -1910,7 +1931,7 @@ if test -n "$with_zippy_req"; then fi fi -if test $warning != no; then +if test "$warning" != no; then echo '' ; echo "$warnsep" ; echo '' fi @@ -1941,9 +1962,9 @@ eval HACKDIR=${HACKDIR} echo "" echo "$warnsep" echo "" -echo ' When you run "make install", the "xscreensaver" and' -echo ' "xscreensaver-command" executables will be installed in' -echo " ${bindir}." +echo ' 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}." diff --git a/driver/Makefile.in b/driver/Makefile.in index 148883d7..a5ad3712 100644 --- a/driver/Makefile.in +++ b/driver/Makefile.in @@ -61,7 +61,6 @@ UTILS_BIN = ../utils INCLUDES = -I. -I$(srcdir) -I$(UTILS_SRC) -I.. @INCLUDES@ -PASSWD_LIBS = @PASSWD_LIBS@ MOTIF_SRCS = dialogs-Xm.c MOTIF_OBJS = dialogs-Xm.o @@ -79,47 +78,67 @@ LOCK_OBJS_1 = lock.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 \ @@ -127,7 +146,8 @@ VMSFILES = compile_axp.com compile_decc.com link_axp.com link_decc.com \ 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) @@ -157,13 +177,14 @@ install-program: $(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 @@ -218,7 +239,7 @@ distdepend: update_ad_version update_man_version XScreenSaver_ad.h -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' \ @@ -319,9 +340,13 @@ xscreensaver: $(SAVER_OBJS) 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 @@ -334,44 +359,68 @@ test-uid: test-uid.o 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 @@ -379,7 +428,29 @@ dialogs-Xaw.o: $(UTILS_SRC)/visual.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 diff --git a/driver/XScreenSaver.ad.in b/driver/XScreenSaver.ad.in index daec6ff4..ba06bb85 100644 --- a/driver/XScreenSaver.ad.in +++ b/driver/XScreenSaver.ad.in @@ -4,12 +4,19 @@ ! 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 @@ -32,11 +39,18 @@ *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, @@ -55,7 +69,12 @@ ! ! 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 @@ -93,6 +112,7 @@ jigsaw -root \n\ blitspin -root -grab \n\ slip -root \n\ + distort -root \n\ hypercube -root \n\ halo -root \n\ maze -root \n\ @@ -136,6 +156,7 @@ vines -root \n\ kaleidescope -root \n\ xjack -root \n\ + - xlyap -root -randomize \n\ cynosure -root \n\ flow -root \n\ epicycle -root \n\ @@ -145,6 +166,8 @@ 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\ @@ -157,26 +180,23 @@ 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. @@ -282,7 +302,14 @@ !============================================================================= -! 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 @@ -319,15 +346,12 @@ *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. @@ -338,11 +362,10 @@ XScreenSaver*XmList.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1 *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 @@ -358,10 +381,10 @@ XScreenSaver*XmDialogShell*rogerLabel.background: #FFFFFF *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 @@ -369,53 +392,50 @@ XScreenSaver*XmDialogShell*rogerLabel.background: #FFFFFF *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 -*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 @@ -425,76 +445,63 @@ 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 +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\ - 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\ + 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 -*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 diff --git a/driver/XScreenSaver_ad.h b/driver/XScreenSaver_ad.h index 680d8619..61de93c4 100644 --- a/driver/XScreenSaver_ad.h +++ b/driver/XScreenSaver_ad.h @@ -18,8 +18,10 @@ "*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\ @@ -40,6 +42,7 @@ jigsaw -root \\n\ blitspin -root -grab \\n\ slip -root \\n\ + distort -root \\n\ hypercube -root \\n\ halo -root \\n\ maze -root \\n\ @@ -83,6 +86,7 @@ vines -root \\n\ kaleidescope -root \\n\ xjack -root \\n\ + - xlyap -root -randomize \\n\ cynosure -root \\n\ flow -root \\n\ epicycle -root \\n\ @@ -92,6 +96,8 @@ 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\ @@ -104,9 +110,6 @@ 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\ @@ -125,6 +128,10 @@ 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", @@ -159,10 +166,7 @@ "*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", @@ -170,9 +174,10 @@ "*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", @@ -185,48 +190,42 @@ "*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 ", -"*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", @@ -234,63 +233,52 @@ "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\ 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 ", -"*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", diff --git a/driver/demo.c b/driver/demo.c index c7a12ba3..e92e9617 100644 --- a/driver/demo.c +++ b/driver/demo.c @@ -14,6 +14,29 @@ # include "config.h" #endif +#ifdef HAVE_ATHENA_KLUDGE /* don't ask */ +# undef HAVE_MOTIF +# define HAVE_ATHENA 1 +#endif + +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifndef VMS +# include /* for getpwuid() */ +#else /* VMS */ +# include "vms-pwd.h" +#endif /* VMS */ + +#ifdef HAVE_UNAME +# include /* for uname() */ +#endif /* HAVE_UNAME */ + +#include + #include #include @@ -27,6 +50,9 @@ # include # include # include +# include +# include +# include #else /* HAVE_ATHENA */ /* Athena demo code contributed by Jon A. Christopher */ @@ -43,18 +69,42 @@ # include #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 #include #include -#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; @@ -63,12 +113,12 @@ extern Widget demo_form; 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; @@ -152,11 +202,11 @@ set_label_string (Widget label_widget, char *string) } -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"); @@ -169,119 +219,6 @@ format_into_label (Widget label, const char *arg) } -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[] = ("Return: done()\n" - "Linefeed: done()\n" - "CtrlM: done()\n" - "CtrlJ: 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 @@ -365,272 +302,326 @@ ensure_selected_item_visible (Widget list) } +/* 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[] = ("Return: done()\n" + "Linefeed: done()\n" + "CtrlM: done()\n" + "CtrlJ: 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++) @@ -640,32 +631,6 @@ make_screenhack_dialog (saver_info *si) 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. */ @@ -682,11 +647,9 @@ make_screenhack_dialog (saver_info *si) 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. @@ -707,7 +670,6 @@ make_screenhack_dialog (saver_info *si) /* 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. */ @@ -732,11 +694,7 @@ make_screenhack_dialog (saver_info *si) #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. */ @@ -745,21 +703,20 @@ make_screenhack_dialog (saver_info *si) } -/* 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 @@ -767,22 +724,34 @@ hack_time_cb (Display *dpy, char *line, int *store, Bool sec_p) } } + +/* 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; @@ -796,136 +765,88 @@ res_int_cb (Widget button, XtPointer client_data, XtPointer call_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)) @@ -934,44 +855,55 @@ make_resources_dialog (saver_info *si, Widget parent) #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) { @@ -983,173 +915,406 @@ fmt_time (char *buf, unsigned int s, int min_p) 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); } - -/* 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) + + +/* 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 = ""; + else + lhost = uts.nodename; +# elif defined(VMS) + strcpy (lhost, getenv("SYS$NODE")); +# else /* !HAVE_UNAME && !VMS */ + strcat (lhost, ""); +# 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); } diff --git a/driver/dialogs-Xaw.c b/driver/dialogs-Xaw.c index 5b652b11..757a91eb 100644 --- a/driver/dialogs-Xaw.c +++ b/driver/dialogs-Xaw.c @@ -33,21 +33,21 @@ #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; @@ -68,41 +68,39 @@ static Widget buttonbox, textbox, okbox; 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, @@ -127,29 +125,29 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) 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, @@ -158,7 +156,7 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) verbose_toggle = XtVaCreateManagedWidget("verbose", toggleWidgetClass, buttonbox, NULL); - cmap_toggle = + install_cmap_toggle = XtVaCreateManagedWidget("cmap", toggleWidgetClass, buttonbox, NULL); fade_toggle = @@ -172,9 +170,9 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) 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); } @@ -186,8 +184,6 @@ create_demo_dialog(Widget parent, Visual *visual, Colormap colormap) demo_dialog = XtVaCreatePopupShell("demo_dialog", transientShellWidgetClass, parent, - XtNtitle, NULL, - XtNoverrideRedirect, TRUE, XtNvisual, visual, XtNcolormap, colormap, XtNdepth, depth, @@ -195,9 +191,12 @@ create_demo_dialog(Widget parent, Visual *visual, Colormap colormap) 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, @@ -217,6 +216,7 @@ create_demo_dialog(Widget parent, Visual *visual, Colormap colormap) XtNleft, XtChainLeft, XtNright, XtChainRight, XtNfromVert, label2, + XtNresizable, True, NULL); viewport = XtVaCreateManagedWidget("viewport", viewportWidgetClass, subform, @@ -252,6 +252,8 @@ create_demo_dialog(Widget parent, Visual *visual, Colormap colormap) 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); } diff --git a/driver/dialogs-Xm.c b/driver/dialogs-Xm.c index 22aa9705..930b7b72 100644 --- a/driver/dialogs-Xm.c +++ b/driver/dialogs-Xm.c @@ -40,21 +40,21 @@ #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; @@ -72,7 +72,7 @@ Widget restart; 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 */ @@ -95,8 +95,8 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) 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); @@ -112,56 +112,56 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) 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++; @@ -226,43 +226,43 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) 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; @@ -306,29 +306,29 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) 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++; @@ -356,7 +356,7 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) 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++; @@ -367,7 +367,7 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) 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 ); @@ -375,10 +375,10 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) 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++; @@ -389,10 +389,10 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) 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++; @@ -403,7 +403,7 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) 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++; @@ -427,11 +427,11 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) 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; @@ -440,7 +440,7 @@ create_resources_dialog(Widget parent, Visual *visual, Colormap colormap) XtManageChildren(children, ac); ac = 0; - resources_form = real_dialog; + preferences_form = real_dialog; } @@ -522,12 +522,16 @@ create_demo_dialog(Widget parent, Visual *visual, Colormap colormap) 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++; diff --git a/driver/lock.c b/driver/lock.c index 7a3ed6a2..c8759783 100644 --- a/driver/lock.c +++ b/driver/lock.c @@ -23,6 +23,10 @@ #include "xscreensaver.h" #include "resources.h" +#ifdef HAVE_SYSLOG +# include +#endif /* HAVE_SYSLOG */ + #ifdef _VROOT_H_ ERROR! You must not include vroot.h in this file. #endif @@ -48,7 +52,7 @@ vms_passwd_valid_p(char *pw) #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 { @@ -698,6 +702,8 @@ handle_passwd_key (saver_info *si, XKeyEvent *event) ; /* 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; @@ -726,6 +732,7 @@ handle_passwd_key (saver_info *si, XKeyEvent *event) static void passwd_event_loop (saver_info *si) { + saver_preferences *p = &si->prefs; char *msg = 0; XEvent event; passwd_animate_timer ((XtPointer) si, 0); @@ -744,10 +751,76 @@ passwd_event_loop (saver_info *si) 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; @@ -765,13 +838,18 @@ passwd_event_loop (saver_info *si) } } + 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); diff --git a/driver/dotfile.c b/driver/prefs.c similarity index 58% rename from driver/dotfile.c rename to driver/prefs.c index cba794b6..306e694a 100644 --- a/driver/dotfile.c +++ b/driver/prefs.c @@ -14,8 +14,17 @@ # include "config.h" #endif -#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include +#include +#include #include +#include #include #include @@ -34,8 +43,6 @@ #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 @@ -55,7 +62,20 @@ #endif -static const char * +#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; @@ -72,7 +92,7 @@ init_file_name (void) } else if (!p->pw_dir || !*p->pw_dir) { - fprintf (stderr, "%s: couldn't get home directory of %s\n", + fprintf (stderr, "%s: couldn't get home directory of \"%s\"\n", blurb(), (p->pw_name ? p->pw_name : "???")); file = ""; } @@ -133,6 +153,8 @@ static const char * const prefs[] = { "timestamp", "splash", /* not saved -- same as "splashDuration: 0" */ "splashDuration", + "demoCommand", + "prefsCommand", "helpURL", "loadURL", "nice", @@ -159,7 +181,8 @@ static const char * const prefs[] = { 0 }; -static char *strip(char *s) +static char * +strip (char *s) { char *s2; while (*s == '\t' || *s == ' ' || *s == '\r' || *s == '\n') @@ -179,7 +202,7 @@ static char *strip(char *s) */ static int -handle_entry (saver_info *si, const char *key, const char *value, +handle_entry (XrmDatabase *db, const char *key, const char *value, const char *filename, int line) { int i; @@ -192,7 +215,7 @@ handle_entry (saver_info *si, const char *key, const char *value, strcat(spec, "."); strcat(spec, prefs[i]); - XrmPutStringResource (&si->db, spec, val); + XrmPutStringResource (db, spec, val); free(spec); free(val); @@ -204,8 +227,9 @@ handle_entry (saver_info *si, const char *key, const char *value, return 1; } -int -read_init_file (saver_info *si) + +static int +parse_init_file (saver_preferences *p) { time_t write_date = 0; const char *name = init_file_name(); @@ -219,7 +243,7 @@ read_init_file (saver_info *si) if (stat(name, &st) != 0) { - si->init_file_date = 0; + p->init_file_date = 0; return 0; } @@ -227,7 +251,7 @@ read_init_file (saver_info *si) if (!in) { char *buf = (char *) malloc(1024 + strlen(name)); - sprintf(buf, "%s: error reading %s", blurb(), name); + sprintf(buf, "%s: error reading \"%s\"", blurb(), name); perror(buf); free(buf); return -1; @@ -240,7 +264,7 @@ read_init_file (saver_info *si) else { char *buf = (char *) malloc(1024 + strlen(name)); - sprintf(buf, "%s: couldn't re-stat %s", blurb(), name); + sprintf(buf, "%s: couldn't re-stat \"%s\"", blurb(), name); perror(buf); free(buf); return -1; @@ -311,38 +335,31 @@ read_init_file (saver_info *si) value = strip(value); } - handle_entry (si, key, value, name, line); + if (!p->db) abort(); + handle_entry (&p->db, key, value, name, line); } free(buf); - si->init_file_date = write_date; + p->init_file_date = write_date; return 0; } -int -maybe_reload_init_file (saver_info *si) +Bool +init_file_changed_p (saver_preferences *p) { - saver_preferences *p = &si->prefs; const char *name = init_file_name(); struct stat st; - int status = 0; - if (!name) return 0; + if (!name) return False; if (stat(name, &st) != 0) - return 0; + return False; - 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); + if (p->init_file_date == st.st_mtime) + return False; - status = read_init_file (si); - if (status == 0) - get_resources (si); - return status; + return True; } @@ -386,6 +403,23 @@ write_entry (FILE *out, const char *key, const char *value) 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 @@ -395,10 +429,11 @@ write_entry (FILE *out, const char *key, const char *value) col = 0; } - v2 = strip(v2); - nl = strchr(v2, '\n'); - if (nl) - *nl = 0; + if (disabled_p) + { + fprintf(out, "-"); + col++; + } s = (do_visual_kludge ? strpbrk(v2, " \t\n:") : 0); if (s && *s == ':') @@ -451,13 +486,12 @@ write_entry (FILE *out, const char *key, const char *value) free(v); } -int -write_init_file (saver_info *si) +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; - saver_preferences *p = &si->prefs; int i, j; /* Kludge, since these aren't in the saver_preferences struct as strings... @@ -469,17 +503,7 @@ write_init_file (saver_info *si) 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 (!name) return; if (p->verbose_p) fprintf (stderr, "%s: writing \"%s\".\n", blurb(), name); @@ -489,10 +513,10 @@ write_init_file (saver_info *si) if (!out) { char *buf = (char *) malloc(1024 + strlen(name)); - sprintf(buf, "%s: error writing %s", blurb(), name); + sprintf(buf, "%s: error writing \"%s\"", blurb(), name); perror(buf); free(buf); - return -1; + return; } /* Give the new .xscreensaver file the same permissions as the old one; @@ -507,11 +531,11 @@ write_init_file (saver_info *si) if (fchmod (fileno(out), mode) != 0) { char *buf = (char *) malloc(1024 + strlen(name)); - sprintf (buf, "%s: error fchmodding %s to 0%o", blurb(), + sprintf (buf, "%s: error fchmodding \"%s\" to 0%o", blurb(), tmp_name, (unsigned int) mode); perror(buf); free(buf); - return -1; + return; } } @@ -538,17 +562,20 @@ write_init_file (saver_info *si) } { - struct passwd *p = getpwuid (getuid ()); - char *whoami = (p && p->pw_name && *p->pw_name - ? p->pw_name : ""); - fprintf (out, + struct passwd *pw = getpwuid (getuid ()); + char *whoami = (pw && pw->pw_name && *pw->pw_name + ? pw->pw_name + : ""); + 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, si->version, - (whoami ? whoami : ""), - timestring()); + progclass, progname, version_string, whoami, timestr); } for (j = 0; prefs[j]; j++) @@ -587,6 +614,8 @@ write_init_file (saver_info *si) 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; @@ -663,36 +692,314 @@ write_init_file (saver_info *si) else { char *buf = (char *) malloc(1024 + strlen(tmp_name) + strlen(name)); - sprintf(buf, "%s: couldn't stat %s", blurb(), tmp_name); + sprintf(buf, "%s: couldn't stat \"%s\"", blurb(), tmp_name); perror(buf); unlink (tmp_name); free(buf); - return -1; + 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); + sprintf(buf, "%s: error renaming \"%s\" to \"%s\"", + blurb(), tmp_name, name); perror(buf); unlink (tmp_name); free(buf); - return -1; + return; } else { - si->init_file_date = write_date; + 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); + sprintf(buf, "%s: error closing \"%s\"", blurb(), name); perror(buf); free(buf); unlink (tmp_name); - return -1; + return; } +} - return 0; + +/* 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; + } +} + + +/* 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; + } } diff --git a/driver/prefs.h b/driver/prefs.h new file mode 100644 index 00000000..cf77f8b2 --- /dev/null +++ b/driver/prefs.h @@ -0,0 +1,86 @@ +/* xscreensaver, Copyright (c) 1993-1998 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. + */ + +#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__ */ diff --git a/driver/remote.c b/driver/remote.c new file mode 100644 index 00000000..31d4580c --- /dev/null +++ b/driver/remote.c @@ -0,0 +1,441 @@ +/* xscreensaver-command, Copyright (c) 1991-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. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include /* for CARD32 */ +#include +#include +#include /* for XGetClassHint() */ +#include + +#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); + } +} diff --git a/driver/remote.h b/driver/remote.h new file mode 100644 index 00000000..d368e43c --- /dev/null +++ b/driver/remote.h @@ -0,0 +1,24 @@ +/* xscreensaver-command, Copyright (c) 1991-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. + */ + +#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_ */ diff --git a/driver/setuid.c b/driver/setuid.c index 399f7df0..1323565b 100644 --- a/driver/setuid.c +++ b/driver/setuid.c @@ -37,7 +37,7 @@ 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; @@ -190,6 +190,11 @@ set_ids_by_number (uid_t uid, gid_t gid, char **message_ret) 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) @@ -211,9 +216,15 @@ 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) { @@ -221,11 +232,18 @@ hack_uid (saver_info *si) 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) { @@ -253,6 +271,11 @@ hack_uid (saver_info *si) 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 */ diff --git a/driver/splash.c b/driver/splash.c index e715f4fc..8f6fb011 100644 --- a/driver/splash.c +++ b/driver/splash.c @@ -94,49 +94,15 @@ string_width (XFontStruct *font, char *s) } -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; @@ -676,9 +642,9 @@ handle_splash_event (saver_info *si, XEvent *event) 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(); } } @@ -699,3 +665,92 @@ unsplash_timer (XtPointer closure, XtIntervalId *id) if (si && si->sp_data) destroy_splash_window (si); } + + +/* 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); +} diff --git a/driver/subprocs.c b/driver/subprocs.c index 3f431398..a9fec53c 100644 --- a/driver/subprocs.c +++ b/driver/subprocs.c @@ -71,9 +71,6 @@ extern int kill (pid_t, int); /* signal() is in sys/signal.h... */ 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) { @@ -248,7 +245,8 @@ exec_screenhack (saver_info *si, const char *command) 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", @@ -702,6 +700,14 @@ init_sigchld (void) +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) { @@ -712,6 +718,9 @@ 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 */ @@ -722,12 +731,12 @@ select_visual_of_hack (saver_screen_info *ssi, const char *hack) 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); @@ -745,61 +754,76 @@ spawn_screenhack_1 (saver_screen_info *ssi, Bool first_time_p) 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; @@ -809,6 +833,8 @@ spawn_screenhack_1 (saver_screen_info *ssi, Bool first_time_p) { 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 */ @@ -958,7 +984,7 @@ hack_environment (saver_info *si) } -static void +void hack_subproc_environment (saver_screen_info *ssi) { /* Store $DISPLAY into the environment, so that the $DISPLAY variable that @@ -1007,7 +1033,6 @@ static char **saved_argv; 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--) @@ -1018,45 +1043,24 @@ save_argv (int argc, char **argv) } } -/* 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 */ @@ -1068,26 +1072,3 @@ restart_process_1 (saver_info *si) } 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); -} diff --git a/driver/test-passwd.c b/driver/test-passwd.c index 318c9453..9510f803 100644 --- a/driver/test-passwd.c +++ b/driver/test-passwd.c @@ -14,7 +14,7 @@ itself. */ -#define WHICH 0 +#define WHICH 2 #ifdef HAVE_CONFIG_H # include "config.h" @@ -39,26 +39,20 @@ saver_info *global_si_kludge; 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; @@ -76,163 +70,6 @@ idle_timer (XtPointer closure, XtIntervalId *id) } -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 @@ -281,7 +118,7 @@ main (int argc, char **argv) 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 = @@ -290,34 +127,10 @@ main (int argc, char **argv) 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) { @@ -346,7 +159,6 @@ main (int argc, char **argv) sleep (1); } #else - si->demo_mode_p = True; make_screenhack_dialog (si); XtAppMainLoop(si->app); #endif diff --git a/driver/timers.c b/driver/timers.c index aba6d5a3..c909287c 100644 --- a/driver/timers.c +++ b/driver/timers.c @@ -242,7 +242,8 @@ reset_timers (saver_info *si) 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 */ @@ -468,11 +469,25 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) /* 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: @@ -484,15 +499,13 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) (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]; @@ -504,11 +517,9 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) 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) @@ -516,20 +527,16 @@ sleep_until_idle (saver_info *si, Bool 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 @@ -539,11 +546,9 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) #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; @@ -551,11 +556,9 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) 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; } @@ -620,29 +623,28 @@ static void 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); } } } diff --git a/driver/windows.c b/driver/windows.c index 2d975475..470ec10b 100644 --- a/driver/windows.c +++ b/driver/windows.c @@ -19,9 +19,15 @@ # include "vms-gtod.h" /* for gettimeofday() */ #endif /* VMS */ -# ifdef HAVE_UNAME -# include /* for uname() */ -# endif /* HAVE_UNAME */ +#ifndef VMS +# include /* for getpwuid() */ +#else /* VMS */ +# include "vms-pwd.h" +#endif /* VMS */ + +#ifdef HAVE_UNAME +# include /* for uname() */ +#endif /* HAVE_UNAME */ #include #include /* for CARD32 */ @@ -173,31 +179,34 @@ ungrab_mouse(saver_info *si) } -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 @@ -357,6 +366,16 @@ save_real_vroot (saver_screen_info *ssi) 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; @@ -392,6 +411,10 @@ save_real_vroot (saver_screen_info *ssi) ssi->real_vroot_value = *vrootP; } + XSync (dpy, False); + XSetErrorHandler (old_handler); + XSync (dpy, False); + if (ssi->real_vroot) { handle_signals (si, True); @@ -676,6 +699,71 @@ window_exists_p (Display *dpy, Window window) 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) { @@ -689,12 +777,10 @@ 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; @@ -709,7 +795,8 @@ initialize_screensaver_window_1 (saver_screen_info *ssi) { 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; @@ -848,68 +935,28 @@ initialize_screensaver_window_1 (saver_screen_info *ssi) 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 @@ -928,10 +975,13 @@ raise_window (saver_info *si, 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); @@ -1030,7 +1080,9 @@ blank_screen (saver_info *si) 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++) { @@ -1064,6 +1116,7 @@ void 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); @@ -1071,7 +1124,10 @@ unblank_screen (saver_info *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); @@ -1296,9 +1352,11 @@ select_visual (saver_screen_info *ssi, const char *visual_name) 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) */ } diff --git a/driver/xscreensaver-command.c b/driver/xscreensaver-command.c index d5d3ba9c..b11f203e 100644 --- a/driver/xscreensaver-command.c +++ b/driver/xscreensaver-command.c @@ -10,8 +10,6 @@ * implied warranty. */ -#define STANDALONE - #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -33,336 +31,21 @@ #include /* 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; -} - - -#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 -