http://ftp.x.org/contrib/applications/xscreensaver-3.26.tar.gz
authorZygo Blaxell <zblaxell@hungrycats.org>
Mon, 2 Mar 2009 05:42:43 +0000 (00:42 -0500)
committerZygo Blaxell <zblaxell@hungrycats.org>
Mon, 2 Mar 2009 05:42:43 +0000 (00:42 -0500)
-rw-r--r-- 1 zblaxell zblaxell 1328915 Nov 10  2000 xscreensaver-3.26.tar.gz
f2bae7a4f2327d20852697fb41f43d6550ab7e7e  xscreensaver-3.26.tar.gz

53 files changed:
README
config.h.in
configure
configure.in
driver/Makefile.in
driver/XScreenSaver.ad.in
driver/XScreenSaver_ad.h
driver/demo-Gtk-stubs.h
driver/demo-Gtk-widgets.c
driver/demo-Gtk.c
driver/lock.c
driver/passwd-pam.c
driver/setuid.c
driver/subprocs.c
driver/windows.c
driver/xscreensaver-command.c
driver/xscreensaver-command.man
driver/xscreensaver-demo.glade
driver/xscreensaver-demo.man
driver/xscreensaver.c
driver/xscreensaver.h
driver/xscreensaver.man
hacks/Makefile.in
hacks/bsod.c
hacks/compile_axp.com
hacks/compile_decc.com
hacks/distort.man
hacks/galaxy.c
hacks/glx/Makefile.in
hacks/glx/gflux.c [new file with mode: 0644]
hacks/glx/gflux.man [new file with mode: 0644]
hacks/glx/xscreensaver-gl-helper.c [new file with mode: 0644]
hacks/glx/xscreensaver-gl-helper.man [new file with mode: 0644]
hacks/hyperball.c [new file with mode: 0644]
hacks/hypercube.c
hacks/nerverot.c
hacks/nerverot.man
hacks/phosphor.c
hacks/shadebobs.c
hacks/sonar.c
hacks/webcollage
hacks/webcollage.man
hacks/xflame.c
hacks/xflame.man
hacks/xrayswarm.c [new file with mode: 0644]
setup.com
utils/Makefile.in
utils/sgivideo.c
utils/version.h
utils/visual.c
utils/visual.h
xscreensaver.lsm
xscreensaver.spec

diff --git a/README b/README
index 58ffc4e684a8557f853af293d39f0add70058c17..0aacf8f6e54d2fdff0a671e42767fa45d44343b5 100644 (file)
--- a/README
+++ b/README
@@ -77,6 +77,21 @@ http://www.jwz.org/xscreensaver/.
 
                               ============
 
+Changes since 3.25:   * Added "enabled" checkboxes in the list of hacks in
+                        xscreensaver-demo (Gtk version only.)
+                      * New hacks `hyperball', `xrayswarm', and `gflux'.
+                      * New versions of `nerverot', `galaxy', and `hypercube'.
+                      * Small fixes to `phosphor', `shadebobs', `xflame',
+                        and `sonar'.
+                      * Added external helper program `xscreensaver-gl-helper'
+                        to figure out which X visual to use for OpenGL
+                        programs.
+                      * Configure updates for XFree86 4.0, and for BSD.
+                      * Made it be more tolerant of bogus /etc/group files.
+                      * When installing the PAM config file, first try to just
+                        copy an existing "xdm" or "login" config file, so that
+                        xscreensaver does authentication in the same way as the
+                        rest of the system.
 Changes since 3.24:   * New hack, `nerverot'.
                       * Added BSD kernel panic to `bsod'.
                       * New version of `shadebobs'.
@@ -85,7 +100,8 @@ Changes since 3.24:   * New hack, `nerverot'.
                         format changes; made it search the AP photo gallery.
                       * Revamped command-line options of `sonar' and made it
                         properly handle subnets.
-                      * The `bubbles' hack can now trickle up or down the screen.
+                      * The `bubbles' hack can now trickle up or down the
+                        screen.
                       * The `xsublim' hack can now read its text from programs.
                       * Support for GLE version 3 in `extrusion'.
                       * Fixed compilation problems in `maze'.
index 3e95a542dd10926b65bcf405e8ab292b7aa37cb7..6cfb67a03af7ad03d58a5183478685a380f0fde8 100644 (file)
@@ -1,4 +1,4 @@
-/* config.h.in --- xscreensaver, Copyright (c) 1998 Jamie Zawinski.
+/* config.h.in --- xscreensaver, Copyright (c) 1998-2000 Jamie Zawinski.
  *
  *  The best way to set these parameters is by running the included `configure'
  *  script.  That examines your system, and generates `config.h' from 
  */
 #undef HAVE_GLE3
 
-/*  Define this if the `xscreensaver' process itself (the driver process)
-    should be linked against GL.  Most systems won't want this (in particular,
-    if you're using Linux and/or Mesa, you don't want this) but SGI systems
-    do want this.  It may also be useful on other systems that have serious
-    GL support -- you only need this if you have a lot of different visuals,
-    not all of which work with GL programs.
- */
-#undef DAEMON_USE_GL
-
 /*  Define this if you have the X Shared Memory Extension.
  */
 #undef HAVE_XSHM_EXTENSION
index 110c9606f6626ea83614c40080e829a1064b2b89..944a239dee104115e612b9188bb7ceb47b41eb15 100755 (executable)
--- a/configure
+++ b/configure
@@ -4480,8 +4480,10 @@ fi
 
   CPPFLAGS="$ac_save_CPPFLAGS"
 
-  # if that succeeded, then check for the -lXdpms
+  # if that succeeded, then check for the DPMS code in the libraries
   if test "$have_dpms" = yes; then
+
+    # first look in -lXext (this is where it is with XFree86 4.0)
     have_dpms=no
     
   ac_save_CPPFLAGS="$CPPFLAGS"
@@ -4500,8 +4502,73 @@ fi
   # note: $X_LIBS includes $x_libraries
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
+  echo $ac_n "checking for DPMSInfo in -lXext""... $ac_c" 1>&6
+echo "configure:4518: checking for DPMSInfo in -lXext" >&5
+ac_lib_var=`echo Xext'_'DPMSInfo | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lXext -lXext -lX11 $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4526 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char DPMSInfo();
+
+int main() {
+DPMSInfo()
+; return 0; }
+EOF
+if { (eval echo configure:4537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  have_dpms=yes
+else
+  echo "$ac_t""no" 1>&6
+true
+fi
+
+  CPPFLAGS="$ac_save_CPPFLAGS"
+  LDFLAGS="$ac_save_LDFLAGS"
+#  LIBS="$ac_save_LIBS"
+  
+
+    # if that failed, look in -lXdpms (this is where it was in XFree86 3.x)
+    if test "$have_dpms" = no; then
+      
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  ac_save_LDFLAGS="$LDFLAGS"
+#  ac_save_LIBS="$LIBS"
+
+  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
+  # note: $X_LIBS includes $x_libraries
+  LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
+
   echo $ac_n "checking for DPMSInfo in -lXdpms""... $ac_c" 1>&6
-echo "configure:4516: checking for DPMSInfo in -lXdpms" >&5
+echo "configure:4583: 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
@@ -4509,7 +4576,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXdpms -lXext -lX11 $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4524 "configure"
+#line 4591 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4520,7 +4587,7 @@ int main() {
 DPMSInfo()
 ; return 0; }
 EOF
-if { (eval echo configure:4535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4545,8 +4612,10 @@ fi
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
   
+    fi
   fi
 
+
   # if that succeeded, then we've really got it.
   if test "$have_dpms" = yes; then
     cat >> confdefs.h <<\EOF
@@ -4585,7 +4654,7 @@ fi
 
     /*)
      echo $ac_n "checking for xf86vmode headers""... $ac_c" 1>&6
-echo "configure:4600: checking for xf86vmode headers" >&5
+echo "configure:4669: checking for xf86vmode headers" >&5
      d=$with_xf86vmode/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
@@ -4595,7 +4664,7 @@ echo "configure:4600: checking for xf86vmode headers" >&5
      fi
 
      echo $ac_n "checking for xf86vmode libs""... $ac_c" 1>&6
-echo "configure:4610: checking for xf86vmode libs" >&5
+echo "configure:4679: checking for xf86vmode libs" >&5
      d=$with_xf86vmode/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
@@ -4630,17 +4699,17 @@ if test "$with_xf86vmode" = yes; then
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   ac_safe=`echo "X11/extensions/xf86vmode.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/extensions/xf86vmode.h""... $ac_c" 1>&6
-echo "configure:4645: checking for X11/extensions/xf86vmode.h" >&5
+echo "configure:4714: checking for X11/extensions/xf86vmode.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4650 "configure"
+#line 4719 "configure"
 #include "confdefs.h"
 #include <X11/extensions/xf86vmode.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4684,7 +4753,7 @@ fi
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   echo $ac_n "checking for XF86VidModeGetViewPort in -lXxf86vm""... $ac_c" 1>&6
-echo "configure:4699: checking for XF86VidModeGetViewPort in -lXxf86vm" >&5
+echo "configure:4768: checking for XF86VidModeGetViewPort in -lXxf86vm" >&5
 ac_lib_var=`echo Xxf86vm'_'XF86VidModeGetViewPort | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4692,7 +4761,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXxf86vm -lXext -lX11 $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4707 "configure"
+#line 4776 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4703,7 +4772,7 @@ int main() {
 XF86VidModeGetViewPort()
 ; return 0; }
 EOF
-if { (eval echo configure:4718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4757,7 +4826,7 @@ fi
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   cat > conftest.$ac_ext <<EOF
-#line 4772 "configure"
+#line 4841 "configure"
 #include "confdefs.h"
 #include <X11/XHPlib.h>
 EOF
@@ -4795,7 +4864,7 @@ fi
 if test "$with_proc_interrupts" = yes; then
 
    echo $ac_n "checking whether /proc/interrupts contains keyboard data""... $ac_c" 1>&6
-echo "configure:4810: checking whether /proc/interrupts contains keyboard data" >&5
+echo "configure:4879: checking whether /proc/interrupts contains keyboard data" >&5
 if eval "test \"`echo '$''{'ac_cv_have_proc_interrupts'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4928,7 +4997,7 @@ fi
 
     /*)
      echo $ac_n "checking for PAM headers""... $ac_c" 1>&6
-echo "configure:4943: checking for PAM headers" >&5
+echo "configure:5012: checking for PAM headers" >&5
      d=$with_pam/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
@@ -4938,7 +5007,7 @@ echo "configure:4943: checking for PAM headers" >&5
      fi
 
      echo $ac_n "checking for PAM libs""... $ac_c" 1>&6
-echo "configure:4953: checking for PAM libs" >&5
+echo "configure:5022: checking for PAM libs" >&5
      d=$with_pam/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
@@ -4964,7 +5033,7 @@ echo "configure:4953: checking for PAM libs" >&5
 
 if test "$enable_locking" = yes -a "$with_pam" = yes; then
   echo $ac_n "checking for PAM""... $ac_c" 1>&6
-echo "configure:4979: checking for PAM" >&5
+echo "configure:5048: checking for PAM" >&5
 if eval "test \"`echo '$''{'ac_cv_pam'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4975,14 +5044,14 @@ else
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   cat > conftest.$ac_ext <<EOF
-#line 4990 "configure"
+#line 5059 "configure"
 #include "confdefs.h"
 #include <security/pam_appl.h>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_pam=yes
 else
@@ -5007,7 +5076,7 @@ EOF
     # libpam typically requires dlopen and dlsym.  On FreeBSD,
     # those are in libc.  On Linux and Solaris, they're in libdl.
     echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:5022: checking for dlopen in -ldl" >&5
+echo "configure:5091: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5015,7 +5084,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5030 "configure"
+#line 5099 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5026,7 +5095,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:5041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5048,12 +5117,12 @@ fi
 
 
     echo $ac_n "checking how to call pam_strerror""... $ac_c" 1>&6
-echo "configure:5063: checking how to call pam_strerror" >&5
+echo "configure:5132: checking how to call pam_strerror" >&5
     if eval "test \"`echo '$''{'ac_cv_pam_strerror_args'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5068 "configure"
+#line 5137 "configure"
 #include "confdefs.h"
 #include <stdio.h>
                       #include <stdlib.h>
@@ -5063,7 +5132,7 @@ pam_handle_t *pamh = 0;
                       char *s = pam_strerror(pamh, PAM_SUCCESS);
 ; return 0; }
 EOF
-if { (eval echo configure:5078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_pam_strerror_args=2
 else
@@ -5071,7 +5140,7 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 5086 "configure"
+#line 5155 "configure"
 #include "confdefs.h"
 #include <stdio.h>
                                       #include <stdlib.h>
@@ -5081,7 +5150,7 @@ char *s =
                                        pam_strerror(PAM_SUCCESS);
 ; return 0; }
 EOF
-if { (eval echo configure:5096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5165: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_pam_strerror_args=1
 else
@@ -5138,7 +5207,7 @@ fi
 
     /*)
      echo $ac_n "checking for Kerberos headers""... $ac_c" 1>&6
-echo "configure:5153: checking for Kerberos headers" >&5
+echo "configure:5222: checking for Kerberos headers" >&5
      d=$with_kerberos/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
@@ -5148,7 +5217,7 @@ echo "configure:5153: checking for Kerberos headers" >&5
      fi
 
      echo $ac_n "checking for Kerberos libs""... $ac_c" 1>&6
-echo "configure:5163: checking for Kerberos libs" >&5
+echo "configure:5232: checking for Kerberos libs" >&5
      d=$with_kerberos/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
@@ -5174,7 +5243,7 @@ echo "configure:5163: checking for Kerberos libs" >&5
 
 if test "$enable_locking" = yes -a "$with_kerberos" = yes; then
   echo $ac_n "checking for Kerberos 4""... $ac_c" 1>&6
-echo "configure:5189: checking for Kerberos 4" >&5
+echo "configure:5258: checking for Kerberos 4" >&5
 if eval "test \"`echo '$''{'ac_cv_kerberos'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5185,14 +5254,14 @@ else
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   cat > conftest.$ac_ext <<EOF
-#line 5200 "configure"
+#line 5269 "configure"
 #include "confdefs.h"
 #include <krb.h>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5207: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_kerberos=yes
 else
@@ -5207,7 +5276,7 @@ fi
 
 echo "$ac_t""$ac_cv_kerberos" 1>&6
   echo $ac_n "checking for Kerberos 5""... $ac_c" 1>&6
-echo "configure:5222: checking for Kerberos 5" >&5
+echo "configure:5291: checking for Kerberos 5" >&5
 if eval "test \"`echo '$''{'ac_cv_kerberos5'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5218,14 +5287,14 @@ else
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   cat > conftest.$ac_ext <<EOF
-#line 5233 "configure"
+#line 5302 "configure"
 #include "confdefs.h"
 #include <kerberosIV/krb.h>
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5309: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_kerberos5=yes
 else
@@ -5272,12 +5341,12 @@ EOF
 
   if test "$have_kerberos" = yes ; then
     echo $ac_n "checking for res_search""... $ac_c" 1>&6
-echo "configure:5287: checking for res_search" >&5
+echo "configure:5356: checking for res_search" >&5
 if eval "test \"`echo '$''{'ac_cv_func_res_search'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5292 "configure"
+#line 5361 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char res_search(); below.  */
@@ -5300,7 +5369,7 @@ res_search();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_res_search=yes"
 else
@@ -5318,7 +5387,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:5333: checking for res_search in -lresolv" >&5
+echo "configure:5402: 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
@@ -5326,7 +5395,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5341 "configure"
+#line 5410 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5337,7 +5406,7 @@ int main() {
 res_search()
 ; return 0; }
 EOF
-if { (eval echo configure:5352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5392,7 +5461,7 @@ fi
 
     /*)
      echo $ac_n "checking for shadow password headers""... $ac_c" 1>&6
-echo "configure:5407: checking for shadow password headers" >&5
+echo "configure:5476: checking for shadow password headers" >&5
      d=$with_shadow/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
@@ -5402,7 +5471,7 @@ echo "configure:5407: checking for shadow password headers" >&5
      fi
 
      echo $ac_n "checking for shadow password libs""... $ac_c" 1>&6
-echo "configure:5417: checking for shadow password libs" >&5
+echo "configure:5486: checking for shadow password libs" >&5
      d=$with_shadow/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
@@ -5440,7 +5509,7 @@ fi
 
 if test "$with_shadow" = yes ; then
   echo $ac_n "checking for Sun-style shadow passwords""... $ac_c" 1>&6
-echo "configure:5455: checking for Sun-style shadow passwords" >&5
+echo "configure:5524: 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
@@ -5451,7 +5520,7 @@ else
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   cat > conftest.$ac_ext <<EOF
-#line 5466 "configure"
+#line 5535 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
                                     #include <unistd.h>
@@ -5464,7 +5533,7 @@ struct passwd_adjunct *p = getpwanam("nobody");
                        const char *pw = p->pwa_passwd;
 ; return 0; }
 EOF
-if { (eval echo configure:5479: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sun_adjunct=yes
 else
@@ -5494,7 +5563,7 @@ fi
 
 if test "$with_shadow" = yes ; then
   echo $ac_n "checking for DEC-style shadow passwords""... $ac_c" 1>&6
-echo "configure:5509: checking for DEC-style shadow passwords" >&5
+echo "configure:5578: 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
@@ -5505,7 +5574,7 @@ else
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   cat > conftest.$ac_ext <<EOF
-#line 5520 "configure"
+#line 5589 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
                                     #include <unistd.h>
@@ -5522,7 +5591,7 @@ struct pr_passwd *p;
                        pw = p->ufld.fd_encrypt;
 ; return 0; }
 EOF
-if { (eval echo configure:5537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5606: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_enhanced_passwd=yes
 else
@@ -5546,7 +5615,7 @@ echo "$ac_t""$ac_cv_enhanced_passwd" 1>&6
     # But on DEC, it's in -lsecurity.
     #
     echo $ac_n "checking for getprpwnam in -lprot""... $ac_c" 1>&6
-echo "configure:5561: checking for getprpwnam in -lprot" >&5
+echo "configure:5630: 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
@@ -5554,7 +5623,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lprot -lx $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5569 "configure"
+#line 5638 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5565,7 +5634,7 @@ int main() {
 getprpwnam()
 ; return 0; }
 EOF
-if { (eval echo configure:5580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5584,7 +5653,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6
-echo "configure:5599: checking for getprpwnam in -lsecurity" >&5
+echo "configure:5668: 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
@@ -5592,7 +5661,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsecurity  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5607 "configure"
+#line 5676 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5603,7 +5672,7 @@ int main() {
 getprpwnam()
 ; return 0; }
 EOF
-if { (eval echo configure:5618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5636,7 +5705,7 @@ fi
 
 if test "$with_shadow" = yes ; then
   echo $ac_n "checking for HP-style shadow passwords""... $ac_c" 1>&6
-echo "configure:5651: checking for HP-style shadow passwords" >&5
+echo "configure:5720: 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
@@ -5647,7 +5716,7 @@ else
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   cat > conftest.$ac_ext <<EOF
-#line 5662 "configure"
+#line 5731 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
                                     #include <unistd.h>
@@ -5660,7 +5729,7 @@ struct s_passwd *p = getspwnam("nobody");
                        const char *pw = p->pw_passwd;
 ; return 0; }
 EOF
-if { (eval echo configure:5675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_hpux_passwd=yes
 else
@@ -5681,7 +5750,7 @@ echo "$ac_t""$ac_cv_hpux_passwd" 1>&6
 
     # on HPUX, bigcrypt is in -lsec
     echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6
-echo "configure:5696: checking for bigcrypt in -lsec" >&5
+echo "configure:5765: 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
@@ -5689,7 +5758,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsec  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5704 "configure"
+#line 5773 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5700,7 +5769,7 @@ int main() {
 bigcrypt()
 ; return 0; }
 EOF
-if { (eval echo configure:5715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5738,7 +5807,7 @@ fi
 
 if test "$with_shadow" = yes ; then
   echo $ac_n "checking for FreeBSD-style shadow passwords""... $ac_c" 1>&6
-echo "configure:5753: checking for FreeBSD-style shadow passwords" >&5
+echo "configure:5822: 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
@@ -5764,7 +5833,7 @@ fi
 
 if test "$with_shadow" = yes ; then
   echo $ac_n "checking for generic shadow passwords""... $ac_c" 1>&6
-echo "configure:5779: checking for generic shadow passwords" >&5
+echo "configure:5848: 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
@@ -5775,7 +5844,7 @@ else
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   cat > conftest.$ac_ext <<EOF
-#line 5790 "configure"
+#line 5859 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
                                     #include <unistd.h>
@@ -5787,7 +5856,7 @@ struct spwd *p = getspnam("nobody");
                        const char *pw = p->sp_pwdp;
 ; return 0; }
 EOF
-if { (eval echo configure:5802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_shadow=yes
 else
@@ -5808,7 +5877,7 @@ echo "$ac_t""$ac_cv_shadow" 1>&6
     # 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:5823: checking for getspnam in -lc" >&5
+echo "configure:5892: 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
@@ -5816,7 +5885,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5831 "configure"
+#line 5900 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5827,7 +5896,7 @@ int main() {
 getspnam()
 ; return 0; }
 EOF
-if { (eval echo configure:5842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5849,7 +5918,7 @@ fi
 
     if test "$have_getspnam" = no ; then
       echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
-echo "configure:5864: checking for getspnam in -lgen" >&5
+echo "configure:5933: 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
@@ -5857,7 +5926,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5872 "configure"
+#line 5941 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5868,7 +5937,7 @@ int main() {
 getspnam()
 ; return 0; }
 EOF
-if { (eval echo configure:5883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5904,7 +5973,7 @@ if test "$enable_locking" = yes ; then
   # 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:5919: checking for crypt in -lc" >&5
+echo "configure:5988: 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
@@ -5912,7 +5981,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5927 "configure"
+#line 5996 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5923,7 +5992,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:5938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5945,7 +6014,7 @@ fi
 
   if test "$have_crypt" = no ; then
     echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:5960: checking for crypt in -lcrypt" >&5
+echo "configure:6029: 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
@@ -5953,7 +6022,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5968 "configure"
+#line 6037 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5964,7 +6033,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:5979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6048,7 +6117,7 @@ fi
 
     /*)
      echo $ac_n "checking for Motif headers""... $ac_c" 1>&6
-echo "configure:6063: checking for Motif headers" >&5
+echo "configure:6132: checking for Motif headers" >&5
      d=$with_motif/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
@@ -6058,7 +6127,7 @@ echo "configure:6063: checking for Motif headers" >&5
      fi
 
      echo $ac_n "checking for Motif libs""... $ac_c" 1>&6
-echo "configure:6073: checking for Motif libs" >&5
+echo "configure:6142: checking for Motif libs" >&5
      d=$with_motif/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
@@ -6097,17 +6166,17 @@ if test "$with_motif" = yes; then
   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:6112: checking for Xm/Xm.h" >&5
+echo "configure:6181: checking for Xm/Xm.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6117 "configure"
+#line 6186 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6122: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6146,17 +6215,17 @@ if test "$have_motif" = yes; then
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   ac_safe=`echo "Xm/ComboBox.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Xm/ComboBox.h""... $ac_c" 1>&6
-echo "configure:6161: checking for Xm/ComboBox.h" >&5
+echo "configure:6230: checking for Xm/ComboBox.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6166 "configure"
+#line 6235 "configure"
 #include "confdefs.h"
 #include <Xm/ComboBox.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6219,7 +6288,7 @@ esac
 
     /*)
      echo $ac_n "checking for Gtk headers""... $ac_c" 1>&6
-echo "configure:6234: checking for Gtk headers" >&5
+echo "configure:6303: checking for Gtk headers" >&5
      d=$with_gtk/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
@@ -6229,7 +6298,7 @@ echo "configure:6234: checking for Gtk headers" >&5
      fi
 
      echo $ac_n "checking for Gtk libs""... $ac_c" 1>&6
-echo "configure:6244: checking for Gtk libs" >&5
+echo "configure:6313: checking for Gtk libs" >&5
      d=$with_gtk/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
@@ -6287,7 +6356,7 @@ esac
 
     /*)
      echo $ac_n "checking for Gnome headers""... $ac_c" 1>&6
-echo "configure:6302: checking for Gnome headers" >&5
+echo "configure:6371: checking for Gnome headers" >&5
      d=$with_gnome/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
@@ -6297,7 +6366,7 @@ echo "configure:6302: checking for Gnome headers" >&5
      fi
 
      echo $ac_n "checking for Gnome libs""... $ac_c" 1>&6
-echo "configure:6312: checking for Gnome libs" >&5
+echo "configure:6381: checking for Gnome libs" >&5
      d=$with_gnome/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
@@ -6348,12 +6417,12 @@ if test "$with_gtk" = yes; then
     gtk_path="$gnome_dir:$gtk_path"
   fi
 
-  for ac_prog in glib-config
+  for ac_prog in glib12-config glib-config
 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:6368: checking for $ac_word" >&5
+echo "configure:6437: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_glib_config'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6388,12 +6457,12 @@ fi
 test -n "$glib_config" && break
 done
 
-  for ac_prog in gtk-config
+  for ac_prog in gtk12-config  gtk-config
 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:6408: checking for $ac_word" >&5
+echo "configure:6477: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_gtk_config'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6435,7 +6504,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:6450: checking for $ac_word" >&5
+echo "configure:6519: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_gnome_config'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6481,11 +6550,11 @@ done
 
   if test "$have_gtk" = yes; then
     echo $ac_n "checking Gtk version number""... $ac_c" 1>&6
-echo "configure:6496: checking Gtk version number" >&5
+echo "configure:6565: checking Gtk version number" >&5
 if eval "test \"`echo '$''{'ac_cv_gtk_version_string'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_cv_gtk_version_string=`$glib_config --version`
+  ac_cv_gtk_version_string=`$gtk_config --version`
 fi
 
 echo "$ac_t""$ac_cv_gtk_version_string" 1>&6
@@ -6510,7 +6579,7 @@ echo "$ac_t""$ac_cv_gtk_version_string" 1>&6
 
   if test "$have_gtk" = yes; then
     echo $ac_n "checking for Gtk includes""... $ac_c" 1>&6
-echo "configure:6525: checking for Gtk includes" >&5
+echo "configure:6594: checking for Gtk includes" >&5
 if eval "test \"`echo '$''{'ac_cv_gtk_config_cflags'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6519,7 +6588,7 @@ fi
 
 echo "$ac_t""$ac_cv_gtk_config_cflags" 1>&6
     echo $ac_n "checking for Gtk libs""... $ac_c" 1>&6
-echo "configure:6534: checking for Gtk libs" >&5
+echo "configure:6603: checking for Gtk libs" >&5
 if eval "test \"`echo '$''{'ac_cv_gtk_config_libs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6536,12 +6605,12 @@ echo "$ac_t""$ac_cv_gtk_config_libs" 1>&6
   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
     gnome_config_libs="capplet gnomeui"
     echo $ac_n "checking for Gnome capplet includes""... $ac_c" 1>&6
-echo "configure:6551: checking for Gnome capplet includes" >&5
+echo "configure:6620: checking for Gnome capplet includes" >&5
     if eval "test \"`echo '$''{'ac_cv_gnome_config_cflags'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if ( $gnome_config --cflags $gnome_config_libs 2>&1 >/dev/null | \
-            grep -q Unknown ) ; then
+            grep Unknown >/dev/null ) ; then
          ac_cv_gnome_config_cflags=''
        else
          ac_cv_gnome_config_cflags=`$gnome_config --cflags $gnome_config_libs`
@@ -6559,12 +6628,12 @@ fi
 
   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
     echo $ac_n "checking for Gnome capplet libs""... $ac_c" 1>&6
-echo "configure:6574: checking for Gnome capplet libs" >&5
+echo "configure:6643: checking for Gnome capplet libs" >&5
     if eval "test \"`echo '$''{'ac_cv_gnome_config_libs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if ( $gnome_config --libs $gnome_config_libs 2>&1 >/dev/null |
-            grep -q Unknown ) ; then
+            grep Unknown >/dev/null ) ; then
          ac_cv_gnome_config_libs=''
        else
          ac_cv_gnome_config_libs=`$gnome_config --libs $gnome_config_libs`
@@ -6620,7 +6689,7 @@ fi
 have_lesstif=no
 if test "$have_motif" = yes ; then
   echo $ac_n "checking whether Motif is really LessTif""... $ac_c" 1>&6
-echo "configure:6635: checking whether Motif is really LessTif" >&5
+echo "configure:6704: 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
@@ -6631,14 +6700,14 @@ else
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   cat > conftest.$ac_ext <<EOF
-#line 6646 "configure"
+#line 6715 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 int main() {
 long vers = LesstifVersion;
 ; return 0; }
 EOF
-if { (eval echo configure:6653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_have_lesstif=yes
 else
@@ -6663,7 +6732,7 @@ 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:6678: checking LessTif version number" >&5
+echo "configure:6747: 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
@@ -6678,7 +6747,7 @@ else
                      ac_cv_lesstif_version_string=unknown
 else
   cat > conftest.$ac_ext <<EOF
-#line 6693 "configure"
+#line 6762 "configure"
 #include "confdefs.h"
 #include <stdio.h>
                      #include <Xm/Xm.h>
@@ -6691,7 +6760,7 @@ else
                        exit(0);
                      }
 EOF
-if { (eval echo configure:6706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ltv=`cat conftest-lt`
                      ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
@@ -6721,7 +6790,7 @@ if test "$have_motif" = yes ; then
   mtv=unknown
   echo unknown > conftest-mt
   echo $ac_n "checking Motif version number""... $ac_c" 1>&6
-echo "configure:6736: checking Motif version number" >&5
+echo "configure:6805: checking Motif version number" >&5
 if eval "test \"`echo '$''{'ac_cv_motif_version_string'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6736,7 +6805,7 @@ else
                      ac_cv_motif_version_string=unknown
 else
   cat > conftest.$ac_ext <<EOF
-#line 6751 "configure"
+#line 6820 "configure"
 #include "confdefs.h"
 #include <stdio.h>
                      #include <Xm/Xm.h>
@@ -6749,7 +6818,7 @@ else
                        exit(0);
                      }
 EOF
-if { (eval echo configure:6764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   mtv=`cat conftest-mt`
                      ac_cv_motif_version=`echo $mtv | sed 's/ .*//'`
@@ -6793,7 +6862,7 @@ fi
 motif_requires_xpm=no
 if test "$have_motif" = yes ; then
    echo $ac_n "checking whether Motif requires XPM""... $ac_c" 1>&6
-echo "configure:6808: checking whether Motif requires XPM" >&5
+echo "configure:6877: checking whether Motif requires XPM" >&5
    if test "$motif_version" = "unknown" || test "$motif_version" -ge 2000
    then
      motif_requires_xpm=yes
@@ -6835,7 +6904,7 @@ if test "$have_motif" = yes ; then
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   echo $ac_n "checking for XpQueryExtension in -lXp""... $ac_c" 1>&6
-echo "configure:6850: checking for XpQueryExtension in -lXp" >&5
+echo "configure:6919: 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
@@ -6843,7 +6912,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXp -lX11 -lXext -lm $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6858 "configure"
+#line 6927 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6854,7 +6923,7 @@ int main() {
 XpQueryExtension()
 ; return 0; }
 EOF
-if { (eval echo configure:6869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6908,7 +6977,7 @@ if test "$have_motif" = yes ; then
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   echo $ac_n "checking for _Xsetlocale in -lXintl""... $ac_c" 1>&6
-echo "configure:6923: checking for _Xsetlocale in -lXintl" >&5
+echo "configure:6992: checking for _Xsetlocale in -lXintl" >&5
 ac_lib_var=`echo Xintl'_'_Xsetlocale | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6916,7 +6985,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXintl -lX11 -lXext -lm $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6931 "configure"
+#line 7000 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6927,7 +6996,7 @@ int main() {
 _Xsetlocale()
 ; return 0; }
 EOF
-if { (eval echo configure:6942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6984,7 +7053,7 @@ fi
 
     /*)
      echo $ac_n "checking for GL headers""... $ac_c" 1>&6
-echo "configure:6999: checking for GL headers" >&5
+echo "configure:7068: checking for GL headers" >&5
      d=$with_gl/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
@@ -6994,7 +7063,7 @@ echo "configure:6999: checking for GL headers" >&5
      fi
 
      echo $ac_n "checking for GL libs""... $ac_c" 1>&6
-echo "configure:7009: checking for GL libs" >&5
+echo "configure:7078: checking for GL libs" >&5
      d=$with_gl/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
@@ -7030,17 +7099,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:7045: checking for GL/gl.h" >&5
+echo "configure:7114: checking for GL/gl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7050 "configure"
+#line 7119 "configure"
 #include "confdefs.h"
 #include <GL/gl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7071,17 +7140,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:7086: checking for GL/glx.h" >&5
+echo "configure:7155: checking for GL/glx.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7091 "configure"
+#line 7160 "configure"
 #include "confdefs.h"
 #include <GL/glx.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7096: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7113,7 +7182,7 @@ fi
     # to link against.
     #
     echo $ac_n "checking whether GL is really MesaGL""... $ac_c" 1>&6
-echo "configure:7128: checking whether GL is really MesaGL" >&5
+echo "configure:7197: 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
@@ -7125,7 +7194,7 @@ else
   fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   cat > conftest.$ac_ext <<EOF
-#line 7140 "configure"
+#line 7209 "configure"
 #include "confdefs.h"
 #include <GL/glx.h>
 EOF
@@ -7154,7 +7223,7 @@ echo "$ac_t""$ac_cv_have_mesa_gl" 1>&6
     #
     if test "$ac_have_mesa_gl" = yes; then
       echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:7169: checking for pthread_create in -lpthread" >&5
+echo "configure:7238: checking for pthread_create in -lpthread" >&5
 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7162,7 +7231,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7177 "configure"
+#line 7246 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7173,7 +7242,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:7188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7220,7 +7289,7 @@ fi
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   echo $ac_n "checking for glXCreateContext in -lMesaGL""... $ac_c" 1>&6
-echo "configure:7235: checking for glXCreateContext in -lMesaGL" >&5
+echo "configure:7304: checking for glXCreateContext in -lMesaGL" >&5
 ac_lib_var=`echo MesaGL'_'glXCreateContext | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7228,7 +7297,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lMesaGL -lMesaGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7243 "configure"
+#line 7312 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7239,7 +7308,7 @@ int main() {
 glXCreateContext()
 ; return 0; }
 EOF
-if { (eval echo configure:7254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7285,7 +7354,7 @@ fi
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   echo $ac_n "checking for glXCreateContext in -lGL""... $ac_c" 1>&6
-echo "configure:7300: checking for glXCreateContext in -lGL" >&5
+echo "configure:7369: checking for glXCreateContext in -lGL" >&5
 ac_lib_var=`echo GL'_'glXCreateContext | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7293,7 +7362,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lGL -lGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7308 "configure"
+#line 7377 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7304,7 +7373,7 @@ int main() {
 glXCreateContext()
 ; return 0; }
 EOF
-if { (eval echo configure:7319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7362,12 +7431,12 @@ EOF
     if test "$ac_have_mesa_gl" = yes; then
 
       echo $ac_n "checking MesaGL version number""... $ac_c" 1>&6
-echo "configure:7377: checking MesaGL version number" >&5
+echo "configure:7446: checking MesaGL version number" >&5
 if eval "test \"`echo '$''{'ac_cv_mesagl_version_string'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7382 "configure"
+#line 7451 "configure"
 #include "confdefs.h"
 #include <GL/gl.h>
 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
@@ -7433,7 +7502,7 @@ echo "$ac_t""$ac_cv_mesagl_version_string" 1>&6
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   echo $ac_n "checking for glBindTexture in -l$gl_lib_1""... $ac_c" 1>&6
-echo "configure:7448: checking for glBindTexture in -l$gl_lib_1" >&5
+echo "configure:7517: 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
@@ -7441,7 +7510,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7456 "configure"
+#line 7525 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7452,7 +7521,7 @@ int main() {
 glBindTexture()
 ; return 0; }
 EOF
-if { (eval echo configure:7467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7480,32 +7549,6 @@ fi
   LDFLAGS="$ac_save_LDFLAGS"
 #  LIBS="$ac_save_LIBS"
   
-
-
-    # Check whether the `xscreensaver' executable should link against GL.
-    # See comments in utils/visual-gl.c for why this is sometimes necessary.
-    #
-    echo $ac_n "checking whether drastic GL measures must be taken""... $ac_c" 1>&6
-echo "configure:7501: checking whether drastic GL measures must be taken" >&5
-    case "$host" in
-      *-sgi*)
-        echo "$ac_t""yes -- hello, SGI." 1>&6
-        cat >> confdefs.h <<\EOF
-#define DAEMON_USE_GL 1
-EOF
-
-        SAVER_GL_SRCS='$(UTILS_SRC)/visual-gl.c'
-        SAVER_GL_OBJS='$(UTILS_BIN)/visual-gl.o'
-        SAVER_GL_LIBS="$GL_LIBS"
-      ;;
-      *)
-        echo "$ac_t""no -- non-SGI." 1>&6
-        SAVER_GL_SRCS=''
-        SAVER_GL_OBJS=''
-        SAVER_GL_LIBS=''
-      ;;
-    esac
-
   fi
 
 elif test "$with_gl" != no; then
@@ -7539,7 +7582,7 @@ fi
 
     /*)
      echo $ac_n "checking for GLE headers""... $ac_c" 1>&6
-echo "configure:7554: checking for GLE headers" >&5
+echo "configure:7597: checking for GLE headers" >&5
      d=$with_gle/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
@@ -7549,7 +7592,7 @@ echo "configure:7554: checking for GLE headers" >&5
      fi
 
      echo $ac_n "checking for GLE libs""... $ac_c" 1>&6
-echo "configure:7564: checking for GLE libs" >&5
+echo "configure:7607: checking for GLE libs" >&5
      d=$with_gle/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
@@ -7585,17 +7628,17 @@ if test "$with_gle" = yes; then
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   ac_safe=`echo "GL/gle.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for GL/gle.h""... $ac_c" 1>&6
-echo "configure:7600: checking for GL/gle.h" >&5
+echo "configure:7643: checking for GL/gle.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7605 "configure"
+#line 7648 "configure"
 #include "confdefs.h"
 #include <GL/gle.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7628,17 +7671,17 @@ fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   ac_safe=`echo "GL/gutil.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for GL/gutil.h""... $ac_c" 1>&6
-echo "configure:7643: checking for GL/gutil.h" >&5
+echo "configure:7686: checking for GL/gutil.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7648 "configure"
+#line 7691 "configure"
 #include "confdefs.h"
 #include <GL/gutil.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7669,17 +7712,17 @@ fi
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   ac_safe=`echo "GL/tube.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for GL/tube.h""... $ac_c" 1>&6
-echo "configure:7684: checking for GL/tube.h" >&5
+echo "configure:7727: checking for GL/tube.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7689 "configure"
+#line 7732 "configure"
 #include "confdefs.h"
 #include <GL/tube.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7694: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7725,7 +7768,7 @@ fi
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   echo $ac_n "checking for gleCreateGC in -lgle""... $ac_c" 1>&6
-echo "configure:7740: checking for gleCreateGC in -lgle" >&5
+echo "configure:7783: checking for gleCreateGC in -lgle" >&5
 ac_lib_var=`echo gle'_'gleCreateGC | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7733,7 +7776,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7748 "configure"
+#line 7791 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7744,7 +7787,7 @@ int main() {
 gleCreateGC()
 ; return 0; }
 EOF
-if { (eval echo configure:7759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7804,7 +7847,7 @@ fi
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   echo $ac_n "checking for uview_direction in -lgle""... $ac_c" 1>&6
-echo "configure:7819: checking for uview_direction in -lgle" >&5
+echo "configure:7862: checking for uview_direction in -lgle" >&5
 ac_lib_var=`echo gle'_'uview_direction | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7812,7 +7855,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7827 "configure"
+#line 7870 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7823,7 +7866,7 @@ int main() {
 uview_direction()
 ; return 0; }
 EOF
-if { (eval echo configure:7838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7868,7 +7911,7 @@ fi
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   echo $ac_n "checking for uview_direction_d in -lmatrix""... $ac_c" 1>&6
-echo "configure:7883: checking for uview_direction_d in -lmatrix" >&5
+echo "configure:7926: checking for uview_direction_d in -lmatrix" >&5
 ac_lib_var=`echo matrix'_'uview_direction_d | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7876,7 +7919,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmatrix $GL_LIBS -lX11 -lXext -lm $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7891 "configure"
+#line 7934 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7887,7 +7930,7 @@ int main() {
 uview_direction_d()
 ; return 0; }
 EOF
-if { (eval echo configure:7902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7960,7 +8003,7 @@ fi
 
     /*)
      echo $ac_n "checking for XPM headers""... $ac_c" 1>&6
-echo "configure:7975: checking for XPM headers" >&5
+echo "configure:8018: checking for XPM headers" >&5
      d=$with_xpm/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
@@ -7970,7 +8013,7 @@ echo "configure:7975: checking for XPM headers" >&5
      fi
 
      echo $ac_n "checking for XPM libs""... $ac_c" 1>&6
-echo "configure:7985: checking for XPM libs" >&5
+echo "configure:8028: checking for XPM libs" >&5
      d=$with_xpm/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
@@ -8003,17 +8046,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:8018: checking for X11/xpm.h" >&5
+echo "configure:8061: checking for X11/xpm.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8023 "configure"
+#line 8066 "configure"
 #include "confdefs.h"
 #include <X11/xpm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8079,7 +8122,7 @@ fi
 
     /*)
      echo $ac_n "checking for XSHM headers""... $ac_c" 1>&6
-echo "configure:8094: checking for XSHM headers" >&5
+echo "configure:8137: checking for XSHM headers" >&5
      d=$with_xshm/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
@@ -8089,7 +8132,7 @@ echo "configure:8094: checking for XSHM headers" >&5
      fi
 
      echo $ac_n "checking for XSHM libs""... $ac_c" 1>&6
-echo "configure:8104: checking for XSHM libs" >&5
+echo "configure:8147: checking for XSHM libs" >&5
      d=$with_xshm/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
@@ -8124,17 +8167,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:8139: checking for X11/extensions/XShm.h" >&5
+echo "configure:8182: checking for X11/extensions/XShm.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8144 "configure"
+#line 8187 "configure"
 #include "confdefs.h"
 #include <X11/extensions/XShm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8168,17 +8211,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:8183: checking for sys/ipc.h" >&5
+echo "configure:8226: checking for sys/ipc.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8188 "configure"
+#line 8231 "configure"
 #include "confdefs.h"
 #include <sys/ipc.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8193: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8213,17 +8256,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:8228: checking for sys/shm.h" >&5
+echo "configure:8271: checking for sys/shm.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8233 "configure"
+#line 8276 "configure"
 #include "confdefs.h"
 #include <sys/shm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8275,7 +8318,7 @@ fi
   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
 
   echo $ac_n "checking for XShmQueryExtension in -lXextSam""... $ac_c" 1>&6
-echo "configure:8290: checking for XShmQueryExtension in -lXextSam" >&5
+echo "configure:8333: 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
@@ -8283,7 +8326,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXextSam -lX11 -lXext -lm $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8298 "configure"
+#line 8341 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8294,7 +8337,7 @@ int main() {
 XShmQueryExtension()
 ; return 0; }
 EOF
-if { (eval echo configure:8309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8361,7 +8404,7 @@ fi
 
     /*)
      echo $ac_n "checking for DOUBLE-BUFFER headers""... $ac_c" 1>&6
-echo "configure:8376: checking for DOUBLE-BUFFER headers" >&5
+echo "configure:8419: checking for DOUBLE-BUFFER headers" >&5
      d=$with_xdbe/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
@@ -8371,7 +8414,7 @@ echo "configure:8376: checking for DOUBLE-BUFFER headers" >&5
      fi
 
      echo $ac_n "checking for DOUBLE-BUFFER libs""... $ac_c" 1>&6
-echo "configure:8386: checking for DOUBLE-BUFFER libs" >&5
+echo "configure:8429: checking for DOUBLE-BUFFER libs" >&5
      d=$with_xdbe/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
@@ -8405,17 +8448,17 @@ if test "$with_xdbe" = yes; then
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   ac_safe=`echo "X11/extensions/Xdbe.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/extensions/Xdbe.h""... $ac_c" 1>&6
-echo "configure:8420: checking for X11/extensions/Xdbe.h" >&5
+echo "configure:8463: checking for X11/extensions/Xdbe.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8425 "configure"
+#line 8468 "configure"
 #include "confdefs.h"
 #include <X11/extensions/Xdbe.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8478,7 +8521,7 @@ fi
 
     /*)
      echo $ac_n "checking for XReadDisplay headers""... $ac_c" 1>&6
-echo "configure:8493: checking for XReadDisplay headers" >&5
+echo "configure:8536: checking for XReadDisplay headers" >&5
      d=$with_readdisplay/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
@@ -8488,7 +8531,7 @@ echo "configure:8493: checking for XReadDisplay headers" >&5
      fi
 
      echo $ac_n "checking for XReadDisplay libs""... $ac_c" 1>&6
-echo "configure:8503: checking for XReadDisplay libs" >&5
+echo "configure:8546: checking for XReadDisplay libs" >&5
      d=$with_readdisplay/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
@@ -8521,17 +8564,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:8536: checking for X11/extensions/readdisplay.h" >&5
+echo "configure:8579: checking for X11/extensions/readdisplay.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8541 "configure"
+#line 8584 "configure"
 #include "confdefs.h"
 #include <X11/extensions/readdisplay.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8546: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8586,7 +8629,7 @@ fi
 
     /*)
      echo $ac_n "checking for Iris Video headers""... $ac_c" 1>&6
-echo "configure:8601: checking for Iris Video headers" >&5
+echo "configure:8644: checking for Iris Video headers" >&5
      d=$with_sgivideo/include
      if test -d $d; then
        X_CFLAGS="-I$d $X_CFLAGS"
@@ -8596,7 +8639,7 @@ echo "configure:8601: checking for Iris Video headers" >&5
      fi
 
      echo $ac_n "checking for Iris Video libs""... $ac_c" 1>&6
-echo "configure:8611: checking for Iris Video libs" >&5
+echo "configure:8654: checking for Iris Video libs" >&5
      d=$with_sgivideo/lib
      if test -d $d; then
        X_LIBS="-L$d $X_LIBS"
@@ -8629,17 +8672,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:8644: checking for dmedia/vl.h" >&5
+echo "configure:8687: checking for dmedia/vl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8649 "configure"
+#line 8692 "configure"
 #include "confdefs.h"
 #include <dmedia/vl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8664,7 +8707,7 @@ fi
   if test "$have_sgivideo" = yes; then
     have_sgivideo=no
     echo $ac_n "checking for vlOpenVideo in -lvl""... $ac_c" 1>&6
-echo "configure:8679: checking for vlOpenVideo in -lvl" >&5
+echo "configure:8722: 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
@@ -8672,7 +8715,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lvl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8687 "configure"
+#line 8730 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8683,7 +8726,7 @@ int main() {
 vlOpenVideo()
 ; return 0; }
 EOF
-if { (eval echo configure:8698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8754,7 +8797,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:8769: checking for $with_zippy_req" >&5
+echo "configure:8812: checking for $with_zippy_req" >&5
       if test -x "$with_zippy_req" ; then
         echo "$ac_t""yes" 1>&6
       else
@@ -8768,7 +8811,7 @@ echo "configure:8769: 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:8783: checking for $ac_word" >&5
+echo "configure:8826: 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
@@ -8818,7 +8861,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:8833: checking for $ac_word" >&5
+echo "configure:8876: 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
@@ -8852,7 +8895,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:8867: checking for $ac_word" >&5
+echo "configure:8910: 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
@@ -8887,7 +8930,7 @@ done
 
   if test -n "$emacs_exe" ; then
     echo $ac_n "checking for emacs yow""... $ac_c" 1>&6
-echo "configure:8902: checking for emacs yow" >&5
+echo "configure:8945: checking for emacs yow" >&5
     #
     # get emacs to tell us where the libexec directory is.
     #
@@ -8909,7 +8952,7 @@ echo "configure:8902: 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:8924: checking for xemacs yow" >&5
+echo "configure:8967: checking for xemacs yow" >&5
     if test -n "$xemacs_exe" ; then
       #
       # get xemacs to tell us where the libexec directory is.
@@ -8968,7 +9011,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:8983: checking for $ac_word" >&5
+echo "configure:9026: 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
@@ -9004,7 +9047,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:9019: checking for $ac_word" >&5
+echo "configure:9062: 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
index c6688070bf6646bba305ae7d07de19987aad6c09..205480884039f217ff1927372f523fb6fb90a7a7 100644 (file)
@@ -1,4 +1,4 @@
-# configure.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
+# configure.in --- xscreensaver, Copyright (c) 1997-2000 Jamie Zawinski.
 #
 
 AC_INIT(driver/subprocs.c)
@@ -997,14 +997,22 @@ 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 that succeeded, then check for the DPMS code in the libraries
   if test "$have_dpms" = yes; then
+
+    # first look in -lXext (this is where it is with XFree86 4.0)
     have_dpms=no
-    AC_CHECK_X_LIB(Xdpms, DPMSInfo,
-                  [have_dpms=yes; SAVER_LIBS="$SAVER_LIBS -lXdpms"], [true],
-                  -lXext -lX11)
+    AC_CHECK_X_LIB(Xext, DPMSInfo, [have_dpms=yes], [true], -lXext -lX11)
+
+    # if that failed, look in -lXdpms (this is where it was in XFree86 3.x)
+    if test "$have_dpms" = no; then
+      AC_CHECK_X_LIB(Xdpms, DPMSInfo,
+                    [have_dpms=yes; SAVER_LIBS="$SAVER_LIBS -lXdpms"], [true],
+                    -lXext -lX11)
+    fi
   fi
 
+
   # if that succeeded, then we've really got it.
   if test "$have_dpms" = yes; then
     AC_DEFINE(HAVE_DPMS_EXTENSION)
@@ -1619,8 +1627,8 @@ if test "$with_gtk" = yes; then
     gtk_path="$gnome_dir:$gtk_path"
   fi
 
-  AC_PATH_PROGS(glib_config,  glib-config,,  $gtk_path)
-  AC_PATH_PROGS(gtk_config,   gtk-config,,   $gtk_path)
+  AC_PATH_PROGS(glib_config,  glib12-config glib-config,,  $gtk_path)
+  AC_PATH_PROGS(gtk_config,   gtk12-config  gtk-config,,   $gtk_path)
 
   if test "$with_gnome" = yes; then
     AC_PATH_PROGS(gnome_config, gnome-config,, $gtk_path)
@@ -1635,7 +1643,7 @@ if test "$with_gtk" = yes; then
 
   if test "$have_gtk" = yes; then
     AC_CACHE_CHECK([Gtk version number], ac_cv_gtk_version_string,
-                   [ac_cv_gtk_version_string=`$glib_config --version`])
+                   [ac_cv_gtk_version_string=`$gtk_config --version`])
     ac_gtk_version_string=$ac_cv_gtk_version_string
     # M4 sucks!!
     changequote(X,Y)
@@ -1671,7 +1679,7 @@ if test "$with_gtk" = yes; then
     AC_MSG_CHECKING(for Gnome capplet includes)
     AC_CACHE_VAL(ac_cv_gnome_config_cflags,
       [if ( $gnome_config --cflags $gnome_config_libs 2>&1 >/dev/null | \
-            grep -q Unknown ) ; then
+            grep Unknown >/dev/null ) ; then
          ac_cv_gnome_config_cflags=''
        else
          ac_cv_gnome_config_cflags=`$gnome_config --cflags $gnome_config_libs`
@@ -1689,7 +1697,7 @@ if test "$with_gtk" = yes; then
     AC_MSG_CHECKING(for Gnome capplet libs)
     AC_CACHE_VAL(ac_cv_gnome_config_libs,
       [if ( $gnome_config --libs $gnome_config_libs 2>&1 >/dev/null |
-            grep -q Unknown ) ; then
+            grep Unknown >/dev/null ) ; then
          ac_cv_gnome_config_libs=''
        else
          ac_cv_gnome_config_libs=`$gnome_config --libs $gnome_config_libs`
@@ -2016,28 +2024,6 @@ EOF
     #
     AC_CHECK_X_LIB($gl_lib_1, glBindTexture, [AC_DEFINE(HAVE_GLBINDTEXTURE)],
                    [true], $GL_LIBS -lX11 -lXext -lm)
-
-
-    # Check whether the `xscreensaver' executable should link against GL.
-    # See comments in utils/visual-gl.c for why this is sometimes necessary.
-    #
-    AC_MSG_CHECKING(whether drastic GL measures must be taken)
-    case "$host" in
-      *-sgi*)
-        AC_MSG_RESULT([yes -- hello, SGI.])
-        AC_DEFINE(DAEMON_USE_GL)
-        SAVER_GL_SRCS='$(UTILS_SRC)/visual-gl.c'
-        SAVER_GL_OBJS='$(UTILS_BIN)/visual-gl.o'
-        SAVER_GL_LIBS="$GL_LIBS"
-      ;;
-      *)
-        AC_MSG_RESULT([no -- non-SGI.])
-        SAVER_GL_SRCS=''
-        SAVER_GL_OBJS=''
-        SAVER_GL_LIBS=''
-      ;;
-    esac
-
   fi
 
 elif test "$with_gl" != no; then
index 3c2dbced1a30fb397b39d6b065f0d39a156750ea..6f78544af2f59cf87da07cc14e11d324ec3b95b1 100644 (file)
@@ -210,8 +210,12 @@ install-program: $(EXES)
        fi ;                                                                  \
        echo $$inst xscreensaver $(install_prefix)$(bindir)/xscreensaver ;    \
        $$inst xscreensaver $(install_prefix)$(bindir)/xscreensaver
+       @echo $(INSTALL_PROGRAM) xscreensaver-command \
+         $(install_prefix)$(bindir)/xscreensaver-command ; \
        $(INSTALL_PROGRAM) xscreensaver-command \
          $(install_prefix)$(bindir)/xscreensaver-command
+       @echo $(INSTALL_PROGRAM) xscreensaver-demo \
+         $(install_prefix)$(bindir)/xscreensaver-demo ; \
        $(INSTALL_PROGRAM) xscreensaver-demo \
          $(install_prefix)$(bindir)/xscreensaver-demo
 
@@ -286,8 +290,26 @@ install-pam:
        conf="$(PAM_CONF)" ;                                            \
                                                                        \
        if [ -d $$dir ] ; then                                          \
-         echo $(INSTALL_DATA) $$src $$dir/$$dest ;                     \
-         $(INSTALL_DATA) $$src $$dir/$$dest ;                          \
+                                                                       \
+         if [ -f $$dir/xdm ]; then                                     \
+           src2=$$dir/xdm ;                                            \
+         elif [ -f $$dir/login ]; then                                 \
+           src2=$$dir/login ;                                          \
+         fi ;                                                          \
+                                                                       \
+         if [ -z "$$src2" ]; then                                      \
+           echo $(INSTALL_DATA) $$src $$dir/$$dest ;                   \
+           $(INSTALL_DATA) $$src $$dir/$$dest ;                        \
+         else                                                          \
+           src="xscreensaver.pam.$$$$" ;                               \
+           echo "grep '^#%\|^auth' $$src2 > $$src" ;                   \
+                 grep '^#%\|^auth' $$src2 > $$src ;                    \
+           echo $(INSTALL_DATA) $$src $$dir/$$dest ;                   \
+                $(INSTALL_DATA) $$src $$dir/$$dest ;                   \
+           echo rm -f $$src ;                                          \
+                rm -f $$src ;                                          \
+         fi ;                                                          \
+                                                                       \
          if [ ! -f $$dir/$$dest ]; then                                \
            e=echo ;                                                    \
  $$e ""                                                                             ;\
@@ -618,6 +640,7 @@ subprocs.o: ../config.h
 subprocs.o: $(srcdir)/xscreensaver.h
 subprocs.o: $(srcdir)/prefs.h
 subprocs.o: $(UTILS_SRC)/yarandom.h
+subprocs.o: $(UTILS_SRC)/visual.h
 xset.o: ../config.h
 xset.o: $(srcdir)/xscreensaver.h
 xset.o: $(srcdir)/prefs.h
index 03c4231bcd959a95871b40066571ef19ddf3fcdc..efc5955e13fff579a28870aea8478f9c9161a65e 100644 (file)
@@ -4,8 +4,8 @@
 !            a screen saver and locker for the X window system
 !                            by Jamie Zawinski
 !
-!                              version 3.25
-!                              19-Jul-2000
+!                              version 3.26
+!                              10-Nov-2000
 !
 ! See "man xscreensaver" for more info.  The latest version is always
 ! available at http://www.jwz.org/xscreensaver/
              "Ripples (stir)"  ripples -root -oily -light 2 -stir          \n\
           "Ripples (desktop)"  ripples -root -water -light 6               \n\
                                hypercube -root                             \n\
+                               hyperball -root                             \n\
                                halo -root                                  \n\
                                maze -root                                  \n\
                                noseguy -root                               \n\
                                xspirograph -root                           \n\
                                nerverot -root                              \n\
 -          "NerveRot (dense)"  nerverot -root -count 1000                  \n\
--          "NerveRot (thick)"  nerverot -root -count 64 -line-width 4      \n\
+-          "NerveRot (thick)"  nerverot -root -count 100 -line-width 4       \
+                               -max-nerve-radius 0.8 -nervousness 0.5 -db  \n\
+                               xrayswarm -root                             \n\
   color:                       bubbles -root                               \n\
   default-n:                   webcollage -root                            \n\
   default-n:  "WebCollage (whacked)"                                         \
                                  -texture_quality -light -fog              \n\
 @GLE_KLUDGE@GL:                        extrusion -root                             \n\
 @GL_KLUDGE@ GL:                        sierpinski3d -root                          \n\
-@GL_KLUDGE@ GL:                        starwars -root                              \n\
+@GL_KLUDGE@ GL:                        gflux -root                                 \n\
                                                                              \
 -                              xdaliclock -root -builtin3 -cycle           \n\
 - default-n:                   xearth -nofork -nostars -ncolors 50           \
@@ -388,7 +391,7 @@ XScreenSaver.bourneShell:           /bin/sh
 *passwd.thermometer.width:     8
 
 *splash.heading.label:         XScreenSaver %s
-*splash.body.label:            Copyright Â© 1991-1999 by
+*splash.body.label:            Copyright Â© 1991-2000 by
 *splash.body2.label:           Jamie Zawinski <jwz@jwz.org>
 *splash.demo.label:            Demo
 *splash.prefs.label:           Prefs
@@ -682,6 +685,11 @@ visualize the rotation, it uses a different color for the edges of \
 each face.  Don't think about it too long, or your brain will melt.    \
 Written by Joe Keane, Fritz Mueller, and Jamie Zawinski.
 
+*hacks.hyperball.documentation:                                                \
+Hyperball is to hypercube as icosahedron is to cube: this displays     \
+a 2D projection of the sequence of 3D objects which are the projections        \
+of the 4D analog to the icosahedron.  Written by Joe Keane.
+
 *hacks.halo.documentation:                                             \
 This draws trippy psychedelic circular patterns that hurt to look at.  \
 It can also animate the control-points, but that takes a lot of CPU    \
@@ -1203,6 +1211,16 @@ This draws rippling interference patterns like splashing water.          \
 With the -water option, it manipulates your desktop image to look      \
 like something is dripping into it.  Written by Tom Hammersley.
 
+*hacks.gflux.name: GFlux
+*hacks.gflux.documentation:                                            \
+Draws a rippling waves on a rotating wireframe grid, using GL.         \
+Written by Josiah Pease.
+
+*hacks.xrayswarm.name: XRaySwarm
+*hacks.xrayswarm.documentation:                                        \
+Draws a few swarms of critters flying around the screen, with nicely   \
+faded color trails behind them.  Written by Chris Leger.
+
 
 !=============================================================================
 !
@@ -1257,7 +1275,7 @@ don't have it already, you can find it at                               \
 
 *hacks.xsnow.documentation:                                            \
 Draws falling snow and the occasional tiny Santa.  By Rick Jansen.      \
-You can find it at <http://zoutmijn.bpa.nl/rick/Xsnow/>.
+You can find it at <http://www.euronet.nl/~rja/Xsnow/>.
 
 *hacks.goban.documentation:                                            \
 Replays historical games of go (aka wei-chi and baduk) on the screen.   \
index 550600cbe05fff5f167cfaed721c39e7687686a9..56c3687e4d5fcf6b1198284a0e0f794ca561caf1 100644 (file)
@@ -71,6 +71,7 @@
              \"Ripples (stir)\"        ripples -root -oily -light 2 -stir          \\n\
           \"Ripples (desktop)\"        ripples -root -water -light 6               \\n\
                                hypercube -root                             \\n\
+                               hyperball -root                             \\n\
                                halo -root                                  \\n\
                                maze -root                                  \\n\
                                noseguy -root                               \\n\
                                xspirograph -root                           \\n\
                                nerverot -root                              \\n\
 -          \"NerveRot (dense)\"        nerverot -root -count 1000                  \\n\
--          \"NerveRot (thick)\"        nerverot -root -count 64 -line-width 4      \\n\
+-          \"NerveRot (thick)\"        nerverot -root -count 100 -line-width 4       \
+                               -max-nerve-radius 0.8 -nervousness 0.5 -db  \\n\
+                               xrayswarm -root                             \\n\
   color:                       bubbles -root                               \\n\
   default-n:                   webcollage -root                            \\n\
   default-n:  \"WebCollage (whacked)\"                                       \
                                  -texture_quality -light -fog              \\n\
           GL:                  extrusion -root                             \\n\
           GL:                  sierpinski3d -root                          \\n\
-          GL:                  starwars -root                              \\n\
+          GL:                  gflux -root                                 \\n\
                                                                              \
 -                              xdaliclock -root -builtin3 -cycle           \\n\
 - default-n:                   xearth -nofork -nostars -ncolors 50           \
 "*passwd.passwdFont:           *-courier-medium-r-*-*-*-140-*-*-*-iso8859-1",
 "*passwd.thermometer.width:    8",
 "*splash.heading.label:                XScreenSaver %s",
-"*splash.body.label:           Copyright Â© 1991-1999 by",
+"*splash.body.label:           Copyright Â© 1991-2000 by",
 "*splash.body2.label:          Jamie Zawinski <jwz@jwz.org>",
 "*splash.demo.label:           Demo",
 "*splash.prefs.label:          Prefs",
@@ -471,6 +474,10 @@ eight cubes, each touching six others.     To make it easier to            \
 visualize the rotation, it uses a different color for the edges of     \
 each face.  Don't think about it too long, or your brain will melt.    \
 Written by Joe Keane, Fritz Mueller, and Jamie Zawinski.",
+"*hacks.hyperball.documentation:                                               \
+Hyperball is to hypercube as icosahedron is to cube: this displays     \
+a 2D projection of the sequence of 3D objects which are the projections        \
+of the 4D analog to the icosahedron.  Written by Joe Keane.",
 "*hacks.halo.documentation:                                            \
 This draws trippy psychedelic circular patterns that hurt to look at.  \
 It can also animate the control-points, but that takes a lot of CPU    \
@@ -899,6 +906,14 @@ triangle fractal, using GL.  Written by Tim Robinson and Jamie Zawinski.",
 This draws rippling interference patterns like splashing water.                \
 With the -water option, it manipulates your desktop image to look      \
 like something is dripping into it.  Written by Tom Hammersley.",
+"*hacks.gflux.name: GFlux",
+"*hacks.gflux.documentation:                                           \
+Draws a rippling waves on a rotating wireframe grid, using GL.         \
+Written by Josiah Pease.",
+"*hacks.xrayswarm.name: XRaySwarm",
+"*hacks.xrayswarm.documentation:                                       \
+Draws a few swarms of critters flying around the screen, with nicely   \
+faded color trails behind them.  Written by Chris Leger.",
 "*hacks.xdaliclock.name: XDaliClock",
 "*hacks.xdaliclock.documentation:                                      \
 XDaliClock draws a large digital clock, the numbers of which change by \
@@ -940,7 +955,7 @@ don't have it already, you can find it at                               \
 <http://metalab.unc.edu/pub/Linux/X11/demos/>.",
 "*hacks.xsnow.documentation:                                           \
 Draws falling snow and the occasional tiny Santa.  By Rick Jansen.      \
-You can find it at <http://zoutmijn.bpa.nl/rick/Xsnow/>.",
+You can find it at <http://www.euronet.nl/~rja/Xsnow/>.",
 "*hacks.goban.documentation:                                           \
 Replays historical games of go (aka wei-chi and baduk) on the screen.   \
 By Scott Draves.  You can find it at <http://www.draves.org/goban/>.",
index 7388d5a3d0d02f4ed7c96e7065a5689064faba27..55c4358ffca03a66c13cd49ddc85497938123eb3 100644 (file)
@@ -80,3 +80,7 @@ pref_changed_cb                        (GtkNotebook     *notebook,
                                         GtkNotebookPage *page,
                                         gint             page_num,
                                         gpointer         user_data);
+
+void
+enabled_cb                             (GtkToggleButton *togglebutton,
+                                        gpointer         user_data);
index fc03afac9f3cd026417c5a1da6092cb12b354463..6adcd800c74b3a0abe5e6c1b086f0236a35d7da3 100644 (file)
@@ -830,6 +830,9 @@ create_xscreensaver_demo (void)
   gtk_signal_connect (GTK_OBJECT (prev), "clicked",
                       GTK_SIGNAL_FUNC (run_prev_cb),
                       NULL);
+  gtk_signal_connect (GTK_OBJECT (enabled), "toggled",
+                      GTK_SIGNAL_FUNC (enabled_cb),
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (demo), "clicked",
                       GTK_SIGNAL_FUNC (run_this_cb),
                       NULL);
index 02eb701f3e2d616ca3c696ce0be61b27f1d3789d..be35a67d15e1055a20cbec529f4c260c4381ef42 100644 (file)
@@ -171,7 +171,7 @@ ensure_selected_item_visible (GtkWidget *widget)
        kids; kids = kids->next)
     nkids++;
 
-  adj = gtk_scrolled_window_get_vadjustment (scroller);                        
+  adj = gtk_scrolled_window_get_vadjustment (scroller);
 
   gdk_window_get_geometry (GTK_WIDGET(vp)->window,
                            &ignore, &ignore, &ignore, &parent_h, &ignore);
@@ -919,6 +919,80 @@ list_unselect_cb (GtkList *list, GtkWidget *child)
   populate_demo_window (GTK_WIDGET (list), -1, pair);
 }
 
+
+static int updating_enabled_cb = 0;  /* kludge to make sure that enabled_cb
+                                        is only run by user action, not by
+                                        program action. */
+
+/* Called when the checkboxes that are in the left column of the
+   scrolling list are clicked.  This both populates the right pane
+   (just as clicking on the label (really, listitem) does) and
+   also syncs this checkbox with  the right pane Enabled checkbox.
+ */
+static void
+list_checkbox_cb (GtkWidget *cb, gpointer client_data)
+{
+  prefs_pair *pair = (prefs_pair *) client_data;
+
+  GtkWidget *line_hbox = GTK_WIDGET (cb)->parent;
+  GtkWidget *line = GTK_WIDGET (line_hbox)->parent;
+
+  GtkList *list = GTK_LIST (GTK_WIDGET (line)->parent);
+  GtkViewport *vp = GTK_VIEWPORT (GTK_WIDGET (list)->parent);
+  GtkScrolledWindow *scroller = GTK_SCROLLED_WINDOW (GTK_WIDGET (vp)->parent);
+  GtkAdjustment *adj;
+  double scroll_top;
+
+  GtkToggleButton *enabled =
+    GTK_TOGGLE_BUTTON (name_to_widget (cb, "enabled"));
+
+  int which = gtk_list_child_position (list, line);
+
+  /* remember previous scroll position of the top of the list */
+  adj = gtk_scrolled_window_get_vadjustment (scroller);
+  scroll_top = adj->value;
+
+  apply_changes_and_save (GTK_WIDGET (list));
+  gtk_list_select_item (list, which);
+  /* ensure_selected_item_visible (GTK_WIDGET (list)); */
+  populate_demo_window (GTK_WIDGET (list), which, pair);
+  
+  updating_enabled_cb++;
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (enabled),
+                                GTK_TOGGLE_BUTTON (cb)->active);
+  updating_enabled_cb--;
+
+  /* restore the previous scroll position of the top of the list.
+     this is weak, but I don't really know why it's moving... */
+  gtk_adjustment_set_value (adj, scroll_top);
+}
+
+
+/* Called when the right pane Enabled checkbox is clicked.  This syncs
+   the corresponding checkbox inside the scrolling list to the state
+   of this checkbox.
+ */
+void
+enabled_cb (GtkWidget *cb, gpointer client_data)
+{
+  int which = selected_hack_number (cb);
+  
+  if (updating_enabled_cb) return;
+
+  if (which != -1)
+    {
+      GtkList *list = GTK_LIST (name_to_widget (cb, "list"));
+      GList *kids = GTK_LIST (list)->children;
+      GtkWidget *line = GTK_WIDGET (g_list_nth_data (kids, which));
+      GtkWidget *line_hbox = GTK_WIDGET (GTK_BIN (line)->child);
+      GtkWidget *line_check =
+        GTK_WIDGET (gtk_container_children (GTK_CONTAINER (line_hbox))->data);
+
+      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (line_check),
+                                    GTK_TOGGLE_BUTTON (cb)->active);
+    }
+}
+
 \f
 /* Populating the various widgets
  */
@@ -1040,18 +1114,50 @@ populate_hack_list (GtkWidget *toplevel, prefs_pair *pair)
 
   for (h = hacks; h && *h; h++)
     {
+      /* A GtkList must contain only GtkListItems, but those can contain
+         an arbitrary widget.  We add an Hbox, and inside that, a Checkbox
+         and a Label.  We handle single and double click events on the
+         line itself, for clicking on the text, but the interior checkbox
+         also handles its own events.
+       */
       GtkWidget *line;
+      GtkWidget *line_hbox;
+      GtkWidget *line_check;
+      GtkWidget *line_label;
+
       char *pretty_name = (h[0]->name
                            ? strdup (h[0]->name)
                            : make_pretty_name (h[0]->command));
 
-      line = gtk_list_item_new_with_label (pretty_name);
+      line = gtk_list_item_new ();
+      line_hbox = gtk_hbox_new (FALSE, 0);
+      line_check = gtk_check_button_new ();
+      line_label = gtk_label_new (pretty_name);
+
+      gtk_container_add (GTK_CONTAINER (line), line_hbox);
+      gtk_box_pack_start (GTK_BOX (line_hbox), line_check, FALSE, FALSE, 0);
+      gtk_box_pack_start (GTK_BOX (line_hbox), line_label, FALSE, FALSE, 0);
+
+      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (line_check),
+                                    h[0]->enabled_p);
+      gtk_label_set_justify (GTK_LABEL (line_label), GTK_JUSTIFY_LEFT);
+
+      gtk_widget_show (line_check);
+      gtk_widget_show (line_label);
+      gtk_widget_show (line_hbox);
+      gtk_widget_show (line);
+
       free (pretty_name);
 
       gtk_container_add (GTK_CONTAINER (list), line);
       gtk_signal_connect (GTK_OBJECT (line), "button_press_event",
                           GTK_SIGNAL_FUNC (list_doubleclick_cb),
                           (gpointer) pair);
+
+      gtk_signal_connect (GTK_OBJECT (line_check), "toggled",
+                          GTK_SIGNAL_FUNC (list_checkbox_cb),
+                          (gpointer) pair);
+
 #if 0 /* #### */
       GTK_WIDGET (GTK_BIN(line)->child)->style =
         gtk_style_copy (GTK_WIDGET (text_line)->style);
@@ -1474,7 +1580,11 @@ populate_demo_window (GtkWidget *toplevel, int which, prefs_pair *pair)
   gtk_label_set_text (doc, (doc_string ? doc_string : ""));
   gtk_entry_set_text (cmd, (hack ? hack->command : ""));
   gtk_entry_set_position (cmd, 0);
+
+  updating_enabled_cb++;
   gtk_toggle_button_set_active (enabled, (hack ? hack->enabled_p : False));
+  updating_enabled_cb--;
+
   gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (vis)->entry),
                       (hack
                        ? (hack->visual && *hack->visual
index bd44a1afc3eb5f3eaf7ca2513b1e8a706bd3b8c8..b508856034be167b6f45cbf4bd6cd410d0d61971 100644 (file)
@@ -985,6 +985,8 @@ passwd_animate_timer (XtPointer closure, XtIntervalId *id)
 }
 
 
+static XComposeStatus *compose_status;
+
 static void
 handle_passwd_key (saver_info *si, XKeyEvent *event)
 {
@@ -995,7 +997,7 @@ handle_passwd_key (saver_info *si, XKeyEvent *event)
   char s[2];
   char *stars = 0;
   int i;
-  int size = XLookupString (event, s, 1, 0, 0);
+  int size = XLookupString (event, s, 1, 0, compose_status);
 
   if (size != 1) return;
 
@@ -1207,12 +1209,17 @@ unlock_p (saver_info *si)
   make_passwd_window (si);
   if (cmap) XInstallColormap (si->dpy, cmap);
 
+  compose_status = calloc (1, sizeof (*compose_status));
+
   handle_typeahead (si);
   passwd_event_loop (si);
 
   status = (si->pw_data->state == pw_ok);
   destroy_passwd_window (si);
 
+  free (compose_status);
+  compose_status = 0;
+
   cmap = si->default_screen->cmap;
   if (cmap) XInstallColormap (si->dpy, cmap);
 
index aedd47e294c4e64917b2554a7d32555b3105a3b8..9e6a7194f3150424abfa87cd61dd87f04ee83d91 100644 (file)
@@ -152,6 +152,7 @@ struct pam_closure {
    So we get around this by using a global variable instead.  Shoot me!
 
    (I've been told this is bug 4092227, and is fixed in Solaris 7.)
+   (I've also been told that it's fixed in Solaris 2.6 by patch 106257-05.)
  */
 static void *suns_pam_implementation_blows = 0;
 
index 83ad494e364edacfcb998ba30f578d1b62a7785b..343dcf097dba0bb5b0b8a234492420a6ddeb6145 100644 (file)
@@ -75,12 +75,12 @@ describe_uids (saver_info *si, FILE *out)
 
 
 static int
-set_ids_by_name (struct passwd *p, struct group *g, char **message_ret)
+set_ids_by_number (uid_t uid, gid_t gid, char **message_ret)
 {
   int uid_errno = 0;
   int gid_errno = 0;
-  uid_t uid = p->pw_uid;
-  gid_t gid = g->gr_gid;
+  struct passwd *p = getpwuid (uid);
+  struct group  *g = getgrgid (gid);
 
   if (message_ret)
     *message_ret = 0;
@@ -90,7 +90,8 @@ set_ids_by_name (struct passwd *p, struct group *g, char **message_ret)
      -1, then that would be Really Bad.  Rumor further has it that such
      systems really ought to be using -2 for "nobody", since that works.
      So, if we get a uid (or gid, for good measure) of -1, switch to -2
-     instead.
+     instead.  Note that this must be done after we've looked up the
+     user/group names with getpwuid(-1) and/or getgrgid(-1).
    */
   if (gid == (gid_t) -1) gid = (gid_t) -2;
   if (uid == (uid_t) -1) uid = (uid_t) -2;
@@ -107,7 +108,8 @@ set_ids_by_name (struct passwd *p, struct group *g, char **message_ret)
     {
       static char buf [1024];
       sprintf (buf, "changed uid/gid to %s/%s (%ld/%ld).",
-              p->pw_name, (g ? g->gr_name : "???"),
+              (p && p->pw_name ? p->pw_name : "???"),
+               (g && g->gr_name ? g->gr_name : "???"),
               (long) uid, (long) gid);
       if (message_ret)
        *message_ret = buf;
@@ -120,7 +122,7 @@ set_ids_by_name (struct passwd *p, struct group *g, char **message_ret)
        {
          sprintf (buf, "%s: couldn't set gid to %s (%ld)",
                   blurb(),
-                  (g ? g->gr_name : "???"),
+                  (g && g->gr_name ? g->gr_name : "???"),
                   (long) gid);
          if (gid_errno == -1)
            fprintf(stderr, "%s: unknown error\n", buf);
@@ -132,7 +134,7 @@ set_ids_by_name (struct passwd *p, struct group *g, char **message_ret)
        {
          sprintf (buf, "%s: couldn't set uid to %s (%ld)",
                   blurb(),
-                  (p ? p->pw_name : "???"),
+                  (p && p->pw_name ? p->pw_name : "???"),
                   (long) uid);
          if (uid_errno == -1)
            fprintf(stderr, "%s: unknown error\n", buf);
@@ -144,43 +146,6 @@ set_ids_by_name (struct passwd *p, struct group *g, char **message_ret)
     }
 }
 
-static int
-set_ids_by_number (uid_t uid, gid_t gid, char **message_ret)
-{
-  struct passwd *p;
-  struct group *g;
-
-  errno = 0;
-  p = getpwuid (uid);
-  if (!p)
-    {
-      char buf [1024];
-      sprintf (buf, "%s: error looking up name of user %d", blurb(),
-              (long) uid);
-      if (errno)
-       perror (buf);
-      else
-       fprintf (stderr, "%s: unknown error.\n", buf);
-      return -1;
-    }
-
-  errno = 0;
-  g = getgrgid (gid);
-  if (!g)
-    {
-      char buf [1024];
-      sprintf (buf, "%s: error looking up name of group %d", blurb(),
-              (long) gid);
-      if (errno)
-       perror (buf);
-      else
-       fprintf (stderr, "%s: unknown error.\n", buf);
-      return -1;
-    }
-
-  return set_ids_by_name (p, g, message_ret);
-}
-
 
 /* If we've been run as setuid or setgid to someone else (most likely root)
    turn off the extra permissions so that random user-specified programs
index ad2a426adbafe43f894ecdd625776e8a069b2bf6..fd4cef834fd13d4c56e88bca266d20a63ad1c7b3 100644 (file)
@@ -1,5 +1,5 @@
 /* subprocs.c --- choosing, spawning, and killing screenhacks.
- * xscreensaver, Copyright (c) 1991, 1992, 1993, 1995, 1997, 1998
+ * xscreensaver, Copyright (c) 1991, 1992, 1993, 1995, 1997, 1998, 1999, 2000
  *  Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
@@ -67,7 +67,7 @@ extern int kill (pid_t, int);         /* signal() is in sys/signal.h... */
 
 #include "xscreensaver.h"
 #include "yarandom.h"
-
+#include "visual.h"    /* for id_to_visual() */
 
 extern saver_info *global_si_kludge;   /* I hate C so much... */
 
@@ -1044,6 +1044,111 @@ hack_subproc_environment (saver_screen_info *ssi)
 #endif /* HAVE_PUTENV */
 }
 
+\f
+/* GL crap */
+
+Visual *
+get_best_gl_visual (saver_screen_info *ssi)
+{
+  saver_info *si = ssi->global;
+  pid_t forked;
+  int fds [2];
+  int in, out;
+  char buf[1024];
+
+  char *av[10];
+  int ac = 0;
+
+  av[ac++] = "xscreensaver-gl-helper";
+  av[ac] = 0;
+
+  if (pipe (fds))
+    {
+      perror ("error creating pipe:");
+      return 0;
+    }
+
+  in = fds [0];
+  out = fds [1];
+
+  switch ((int) (forked = fork ()))
+    {
+    case -1:
+      {
+        sprintf (buf, "%s: couldn't fork", blurb());
+        perror (buf);
+        saver_exit (si, 1, 0);
+      }
+    case 0:
+      {
+        int stdout_fd = 1;
+
+        close (in);  /* don't need this one */
+        close (ConnectionNumber (si->dpy));    /* close display fd */
+
+        if (dup2 (out, stdout_fd) < 0)         /* pipe stdout */
+          {
+            perror ("could not dup() a new stdout:");
+            return 0;
+          }
+        hack_subproc_environment (ssi);                /* set $DISPLAY */
+
+        execvp (av[0], av);                    /* shouldn't return. */
+
+        if (errno != ENOENT || si->prefs.verbose_p)
+          {
+            /* Ignore "no such file or directory" errors, unless verbose.
+               Issue all other exec errors, though. */
+            sprintf (buf, "%s: running %s", blurb(), av[0]);
+            perror (buf);
+          }
+        exit (1);                               /* exits fork */
+        break;
+      }
+    default:
+      {
+        int result = 0;
+        int wait_status = 0;
+
+        FILE *f = fdopen (in, "r");
+        unsigned long v = 0;
+        char c;
+
+        close (out);  /* don't need this one */
+
+        *buf = 0;
+        fgets (buf, sizeof(buf)-1, f);
+        fclose (f);
+
+        /* Wait for the child to die. */
+        waitpid (-1, &wait_status, 0);
+
+        if (1 == sscanf (buf, "0x%x %c", &v, &c))
+          result = (int) v;
+
+        if (result == 0)
+          {
+            if (si->prefs.verbose_p)
+              fprintf (stderr, "%s: %s did not report a GL visual!\n",
+                       blurb(), av[0]);
+            return 0;
+          }
+        else
+          {
+            Visual *v = id_to_visual (ssi->screen, result);
+            if (si->prefs.verbose_p)
+              fprintf (stderr, "%s: %s says the GL visual is 0x%X%s.\n",
+                       blurb(), av[0], result,
+                       (v == ssi->default_visual ? " (the default)" : ""));
+            return v;
+          }
+      }
+    }
+
+  abort();
+}
+
+
 \f
 /* Restarting the xscreensaver process from scratch. */
 
index a375e3068e541936937495817c9d66bb2ef244f5..b092a72b62d82baae3231b3155d61019a8bc8a51 100644 (file)
@@ -1,5 +1,5 @@
 /* windows.c --- turning the screen black; dealing with visuals, virtual roots.
- * xscreensaver, Copyright (c) 1991-1998 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1991-2000 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -1466,16 +1466,14 @@ select_visual (saver_screen_info *ssi, const char *visual_name)
          visual_name = "default";
          install_cmap_p = False;
        }
-#ifdef DAEMON_USE_GL
       else if (!strcmp(visual_name, "gl") ||
                !strcmp(visual_name, "Gl") ||
                !strcmp(visual_name, "GL"))
         {
-          new_v = get_gl_visual (ssi->screen);
+          new_v = ssi->best_gl_visual;
           if (!new_v && p->verbose_p)
             fprintf (stderr, "%s: no GL visuals.\n", progname);
         }
-#endif /* DAEMON_USE_GL */
 
       if (!new_v)
         new_v = get_visual (ssi->screen, visual_name, True, False);
index 8c74bac4ad05ac578dbee8835588685cae294785..684fd4e347af27042914b61806357d21fd7a9ebb 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver-command, Copyright (c) 1991-1999
+/* xscreensaver-command, Copyright (c) 1991-2000
  *  by Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
@@ -52,7 +52,7 @@ static char *usage = "\n\
 usage: %s -<option>\n\
 \n\
   This program provides external control of a running xscreensaver process.\n\
-  Version %s, copyright (c) 1991-1999 Jamie Zawinski <jwz@jwz.org>.\n\
+  Version %s, copyright (c) 1991-2000 Jamie Zawinski <jwz@jwz.org>.\n\
 \n\
   The xscreensaver program is a daemon that runs in the background.\n\
   You control a running xscreensaver process by sending it messages\n\
index fcd0dc7ae73b515aac60f978437c71863036ec8f..f2ead079007c78eaeb6952241ad0dea7e2140b36 100644 (file)
 .if n .sp 1
 .if t .sp .5
 ..
-.TH XScreenSaver 1 "19-Jul-2000 (3.25)" "X Version 11"
+.TH XScreenSaver 1 "10-Nov-2000 (3.26)" "X Version 11"
 .SH NAME
 xscreensaver-command - control a running xscreensaver process
 .SH SYNOPSIS
 .B xscreensaver-command
+[\-display \fIhost:display.screen\fP] \
 [\-help] \
 [\-demo] \
 [\-prefs] \
index cf98335e8cb64d63900ca221c9cbd577582ff0f3..ab6e0e3b51410a2ca29c5444d4b4775831cdbba8 100644 (file)
                <class>GtkCheckButton</class>
                <name>enabled</name>
                <can_focus>True</can_focus>
+               <signal>
+                 <name>toggled</name>
+                 <handler>enabled_cb</handler>
+                 <last_modification_time>Fri, 10 Nov 2000 12:50:58 GMT</last_modification_time>
+               </signal>
                <label>Enabled</label>
                <active>True</active>
                <draw_indicator>True</draw_indicator>
index d1e0feebfff19656251980d01364234d60a3ebae..b9460dd99250fdee2a3f002d82e22150911e00c5 100644 (file)
@@ -11,7 +11,7 @@
 .if n .sp 1
 .if t .sp .5
 ..
-.TH XScreenSaver 1 "19-Jul-2000 (3.25)" "X Version 11"
+.TH XScreenSaver 1 "10-Nov-2000 (3.26)" "X Version 11"
 .SH NAME
 xscreensaver-demo - interactively control the background xscreensaver daemon
 .SH SYNOPSIS
@@ -87,6 +87,12 @@ the dialog box visible again.
 
 Single-clicking in the list will populate the fields on the right side of
 the window.
+
+Each name in the list has a checkbox next to it: this is a duplicate of
+the \fIEnabled\fP checkbox, and indicates (and controls) whether
+xscreensaver will  use this display mode at all.  If the box is not
+checked, then this demo will not be run automatically (though you can
+run it explicitly by double-clicking on its name.)
 .TP 4
 .B Arrow Buttons
 Beneath the list are a pair of up and down arrows. Clicking on the down 
@@ -101,12 +107,12 @@ will invoke it.  (Note that most of these programs have their own man pages
 that describe the command-line options they take.)
 .TP 4
 .B Enabled
-The \fIEnabled\fI checkbox controls whether xscreensaver will use this
+The \fIEnabled\fP checkbox controls whether xscreensaver will use this
 display mode at all.  This way, all the modes can remain available, but
 you can choose which ones will be automatically run.
 .TP 4
 .B Visual
-The \fIVisual\fI field is where you can select the X visual type that this
+The \fIVisual\fP field is where you can select the X visual type that this
 demo will require.  If you specify one (other than \fIAny\fP) then the
 program will only be run on that kind of visual.  For example, you can
 specify that a particular program should only be run if color is available,
index 5ed966ecb819e444705abcaf219ec6783b81b75d..6ecaac324098b4d4557798e13ed36cfa193bc5f3 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1991-1999 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1991-2000 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -219,7 +219,7 @@ do_help (saver_info *si)
   fflush (stdout);
   fflush (stderr);
   fprintf (stdout, "\
-xscreensaver %s, copyright (c) 1991-1999 by Jamie Zawinski <jwz@jwz.org>\n\
+xscreensaver %s, copyright (c) 1991-2000 by Jamie Zawinski <jwz@jwz.org>\n\
 The standard Xt command-line options are accepted; other options include:\n\
 \n\
     -timeout <minutes>       When the screensaver should activate.\n\
@@ -376,6 +376,7 @@ startup_ehandler (String name, String type, String class,
           "              the parts of the manual that talk about XAUTH, XDM,\n"
           "              and root logins?\n"
           "\n"
+          "              http://www.jwz.org/xscreensaver/faq.html\n"
           "              http://www.jwz.org/xscreensaver/man.html\n"
           "\n",
            blurb());
@@ -593,7 +594,7 @@ print_banner (saver_info *si)
 
   if (p->verbose_p)
     fprintf (stderr,
-            "%s %s, copyright (c) 1991-1999 "
+            "%s %s, copyright (c) 1991-2000 "
             "by Jamie Zawinski <jwz@jwz.org>.\n",
             progname, si->version);
 
@@ -649,7 +650,7 @@ print_banner (saver_info *si)
 
 
 /* Examine all of the display's screens, and populate the `saver_screen_info'
-   structures.
+   structures.  Make sure this is called after hack_environment() sets $PATH.
  */
 static void
 initialize_per_screen_info (saver_info *si, Widget toplevel_shell)
@@ -676,6 +677,9 @@ initialize_per_screen_info (saver_info *si, Widget toplevel_shell)
       ssi->current_visual = ssi->default_visual;
       ssi->current_depth = visual_depth (ssi->screen, ssi->current_visual);
 
+      /* Execute a subprocess to find the GL visual. */
+      ssi->best_gl_visual = get_best_gl_visual (ssi);
+
       if (ssi == si->default_screen)
        /* Since this is the default screen, use the one already created. */
        ssi->toplevel_shell = toplevel_shell;
index 448fd37f149aa2c1c8d31b820eb52213de4612bb..1b244ddb5979c5d6e07474b0611d28a4689eb0e0 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1993-1998 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1993-2000 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -201,9 +201,11 @@ struct saver_screen_info {
                                    value here overrides prefs->install_cmap_p.)
                                  */
   Visual *current_visual;      /* The visual of the window. */
-  Visual *default_visual;      /* visual to use when none other specified */
   int current_depth;           /* How deep the visual (and the window) are. */
 
+  Visual *default_visual;      /* visual to use when none other specified */
+  Visual *best_gl_visual;      /* visual to use for GL hacks */
+
   Window real_vroot;           /* The original virtual-root window. */
   Window real_vroot_value;     /* What was in the __SWM_VROOT property. */
 
@@ -403,6 +405,7 @@ extern int BadWindow_ehandler (Display *dpy, XErrorEvent *error);
 extern Bool window_exists_p (Display *dpy, Window window);
 extern char *timestring (void);
 extern Bool display_is_on_console_p (saver_info *si);
+extern Visual *get_best_gl_visual (saver_screen_info *ssi);
 
 extern Atom XA_VROOT, XA_XSETROOT_ID;
 extern Atom XA_SCREENSAVER, XA_SCREENSAVER_VERSION, XA_SCREENSAVER_ID;
index 98931f7b99272210ac6fb0ab43a6fc534750a99f..06fa3bd03343efffd44b4761e762271d87fba40a 100644 (file)
@@ -11,7 +11,7 @@
 .if n .sp 1
 .if t .sp .5
 ..
-.TH XScreenSaver 1 "19-Jul-2000 (3.25)" "X Version 11"
+.TH XScreenSaver 1 "10-Nov-2000 (3.26)" "X Version 11"
 .SH NAME
 xscreensaver - graphics hack and screen locker, launched when the user is idle
 .SH SYNOPSIS
@@ -1247,6 +1247,7 @@ http://www.jwz.org/xscreensaver/
 .BR X (1),
 .BR xscreensaver\-demo (1),
 .BR xscreensaver\-command (1),
+.BR xscreensaver\-gl\-helper (1),
 .BR xdm (1),
 .BR xset (1),
 .BR Xsecurity (1),
@@ -1365,7 +1366,7 @@ http://www.jwz.org/xscreensaver/
 .BR xv (1),
 .BR xwave (1).
 .SH COPYRIGHT
-Copyright \(co 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
+Copyright \(co 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
 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
index 80d2377e30b2d223d2506be1c3cf897591628128..138571f844bbe417ba32c3553117363bab303846 100644 (file)
@@ -30,7 +30,7 @@ DEPEND_DEFINES        = @DEPEND_DEFINES@
 SHELL          = /bin/sh
 INSTALL                = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT  = @INSTALL_PROGRAM@
+INSTALL_SCRIPT  = @INSTALL_SCRIPT@
 INSTALL_DATA   = @INSTALL_DATA@
 INSTALL_DIRS   = @INSTALL_DIRS@
 HACKDIR                = @HACKDIR@
@@ -86,7 +86,8 @@ SRCS          = attraction.c blitspin.c bouboule.c braid.c bubbles.c \
                  sonar.c demon.c loop.c t3d.c penetrate.c deluxe.c compass.c \
                  squiral.c xflame.c wander.c spotlight.c critical.c \
                  phosphor.c xmatrix.c petri.c shadebobs.c xsublim.c ccurve.c \
-                 blaster.c bumps.c ripples.c xteevee.c xspirograph.c nerverot.c
+                 blaster.c bumps.c ripples.c xteevee.c xspirograph.c \
+                 nerverot.c xrayswarm.c hyperball.c
 SCRIPTS                = vidwhacker webcollage
 
 OBJS           = attraction.o blitspin.o bouboule.o braid.o bubbles.o \
@@ -105,7 +106,8 @@ OBJS                = attraction.o blitspin.o bouboule.o braid.o bubbles.o \
                  sonar.o demon.o loop.o t3d.o penetrate.o deluxe.o compass.o \
                  squiral.o xflame.o wander.o spotlight.o critical.o \
                  phosphor.o xmatrix.o petri.o shadebobs.o xsublim.o ccurve.o \
-                 blaster.o bumps.o ripples.o xteevee.o xspirograph.o nerverot.o
+                 blaster.o bumps.o ripples.o xteevee.o xspirograph.o \
+                 nerverot.o xrayswarm.o hyperball.o
 
 EXES           = attraction blitspin bouboule braid bubbles decayscreen deco \
                  drift flag flame forest vines galaxy grav greynetic halo \
@@ -119,7 +121,7 @@ EXES                = attraction blitspin bouboule braid bubbles decayscreen deco \
                  sonar demon loop t3d penetrate deluxe compass squiral \
                  xflame wander spotlight critical phosphor xmatrix petri \
                  shadebobs xsublim ccurve blaster bumps ripples xteevee \
-                 xspirograph nerverot
+                 xspirograph nerverot xrayswarm hyperball
 
 HACK_OBJS_1    = $(UTILS_BIN)/resources.o $(UTILS_BIN)/visual.o \
                  $(UTILS_BIN)/usleep.o $(UTILS_BIN)/yarandom.o @XMU_OBJS@
@@ -572,6 +574,11 @@ xspirograph:       xspirograph.o   $(HACK_OBJS) $(COL) $(ERASE)
 nerverot:      nerverot.o      $(HACK_OBJS) $(COL)
        $(CC_HACK) -o $@ $@.o   $(HACK_OBJS) $(COL) $(HACK_LIBS)
 
+xrayswarm:     xrayswarm.o     $(HACK_OBJS) 
+       $(CC_HACK) -o $@ $@.o   $(HACK_OBJS) $(HACK_LIBS)
+
+hyperball:     hyperball.o     $(HACK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(HACK_OBJS) $(HACK_LIBS)
 
 # The rules for those hacks which follow the `xlockmore' API.
 #
@@ -1793,4 +1800,22 @@ nerverot.o: $(UTILS_SRC)/hsv.h
 nerverot.o: $(UTILS_SRC)/colors.h
 nerverot.o: $(UTILS_SRC)/grabscreen.h
 nerverot.o: $(UTILS_SRC)/visual.h
+xrayswarm.o: $(srcdir)/screenhack.h
+xrayswarm.o: ../config.h
+xrayswarm.o: $(UTILS_SRC)/yarandom.h
+xrayswarm.o: $(UTILS_SRC)/usleep.h
+xrayswarm.o: $(UTILS_SRC)/resources.h
+xrayswarm.o: $(UTILS_SRC)/hsv.h
+xrayswarm.o: $(UTILS_SRC)/colors.h
+xrayswarm.o: $(UTILS_SRC)/grabscreen.h
+xrayswarm.o: $(UTILS_SRC)/visual.h
+hyperball.o: $(srcdir)/screenhack.h
+hyperball.o: ../config.h
+hyperball.o: $(UTILS_SRC)/yarandom.h
+hyperball.o: $(UTILS_SRC)/usleep.h
+hyperball.o: $(UTILS_SRC)/resources.h
+hyperball.o: $(UTILS_SRC)/hsv.h
+hyperball.o: $(UTILS_SRC)/colors.h
+hyperball.o: $(UTILS_SRC)/grabscreen.h
+hyperball.o: $(UTILS_SRC)/visual.h
 
index a65684615ccdf12f69d8d4682fbefe5567a75fee..2e45e6d82bdfbd95dbe5db9dfb94091d433347cf 100644 (file)
@@ -609,7 +609,7 @@ bsd (Display *dpy, Window window, int delay)
 
   for (bp = syncing; *bp;)
     {
-      char *bsd_bufs, oc;
+      char *bsd_bufs, oc = 0;
       for (;*bp && (*bp != ' '); bp++)
         ;
       if (*bp == ' ')
index 08850c7e1b485aac921e9e0e53847f93d23d2c21..40ddb9c2e6845cfce142b10993fe752d4f61db2c 100644 (file)
@@ -34,6 +34,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HALO.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HELIX.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HOPALONG.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HYPERBALL.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HYPERCUBE.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) IFS.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) IMSMAP.C
@@ -91,6 +92,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XLOCKMORE.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XLYAP.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XMATRIX.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XRAYSWARM.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XROGER-HACK.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XSCREENSAVER-SGIGL.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XSPIROGRAPH.C
index 08850c7e1b485aac921e9e0e53847f93d23d2c21..40ddb9c2e6845cfce142b10993fe752d4f61db2c 100644 (file)
@@ -34,6 +34,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HALO.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HELIX.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HOPALONG.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HYPERBALL.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HYPERCUBE.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) IFS.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) IMSMAP.C
@@ -91,6 +92,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XLOCKMORE.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XLYAP.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XMATRIX.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XRAYSWARM.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XROGER-HACK.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XSCREENSAVER-SGIGL.C
 $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XSPIROGRAPH.C
index a4b3dcdbc0fc1fba1e7c66bdf252341210f1df47..92facfc38d8ecc4dbf9cdc485e8fed172ae1447c 100644 (file)
@@ -3,7 +3,7 @@
 distort \- distort the content of the screen in interesting ways
 .SH SYNOPSIS
 .B distort
-[\-root] [\-window] [\-mono] [\-install] [\-noinstall] [\-visual \fIvisual\fP] [\-window\-id \fIwindow\-id\fP] [\-delay \fIusecs\fP] [\-radius \fIpixels\fP] [\-speed \fIfloat\fP] [\-number \fIint\fP] [\-swamp] [\-bounce] [\-reflect] [\-vortex] [\-magnify] [\-blackhole] [\-slow] [\-shm] [\-no\-shm]
+[\-root] [\-window] [\-mono] [\-install] [\-noinstall] [\-visual \fIvisual\fP] [\-window\-id \fIwindow\-id\fP] [\-delay \fIusecs\fP] [\-radius \fIpixels\fP] [\-speed \fIint\fP] [\-number \fIint\fP] [\-swamp] [\-bounce] [\-reflect] [\-vortex] [\-magnify] [\-blackhole] [\-slow] [\-shm] [\-no\-shm]
 .SH DESCRIPTION
 The \fIdistort\fP program lets circular zones of distortion wander
 randomly around its window, apparently distorting what is under them
@@ -41,9 +41,9 @@ Specify the delay between subsequent animation frames in microseconds.
 .B \-radius \fIpixels\fP
 Specify the radius of the distortion zone in pixels.
 .TP 8
-.B \-speed \fIfloat\fP
-Specify the speed of the distortion zone, where 1.0 is kind of slow,
-0.5 is twice as slow and 2.0 is twice as fast.
+.B \-speed \fIint\fP
+Specify the speed at which the distortion zone moves, where 0 is slow,
+higher numbers are faster (10 is pretty fast.)
 .TP 8
 .B \-number \fIint\fP
 Specify the number of distortion zones.
index ed44d8c2a3cfa213ec20e783a94aeb0adcac0705..08d870bb6e2a3b312dc748041ecab880465aa73e 100644 (file)
@@ -1,8 +1,8 @@
 /* -*- Mode: C; tab-width: 4 -*- */
 /* galaxy --- spinning galaxies */
-
+/* #include<math.h>*/
 #if !defined( lint ) && !defined( SABER )
-static const char sccsid[] = "@(#)galaxy.c     4.04 97/07/28 xlockmore";
+static const char sccsid[] = "@(#)galaxy.c 4.04 97/07/28 xlockmore";
 #endif
 
 /* Originally done by Uli Siegmund <uli@wombat.okapi.sub.org> on Amiga
@@ -24,53 +24,55 @@ static const char sccsid[] = "@(#)galaxy.c  4.04 97/07/28 xlockmore";
  * other special, indirect and consequential damages.
  *
  * Revision History:
+ * 26-Aug-00: robert.nagtegaal@phil.uu.nl and roland@tschai.demon.nl:
+ *            various improvements
  * 10-May-97: jwz@jwz.org: turned into a standalone program.
  * 18-Apr-97: Memory leak fixed by Tom Schmidt <tschmidt@micron.com>
  * 07-Apr-97: Modified by Dave Mitchell <davem@magnet.com>
- *            random star sizes
- *            colors change depending on velocity
- * 23-Oct-94: Modified by David Bagley <bagleyd@tux.org>
+ * 23-Oct-94: Modified by David Bagley <bagleyd@bigfoot.com>
+ *  random star sizes
+ *  colors change depending on velocity
  * 10-Oct-94: Add colors by Hubert Feyer
  * 30-Sep-94: Initial port by Hubert Feyer
  * 09-Mar-94: VMS can generate a random number 0.0 which results in a
  *            division by zero, corrected by Jouk Jansen
- *            <joukj@hrem.stm.tudelft.nl>
+ *            <joukj@crys.chem.uva.nl>
  */
 
 #ifdef STANDALONE
-# define PROGCLASS                                     "Galaxy"
-# define HACK_INIT                                     init_galaxy
-# define HACK_DRAW                                     draw_galaxy
-# define galaxy_opts                           xlockmore_opts
-# define DEFAULTS      "*delay:                100  \n"                        \
-                                       "*count:                -5   \n"                        \
-                                       "*cycles:               250  \n"                        \
-                                       "*size:                 -3   \n"                        \
-                                       "*ncolors:              64   \n"
+# define PROGCLASS     "Galaxy"
+# define HACK_INIT     init_galaxy
+# define HACK_DRAW     draw_galaxy
+# define galaxy_opts    xlockmore_opts
+# define DEFAULTS "*delay:  100  \n"   \
+     "*count:  -5   \n"   \
+     "*cycles:  250  \n"   \
+     "*size:   -3   \n"   \
+     "*ncolors:  64  \n"
 # define UNIFORM_COLORS
-# include "xlockmore.h"                                /* from the xscreensaver distribution */
+# include "xlockmore.h"    /* from the xscreensaver distribution */
 #else  /* !STANDALONE */
-# include "xlock.h"                                    /* from the xlockmore distribution */
+# include "xlock.h"     /* from the xlockmore distribution */
 #endif /* !STANDALONE */
 
 static Bool tracks;
 
-#define DEF_TRACKS "False"
+#define DEF_TRACKS "True"
 
 static XrmOptionDescRec opts[] =
 {
      {"-tracks", ".galaxy.tracks", XrmoptionNoArg, (caddr_t) "on"},
      {"+tracks", ".galaxy.tracks", XrmoptionNoArg, (caddr_t) "off"}
+ {"-tracks", ".galaxy.tracks", XrmoptionNoArg, (caddr_t) "on"},
+ {"+tracks", ".galaxy.tracks", XrmoptionNoArg, (caddr_t) "off"}
 };
 
 static argtype vars[] =
 {
      {(caddr_t *) & tracks, "tracks", "Tracks", DEF_TRACKS, t_Bool}
+ {(caddr_t *) & tracks, "tracks", "Tracks", DEF_TRACKS, t_Bool}
 };
 
 static OptionStruct desc[] =
 {
      {"-/+tracks", "turn on/off star tracks"}
+ {"-/+tracks", "turn on/off star tracks"}
 };
 
 ModeSpecOpt galaxy_opts = { 2, opts, 1, vars, desc };
@@ -79,19 +81,19 @@ ModeSpecOpt galaxy_opts = { 2, opts, 1, vars, desc };
 #define FLOATRAND ((double) LRAND() / ((double) MAXRAND))
 
 #if 0
-#define WRAP       1           /* Warp around edges */
-#define BOUNCE     1           /* Bounce from borders */
+#define WRAP       1  /* Warp around edges */
+#define BOUNCE     1  /* Bounce from borders */
 #endif
 
 #define MINSIZE       1
-#define MINGALAXIES    1
-#define MAX_STARS    300
+#define MINGALAXIES    2
+#define MAX_STARS    3000
 #define MAX_IDELTAT    50
 /* These come originally from the Cluster-version */
-#define DEFAULT_GALAXIES  2
+#define DEFAULT_GALAXIES  3
 #define DEFAULT_STARS    1000
 #define DEFAULT_HITITERATIONS  7500
-#define DEFAULT_IDELTAT    200 /* 0.02 */
+#define DEFAULT_IDELTAT    200 /* 0.02 */
 #define EPSILON 0.00000001
 
 #define sqrt_EPSILON 0.0001
@@ -99,57 +101,46 @@ ModeSpecOpt galaxy_opts = { 2, opts, 1, vars, desc };
 #define DELTAT (MAX_IDELTAT * 0.0001)
 
 #define GALAXYRANGESIZE  0.1
-#define GALAXYMINSIZE  0.1
+#define GALAXYMINSIZE  0.15
 #define QCONS    0.001
 
-/*-
- *  The following is enabled, it does not look that good for some.
- *  (But it looks great for me.)  Maybe velocities should be measured
- *  relative to their galaxy-centers instead of absolute.
- */
-#if 0
-#undef NO_VELOCITY_COLORING */ /* different colors for different speeds */
-#endif
 
-#define COLORBASE  8
+#define COLORBASE  16
   /* Colors for stars start here */
-#define COLORSTEP  (NUMCOLORS/COLORBASE)       /* 8 colors per galaxy */
+#define COLORSTEP  (NUMCOLORS/COLORBASE) /* NUMCOLORS / COLORBASE colors
+per galaxy */
 
-#define drawStar(x,y,size) if(size<=1) XDrawPoint(display,window,gc,x,y);\
-  else XFillArc(display,window,gc,x,y,size,size,0,23040)
 
 typedef struct {
-       double      pos[3], vel[3];
-       int         px, py;
-       int         color;
-       int         size;
+ double      pos[3], vel[3];
 } Star;
 
+
 typedef struct {
-       int         mass;
-       int         nstars;
-       Star       *stars;
-       double      pos[3], vel[3];
-       int         galcol;
+ int         mass;
+ int         nstars;
+ Star       *stars;
+ XPoint     *oldpoints;
+ XPoint     *newpoints;
+ double      pos[3], vel[3];
+ int         galcol;
 } Galaxy;
 
 typedef struct {
-       struct {
-               int         left;       /* x minimum */
-               int         right;      /* x maximum */
-               int         top;        /* y minimum */
-               int         bottom;     /* y maximum */
-       } clip;
-       double      mat[3][3];  /* Movement of stars(?) */
-       double      scale;      /* Scale */
-       int         midx;       /* Middle of screen, x */
-       int         midy;       /* Middle of screen, y */
-       double      size;       /* */
-       double      diff[3];    /* */
-       Galaxy     *galaxies;   /* the Whole Universe */
-       int         ngalaxies;  /* # galaxies */
-       int         f_hititerations;    /* # iterations before restart */
-       int         step;       /* */
+ double      mat[3][3]; /* Movement of stars(?) */
+ double      scale; /* Scale */
+ int         midx; /* Middle of screen, x */
+ int         midy; /* Middle of screen, y */
+ double      size; /* */
+ double      diff[3]; /* */
+ Galaxy     *galaxies; /* the Whole Universe */
+ int         ngalaxies; /* # galaxies */
+ int         f_hititerations; /* # iterations before restart */
+ int         step; /* */
+ double      rot_y; /* rotation of eye around center of universe, around
+y-axis*/
+ double      rot_x; /* rotation of eye around center of universe, around
+x-axis */
 } unistruct;
 
 static unistruct *universes = NULL;
@@ -157,313 +148,288 @@ static unistruct *universes = NULL;
 static void
 free_galaxies(unistruct * gp)
 {
-       if (gp->galaxies != NULL) {
-               int         i;
-
-               for (i = 0; i < gp->ngalaxies; i++) {
-                       Galaxy     *gt = &gp->galaxies[i];
-
-                       if (gt->stars != NULL)
-                               (void) free((void *) gt->stars);
-               }
-               (void) free((void *) gp->galaxies);
-               gp->galaxies = NULL;
-       }
+ if (gp->galaxies != NULL) {
+  int         i;
+
+  for (i = 0; i < gp->ngalaxies; i++) {
+   Galaxy     *gt = &gp->galaxies[i];
+
+   if (gt->stars != NULL)
+    (void) free((void *) gt->stars);
+   if (gt->oldpoints != NULL)
+       (void) free((void *) gt->oldpoints);
+   if (gt->newpoints != NULL)
+       (void) free((void *) gt->newpoints);
+  }
+  (void) free((void *) gp->galaxies);
+  gp->galaxies = NULL;
+ }
 }
 
 static void
 startover(ModeInfo * mi)
 {
-       unistruct  *gp = &universes[MI_SCREEN(mi)];
-       int         size = MI_SIZE(mi);
-       int         i, j;       /* more tmp */
-       double      w1, w2;     /* more tmp */
-       double      d, v, w, h; /* yet more tmp */
-
-       gp->step = 0;
-
-       if (MI_BATCHCOUNT(mi) < -MINGALAXIES)
-               free_galaxies(gp);
-       gp->ngalaxies = MI_BATCHCOUNT(mi);
-       if (gp->ngalaxies < -MINGALAXIES)
-               gp->ngalaxies = NRAND(-gp->ngalaxies - MINGALAXIES + 1) + MINGALAXIES;
-       else if (gp->ngalaxies < MINGALAXIES)
-               gp->ngalaxies = MINGALAXIES;
-       if (gp->galaxies == NULL)
-               gp->galaxies = (Galaxy *) calloc(gp->ngalaxies, sizeof (Galaxy));
-
-       for (i = 0; i < gp->ngalaxies; ++i) {
-               Galaxy     *gt = &gp->galaxies[i];
-               double      sinw1, sinw2, cosw1, cosw2;
-
-               gt->galcol = NRAND(COLORBASE - 2);
-               if (gt->galcol > 1)
-                       gt->galcol += 2;        /* Mult 8; 16..31 no green stars */
-               /* Galaxies still may have some green stars but are not all green. */
-
-               if (gt->stars != NULL) {
-                       (void) free((void *) gt->stars);
-                       gt->stars = NULL;
-               }
-               gt->nstars = (NRAND(MAX_STARS / 2)) + MAX_STARS / 2;
-               gt->stars = (Star *) malloc(gt->nstars * sizeof (Star));
-               w1 = 2.0 * M_PI * FLOATRAND;
-               w2 = 2.0 * M_PI * FLOATRAND;
-               sinw1 = SINF(w1);
-               sinw2 = SINF(w2);
-               cosw1 = COSF(w1);
-               cosw2 = COSF(w2);
-
-               gp->mat[0][0] = cosw2;
-               gp->mat[0][1] = -sinw1 * sinw2;
-               gp->mat[0][2] = cosw1 * sinw2;
-               gp->mat[1][0] = 0.0;
-               gp->mat[1][1] = cosw1;
-               gp->mat[1][2] = sinw1;
-               gp->mat[2][0] = -sinw2;
-               gp->mat[2][1] = -sinw1 * cosw2;
-               gp->mat[2][2] = cosw1 * cosw2;
-
-               gt->vel[0] = FLOATRAND * 2.0 - 1.0;
-               gt->vel[1] = FLOATRAND * 2.0 - 1.0;
-               gt->vel[2] = FLOATRAND * 2.0 - 1.0;
-               gt->pos[0] = -gt->vel[0] * DELTAT *
-                       gp->f_hititerations + FLOATRAND - 0.5;
-               gt->pos[1] = -gt->vel[1] * DELTAT *
-                       gp->f_hititerations + FLOATRAND - 0.5;
-               gt->pos[2] = -gt->vel[2] * DELTAT *
-                       gp->f_hititerations + FLOATRAND - 0.5;
-
-               gt->mass = (int) (FLOATRAND * 1000.0) + 1;
-
-               gp->size = GALAXYRANGESIZE * FLOATRAND + GALAXYMINSIZE;
-
-               for (j = 0; j < gt->nstars; ++j) {
-                       Star       *st = &gt->stars[j];
-                       double      sinw, cosw;
-
-                       w = 2.0 * M_PI * FLOATRAND;
-                       sinw = SINF(w);
-                       cosw = COSF(w);
-                       d = FLOATRAND * gp->size;
-                       h = FLOATRAND * exp(-2.0 * (d / gp->size)) / 5.0 * gp->size;
-                       if (FLOATRAND < 0.5)
-                               h = -h;
-                       st->pos[0] = gp->mat[0][0] * d * cosw + gp->mat[1][0] * d * sinw +
-                               gp->mat[2][0] * h + gt->pos[0];
-                       st->pos[1] = gp->mat[0][1] * d * cosw + gp->mat[1][1] * d * sinw +
-                               gp->mat[2][1] * h + gt->pos[1];
-                       st->pos[2] = gp->mat[0][2] * d * cosw + gp->mat[1][2] * d * sinw +
-                               gp->mat[2][2] * h + gt->pos[2];
-
-                       v = sqrt(gt->mass * QCONS / sqrt(d * d + h * h));
-                       st->vel[0] = -gp->mat[0][0] * v * sinw + gp->mat[1][0] * v * cosw +
-                               gt->vel[0];
-                       st->vel[1] = -gp->mat[0][1] * v * sinw + gp->mat[1][1] * v * cosw +
-                               gt->vel[1];
-                       st->vel[2] = -gp->mat[0][2] * v * sinw + gp->mat[1][2] * v * cosw +
-                               gt->vel[2];
-
-                       st->vel[0] *= DELTAT;
-                       st->vel[1] *= DELTAT;
-                       st->vel[2] *= DELTAT;
-
-                       st->px = 0;
-                       st->py = 0;
-
-                       if (size < -MINSIZE)
-                               st->size = NRAND(-size - MINSIZE + 1) + MINSIZE;
-                       else if (size < MINSIZE)
-                               st->size = MINSIZE;
-                       else
-                               st->size = size;
-               }
-       }
-
-       XClearWindow(MI_DISPLAY(mi), MI_WINDOW(mi));
+ unistruct  *gp = &universes[MI_SCREEN(mi)];
+ int         i, j; /* more tmp */
+ double      w1, w2; /* more tmp */
+ double      d, v, w, h; /* yet more tmp */
+
+ gp->step = 0;
+ gp->rot_y = 0;
+ gp->rot_x = 0;
+
+ if (MI_BATCHCOUNT(mi) < -MINGALAXIES)
+  free_galaxies(gp);
+ gp->ngalaxies = MI_BATCHCOUNT(mi);
+ if (gp->ngalaxies < -MINGALAXIES)
+  gp->ngalaxies = NRAND(-gp->ngalaxies - MINGALAXIES + 1) + MINGALAXIES;
+
+ else if (gp->ngalaxies < MINGALAXIES)
+  gp->ngalaxies = MINGALAXIES;
+ if (gp->galaxies == NULL)
+  gp->galaxies = (Galaxy *) calloc(gp->ngalaxies, sizeof (Galaxy));
+
+ for (i = 0; i < gp->ngalaxies; ++i) {
+  Galaxy     *gt = &gp->galaxies[i];
+  double      sinw1, sinw2, cosw1, cosw2;
+
+  gt->galcol = NRAND(COLORBASE - 2);
+  if (gt->galcol > 1)
+   gt->galcol += 2; /* Mult 8; 16..31 no green stars */
+  /* Galaxies still may have some green stars but are not all green. */
+
+  if (gt->stars != NULL) {
+   (void) free((void *) gt->stars);
+   gt->stars = NULL;
+  }
+  gt->nstars = (NRAND(MAX_STARS / 2)) + MAX_STARS / 2;
+  gt->stars = (Star *) malloc(gt->nstars * sizeof (Star));
+  gt->oldpoints = (XPoint *) malloc(gt->nstars * sizeof (XPoint));
+  gt->newpoints = (XPoint *) malloc(gt->nstars * sizeof (XPoint));
+
+  w1 = 2.0 * M_PI * FLOATRAND;
+  w2 = 2.0 * M_PI * FLOATRAND;
+  sinw1 = SINF(w1);
+  sinw2 = SINF(w2);
+  cosw1 = COSF(w1);
+  cosw2 = COSF(w2);
+
+  gp->mat[0][0] = cosw2;
+  gp->mat[0][1] = -sinw1 * sinw2;
+  gp->mat[0][2] = cosw1 * sinw2;
+  gp->mat[1][0] = 0.0;
+  gp->mat[1][1] = cosw1;
+  gp->mat[1][2] = sinw1;
+  gp->mat[2][0] = -sinw2;
+  gp->mat[2][1] = -sinw1 * cosw2;
+  gp->mat[2][2] = cosw1 * cosw2;
+
+  gt->vel[0] = FLOATRAND * 2.0 - 1.0;
+  gt->vel[1] = FLOATRAND * 2.0 - 1.0;
+  gt->vel[2] = FLOATRAND * 2.0 - 1.0;
+  gt->pos[0] = -gt->vel[0] * DELTAT * gp->f_hititerations + FLOATRAND -
+0.5;
+  gt->pos[1] = -gt->vel[1] * DELTAT * gp->f_hititerations + FLOATRAND -
+0.5;
+  gt->pos[2] = -gt->vel[2] * DELTAT * gp->f_hititerations + FLOATRAND -
+0.5;
+
+  gt->mass = (int) (FLOATRAND * 1000.0) + 1;
+
+  gp->size = GALAXYRANGESIZE * FLOATRAND + GALAXYMINSIZE;
+
+  for (j = 0; j < gt->nstars; ++j) {
+   Star       *st = &gt->stars[j];
+   XPoint     *oldp = &gt->oldpoints[j];
+   XPoint     *newp = &gt->newpoints[j];
+
+   double      sinw, cosw;
+
+   w = 2.0 * M_PI * FLOATRAND;
+   sinw = SINF(w);
+   cosw = COSF(w);
+   d = FLOATRAND * gp->size;
+   h = FLOATRAND * exp(-2.0 * (d / gp->size)) / 5.0 * gp->size;
+   if (FLOATRAND < 0.5)
+    h = -h;
+   st->pos[0] = gp->mat[0][0] * d * cosw + gp->mat[1][0] * d * sinw +
+gp->mat[2][0] * h + gt->pos[0];
+   st->pos[1] = gp->mat[0][1] * d * cosw + gp->mat[1][1] * d * sinw +
+gp->mat[2][1] * h + gt->pos[1];
+   st->pos[2] = gp->mat[0][2] * d * cosw + gp->mat[1][2] * d * sinw +
+gp->mat[2][2] * h + gt->pos[2];
+
+   v = sqrt(gt->mass * QCONS / sqrt(d * d + h * h));
+   st->vel[0] = -gp->mat[0][0] * v * sinw + gp->mat[1][0] * v * cosw +
+gt->vel[0];
+   st->vel[1] = -gp->mat[0][1] * v * sinw + gp->mat[1][1] * v * cosw +
+gt->vel[1];
+   st->vel[2] = -gp->mat[0][2] * v * sinw + gp->mat[1][2] * v * cosw +
+gt->vel[2];
+
+   st->vel[0] *= DELTAT;
+   st->vel[1] *= DELTAT;
+   st->vel[2] *= DELTAT;
+
+   oldp->x = 0;
+   oldp->y = 0;
+   newp->x = 0;
+   newp->y = 0;
+  }
+
+ }
+
+ XClearWindow(MI_DISPLAY(mi), MI_WINDOW(mi));
 
 #if 0
-       (void) printf("ngalaxies=%d, f_hititerations=%d\n",
-                     gp->ngalaxies, gp->f_hititerations);
-       (void) printf("f_deltat=%g\n", DELTAT);
-       (void) printf("Screen: ");
-       (void) printf("%dx%d pixel (%d-%d, %d-%d)\n",
-         (gp->clip.right - gp->clip.left), (gp->clip.bottom - gp->clip.top),
-              gp->clip.left, gp->clip.right, gp->clip.top, gp->clip.bottom);
+ (void) printf("ngalaxies=%d, f_hititerations=%d\n", gp->ngalaxies,
+gp->f_hititerations);
+ (void) printf("f_deltat=%g\n", DELTAT);
+ (void) printf("Screen: ");
 #endif /*0 */
 }
 
 void
 init_galaxy(ModeInfo * mi)
 {
-       unistruct  *gp;
-
-       if (universes == NULL) {
-               if ((universes = (unistruct *) calloc(MI_NUM_SCREENS(mi),
-                                               sizeof (unistruct))) == NULL)
-                       return;
-       }
-       gp = &universes[MI_SCREEN(mi)];
-
-       gp->f_hititerations = MI_CYCLES(mi);
-
-       gp->clip.left = 0;
-       gp->clip.top = 0;
-       gp->clip.right = MI_WIN_WIDTH(mi);
-       gp->clip.bottom = MI_WIN_HEIGHT(mi);
-
-       gp->scale = (double) (gp->clip.right + gp->clip.bottom) / 8.0;
-       gp->midx = gp->clip.right / 2;
-       gp->midy = gp->clip.bottom / 2;
-       startover(mi);
+ unistruct  *gp;
+
+ if (universes == NULL) {
+  if ((universes = (unistruct *) calloc(MI_NUM_SCREENS(mi),
+      sizeof (unistruct))) == NULL)
+   return;
+ }
+ gp = &universes[MI_SCREEN(mi)];
+
+ gp->f_hititerations = MI_CYCLES(mi);
+
+ gp->scale = (double) (MI_WIN_WIDTH(mi) + MI_WIN_HEIGHT(mi)) / 8.0;
+ gp->midx =  MI_WIN_WIDTH(mi)  / 2;
+ gp->midy =  MI_WIN_HEIGHT(mi) / 2;
+ startover(mi);
 }
 
 void
 draw_galaxy(ModeInfo * mi)
 {
-       Display    *display = MI_DISPLAY(mi);
-       Window      window = MI_WINDOW(mi);
-       GC          gc = MI_GC(mi);
-       unistruct  *gp = &universes[MI_SCREEN(mi)];
-       double      d;          /* tmp */
-       int         i, j, k;    /* more tmp */
-
-       for (i = 0; i < gp->ngalaxies; ++i) {
-               Galaxy     *gt = &gp->galaxies[i];
-
-               for (j = 0; j < gp->galaxies[i].nstars; ++j) {
-                       Star       *st = &gt->stars[j];
-                       double      v0 = st->vel[0];
-                       double      v1 = st->vel[1];
-                       double      v2 = st->vel[2];
-
-                       for (k = 0; k < gp->ngalaxies; ++k) {
-                               Galaxy     *gtk = &gp->galaxies[k];
-                               double      d0 = gtk->pos[0] - st->pos[0];
-                               double      d1 = gtk->pos[1] - st->pos[1];
-                               double      d2 = gtk->pos[2] - st->pos[2];
-
-                               d = d0 * d0 + d1 * d1 + d2 * d2;
-                               if (d > EPSILON)
-                                       d = gt->mass / (d * sqrt(d)) * DELTAT * DELTAT * QCONS;
-                               else
-                                       d = gt->mass / (EPSILON * sqrt_EPSILON) * DELTAT * DELTAT * QCONS;
-                               v0 += d0 * d;
-                               v1 += d1 * d;
-                               v2 += d2 * d;
-                       }
-
-                       st->vel[0] = v0;
-                       st->vel[1] = v1;
-                       st->vel[2] = v2;
-
-#ifndef NO_VELOCITY_COLORING
-                       d = (v0 * v0 + v1 * v1 + v2 * v2) / (3.0 * DELTAT * DELTAT);
-                       if (d > (double) COLORSTEP)
-                               st->color = COLORSTEP * gt->galcol + COLORSTEP - 1;
-                       else
-                               st->color = COLORSTEP * gt->galcol + ((int) d) % COLORSTEP;
-#endif
-                       st->pos[0] += v0;
-                       st->pos[1] += v1;
-                       st->pos[2] += v2;
-
-                       if (st->px >= gp->clip.left &&
-                           st->px <= gp->clip.right - st->size &&
-                           st->py >= gp->clip.top &&
-                           st->py <= gp->clip.bottom - st->size) {
-                               XSetForeground(display, gc, MI_WIN_BLACK_PIXEL(mi));
-                               drawStar(st->px, st->py, st->size);
-                       }
-                       st->px = (int) (st->pos[0] * gp->scale) + gp->midx;
-                       st->py = (int) (st->pos[1] * gp->scale) + gp->midy;
-
-
-#ifdef WRAP
-                       if (st->px < gp->clip.left) {
-                               (void) printf("wrap l -> r\n");
-                               st->px = gp->clip.right;
-                       }
-                       if (st->px > gp->clip.right) {
-                               (void) printf("wrap r -> l\n");
-                               st->px = gp->clip.left;
-                       }
-                       if (st->py > gp->clip.bottom) {
-                               (void) printf("wrap b -> t\n");
-                               st->py = gp->clip.top;
-                       }
-                       if (st->py < gp->clip.top) {
-                               (void) printf("wrap t -> b\n");
-                               st->py = gp->clip.bottom;
-                       }
-#endif /*WRAP */
-
-
-                       if (st->px >= gp->clip.left &&
-                           st->px <= gp->clip.right - st->size &&
-                           st->py >= gp->clip.top &&
-                           st->py <= gp->clip.bottom - st->size) {
-                               if (MI_NPIXELS(mi) > 2)
-#ifdef NO_VELOCITY_COLORING
-                                       XSetForeground(display, gc, MI_PIXEL(mi, COLORSTEP * gt->galcol));
-#else
-                                       XSetForeground(display, gc, MI_PIXEL(mi, st->color));
-#endif
-                               else
-                                       XSetForeground(display, gc, MI_WIN_WHITE_PIXEL(mi));
-                               if (tracks)
-                                       drawStar(st->px + 1, st->py, st->size);
-                               else
-                                       drawStar(st->px, st->py, st->size);
-                       }
-               }
-
-               for (k = i + 1; k < gp->ngalaxies; ++k) {
-                       Galaxy     *gtk = &gp->galaxies[k];
-                       double      d0 = gtk->pos[0] - gt->pos[0];
-                       double      d1 = gtk->pos[1] - gt->pos[1];
-                       double      d2 = gtk->pos[2] - gt->pos[2];
-
-                       d = d0 * d0 + d1 * d1 + d2 * d2;
-                       if (d > EPSILON)
-                               d = gt->mass * gt->mass / (d * sqrt(d)) * DELTAT * QCONS;
-                       else
-                               d = gt->mass * gt->mass / (EPSILON * sqrt_EPSILON) * DELTAT * QCONS;
-                       d0 *= d;
-                       d1 *= d;
-                       d2 *= d;
-                       gt->vel[0] += d0 / gt->mass;
-                       gt->vel[1] += d1 / gt->mass;
-                       gt->vel[2] += d2 / gt->mass;
-                       gtk->vel[0] -= d0 / gtk->mass;
-                       gtk->vel[1] -= d1 / gtk->mass;
-                       gtk->vel[2] -= d2 / gtk->mass;
-               }
-               gt->pos[0] += gt->vel[0] * DELTAT;
-               gt->pos[1] += gt->vel[1] * DELTAT;
-               gt->pos[2] += gt->vel[2] * DELTAT;
-       }
-
-       gp->step++;
-       if (gp->step > gp->f_hititerations * 4)
-               startover(mi);
+ Display    *display = MI_DISPLAY(mi);
+ Window      window = MI_WINDOW(mi);
+ GC          gc = MI_GC(mi);
+ unistruct  *gp = &universes[MI_SCREEN(mi)];
+ double      d, eps, cox, six, cor, sir;  /* tmp */
+ int         i, j, k; /* more tmp */
+    XPoint    *dummy = NULL;
+
+    gp->rot_y += 0.01;
+ gp->rot_x += 0.004;
+
+ cox = COSF(gp->rot_y);
+ six = SINF(gp->rot_y);
+    cor = COSF(gp->rot_x);
+    sir = SINF(gp->rot_x);
+
+    eps = 1/(EPSILON * sqrt_EPSILON * DELTAT * DELTAT * QCONS);
+
+ for (i = 0; i < gp->ngalaxies; ++i) {
+  Galaxy     *gt = &gp->galaxies[i];
+
+  for (j = 0; j < gp->galaxies[i].nstars; ++j) {
+   Star       *st = &gt->stars[j];
+   XPoint     *newp = &gt->newpoints[j];
+   double      v0 = st->vel[0];
+   double      v1 = st->vel[1];
+   double      v2 = st->vel[2];
+
+   for (k = 0; k < gp->ngalaxies; ++k) {
+    Galaxy     *gtk = &gp->galaxies[k];
+    double      d0 = gtk->pos[0] - st->pos[0];
+    double      d1 = gtk->pos[1] - st->pos[1];
+    double      d2 = gtk->pos[2] - st->pos[2];
+
+    d = d0 * d0 + d1 * d1 + d2 * d2;
+    if (d > EPSILON)
+     d = gt->mass / (d * sqrt(d)) * DELTAT * DELTAT * QCONS;
+    else
+        d = gt->mass * eps;
+    v0 += d0 * d;
+    v1 += d1 * d;
+    v2 += d2 * d;
+   }
+
+   st->vel[0] = v0;
+   st->vel[1] = v1;
+   st->vel[2] = v2;
+
+   st->pos[0] += v0;
+   st->pos[1] += v1;
+   st->pos[2] += v2;
+
+   newp->x = (short) (((cox * st->pos[0]) - (six * st->pos[2])) *
+gp->scale) + gp->midx;
+   newp->y = (short) (((cor * st->pos[1]) - (sir * ((six * st->pos[0]) +
+(cox * st->pos[2])))) * gp->scale) + gp->midy;
+
+  }
+
+  for (k = i + 1; k < gp->ngalaxies; ++k) {
+   Galaxy     *gtk = &gp->galaxies[k];
+   double      d0 = gtk->pos[0] - gt->pos[0];
+   double      d1 = gtk->pos[1] - gt->pos[1];
+   double      d2 = gtk->pos[2] - gt->pos[2];
+
+   d = d0 * d0 + d1 * d1 + d2 * d2;
+   if (d > EPSILON)
+    d = gt->mass * gt->mass / (d * sqrt(d)) * DELTAT * QCONS;
+   else
+    d = gt->mass * gt->mass / (EPSILON * sqrt_EPSILON) * DELTAT * QCONS;
+
+   d0 *= d;
+   d1 *= d;
+   d2 *= d;
+   gt->vel[0] += d0 / gt->mass;
+   gt->vel[1] += d1 / gt->mass;
+   gt->vel[2] += d2 / gt->mass;
+   gtk->vel[0] -= d0 / gtk->mass;
+   gtk->vel[1] -= d1 / gtk->mass;
+   gtk->vel[2] -= d2 / gtk->mass;
+  }
+
+  gt->pos[0] += gt->vel[0] * DELTAT;
+  gt->pos[1] += gt->vel[1] * DELTAT;
+  gt->pos[2] += gt->vel[2] * DELTAT;
+
+         XSetForeground(display, gc, MI_WIN_BLACK_PIXEL(mi));
+  XDrawPoints(display, window, gc, gt->oldpoints, gt->nstars,
+CoordModeOrigin);
+  XSetForeground(display, gc, MI_PIXEL(mi, COLORSTEP * gt->galcol));
+         XDrawPoints(display, window, gc, gt->newpoints, gt->nstars,
+CoordModeOrigin);
+
+         dummy = gt->oldpoints;
+  gt->oldpoints = gt->newpoints;
+  gt->newpoints = dummy;
+ }
+
+ gp->step++;
+ if (gp->step > gp->f_hititerations * 4)
+  startover(mi);
 }
 
 void
 release_galaxy(ModeInfo * mi)
 {
      if (universes != NULL) {
-               int         screen;
-
-               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
-                       free_galaxies(&universes[screen]);
-               (void) free((void *) universes);
-               universes = NULL;
      }
+ if (universes != NULL) {
+  int         screen;
+
+  for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+   free_galaxies(&universes[screen]);
+  (void) free((void *) universes);
+  universes = NULL;
+ }
 }
 
 void
 refresh_galaxy(ModeInfo * mi)
 {
      /* Do nothing, it will refresh by itself */
+ /* Do nothing, it will refresh by itself */
 }
index e32391f2560607c28242c0c7290f3c29f90a0495..dcdfa94ec7c801da854fdaf618c4e798b83f9d1a 100644 (file)
@@ -1,4 +1,5 @@
-# hacks/glx/Makefile.in --- xscreensaver, Copyright (c) 1999 Jamie Zawinski.
+# hacks/glx/Makefile.in --- xscreensaver, Copyright (c) 1999, 2000
+#  by Jamie Zawinski.
 # the `../../configure' script generates `hacks/glx/Makefile' from this file.
 
 @SET_MAKE@
@@ -63,7 +64,8 @@ UTIL_OBJS     = $(UTILS_SRC)/colors.o $(UTILS_SRC)/hsv.o \
                  $(UTILS_SRC)/visual.o $(UTILS_SRC)/visual-gl.o \
                   $(UTILS_SRC)/yarandom.o
 
-SRCS           = atlantis.c b_draw.c b_lockglue.c b_sphere.c bubble3d.c \
+SRCS           = xscreensaver-gl-helper.c \
+                 atlantis.c b_draw.c b_lockglue.c b_sphere.c bubble3d.c \
                  buildlwo.c cage.c dolphin.c gears.c lament.c moebius.c \
                  morph3d.c pipeobjs.c pipes.c rubik.c s1_1.c s1_2.c s1_3.c \
                  s1_4.c s1_5.c s1_6.c s1_b.c shark.c sproingies.c \
@@ -71,9 +73,10 @@ SRCS         = atlantis.c b_draw.c b_lockglue.c b_sphere.c bubble3d.c \
                  xlock-gl.c xpm-ximage.c glplanet.c pulsar.c \
                  extrusion.c extrusion-helix2.c extrusion-helix3.c \
                  extrusion-helix4.c extrusion-joinoffset.c extrusion-screw.c \
-                 extrusion-taper.c extrusion-twistoid.c sierpinski3d.c
+                 extrusion-taper.c extrusion-twistoid.c sierpinski3d.c gflux.c
 
-OBJS           = atlantis.o b_draw.o b_lockglue.o b_sphere.o bubble3d.o \
+OBJS           = xscreensaver-gl-helper.o \
+                 atlantis.o b_draw.o b_lockglue.o b_sphere.o bubble3d.o \
                  buildlwo.o cage.o dolphin.o gears.o lament.o moebius.o \
                  morph3d.o pipeobjs.o pipes.o rubik.o s1_1.o s1_2.o s1_3.o \
                  s1_4.o s1_5.o s1_6.o s1_b.o shark.o sproingies.o \
@@ -81,13 +84,15 @@ OBJS                = atlantis.o b_draw.o b_lockglue.o b_sphere.o bubble3d.o \
                  xlock-gl.o xpm-ximage.o glplanet.o pulsar.o \
                  extrusion.o extrusion-helix2.o extrusion-helix3.o \
                  extrusion-helix4.o extrusion-joinoffset.o extrusion-screw.o \
-                 extrusion-taper.o extrusion-twistoid.o sierpinski3d.o
+                 extrusion-taper.o extrusion-twistoid.o sierpinski3d.o gflux.o
 
 GL_EXES                = cage gears moebius pipes sproingies stairs superquadrics \
                  morph3d rubik atlantis lament bubble3d glplanet pulsar \
-                 sierpinski3d
+                 sierpinski3d gflux
 GLE_EXES       = extrusion
-EXES           = @GL_EXES@ @GLE_EXES@
+UTIL_EXES      = xscreensaver-gl-helper
+HACK_EXES      = @GL_EXES@ @GLE_EXES@
+EXES           = $(HACK_EXES) $(UTIL_EXES)
 
 HACK_OBJS      = screenhack-gl.o xlock-gl.o $(HACK_BIN)/xlockmore.o \
                  $(UTILS_BIN)/resources.o $(UTILS_BIN)/visual.o \
@@ -96,7 +101,7 @@ HACK_OBJS    = screenhack-gl.o xlock-gl.o $(HACK_BIN)/xlockmore.o \
                  $(UTILS_BIN)/colors.o
 
 HDRS           = atlantis.h bubble3d.h buildlwo.h e_textures.h xpm-ximage.h
-GL_MEN         = lament.man
+GL_MEN         = lament.man xscreensaver-gl-helper.man gflux.man
 MEN            = @GL_MEN@
 EXTRAS         = README Makefile.in
 
@@ -112,11 +117,12 @@ uninstall: uninstall-program uninstall-man
 install-strip:
        $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
 
-install-program: $(EXES)
+# the hacks, in $HACKDIR
+install-program:: $(HACK_EXES)
        @if [ ! -d $(install_prefix)$(HACKDIR) ]; then                  \
          $(INSTALL_DIRS) $(install_prefix)$(HACKDIR) ;                 \
         fi ;                                                           \
-       exes="$(EXES)" ;                                                \
+       exes="$(HACK_EXES)" ;                                           \
        for program in $$exes; do                                       \
          echo $(INSTALL_PROGRAM) $$program                             \
            $(install_prefix)$(HACKDIR)/$$program ;                     \
@@ -124,6 +130,19 @@ install-program: $(EXES)
            $(install_prefix)$(HACKDIR)/$$program ;                     \
        done
 
+# the xscreensaver-gl-helper program, in $bindir
+install-program:: $(UTIL_EXES)
+       @if [ ! -d $(install_prefix)$(bindir) ]; then                   \
+         $(INSTALL_DIRS) $(install_prefix)$(bindir) ;                  \
+        fi ;                                                           \
+       exes="$(UTIL_EXES)" ;                                           \
+       for program in $$exes; do                                       \
+         echo $(INSTALL_PROGRAM) $$program                             \
+           $(install_prefix)$(bindir)/$$program ;                      \
+         $(INSTALL_PROGRAM) $$program                                  \
+           $(install_prefix)$(bindir)/$$program ;                      \
+       done
+
 install-man: $(MEN)
        @men="$(MEN)" ;                                                 \
        if [ ! -d $(install_prefix)$(man1dir) ]; then                   \
@@ -137,13 +156,22 @@ install-man: $(MEN)
            $(install_prefix)$(man1dir)/$$instname ;                    \
        done
 
-uninstall-program:
-       @exes="$(EXES)" ;                                               \
+# the hacks, in $HACKDIR
+uninstall-program::
+       @exes="$(HACK_EXES)" ;                                          \
        for program in $$exes; do                                       \
          echo rm -f $(install_prefix)$(HACKDIR)/$$program ;            \
          rm -f $(install_prefix)$(HACKDIR)/$$program ;                 \
        done
 
+# the xscreensaver-gl-helper program, in $bindir
+uninstall-program::
+       @exes="$(UTIL_EXES)" ;                                          \
+       for program in $$exes; do                                       \
+         echo rm -f $(install_prefix)$(bindir)/$$program ;             \
+         rm -f $(install_prefix)$(bindir)/$$program ;                  \
+       done
+
 uninstall-man:
        @men="$(MEN)" ;                                                 \
        for man in $$men; do                                            \
@@ -221,6 +249,16 @@ $(HACK_BIN)/xlockmore.o: $(HACK_SRC)/xlockmore.c
 .c.o:
        $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(X_CFLAGS) $<
 
+
+# How to build the "xscreensaver-gl-helper" program, that lets the daemon
+# know which visual is the right one for GL programs.
+#
+HELPER_OBJS = xscreensaver-gl-helper.o $(UTILS_BIN)/visual-gl.o \
+             $(UTILS_BIN)/visual.o $(UTILS_BIN)/resources.o
+xscreensaver-gl-helper: $(HELPER_OBJS)
+       $(CC) $(LDFLAGS) -o $@ $(HELPER_OBJS) $(LIBS) $(X_LIBS) $(HACK_POST2)
+
+
 # These hacks use a slightly-differently-compiled variant of screenhack.c.
 # This is how to make the the other .o file from it.
 #
@@ -286,12 +324,17 @@ extrusion:        $(EXTRUSION_OBJS) $(HACK_OBJS)
 sierpinski3d:  sierpinski3d.o  $(HACK_OBJS)
        $(CC_HACK) -o $@ $@.o   $(HACK_OBJS) $(HACK_LIBS)
 
+gflux:         gflux.o         $(HACK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(HACK_OBJS) $(HACK_LIBS)
 
 ##############################################################################
 #
 # DO NOT DELETE: updated by make distdepend
 # $(srcdir)/DO $(srcdir)/NOT $(srcdir)/DELETE: $(srcdir)/updated $(srcdir)/by $(srcdir)/make $(srcdir)/distdepend
 
+xscreensaver-gl-helper.o: $(UTILS_SRC)/utils.h
+xscreensaver-gl-helper.o: ../../config.h
+xscreensaver-gl-helper.o: $(UTILS_SRC)/visual.h
 atlantis.o: $(HACK_SRC)/xlockmore.h
 atlantis.o: ../../config.h
 atlantis.o: $(HACK_SRC)/xlockmoreI.h
@@ -585,4 +628,16 @@ sierpinski3d.o: $(UTILS_SRC)/colors.h
 sierpinski3d.o: $(UTILS_SRC)/grabscreen.h
 sierpinski3d.o: $(UTILS_SRC)/visual.h
 sierpinski3d.o: $(UTILS_SRC)/xshm.h
+gflux.o: $(HACK_SRC)/xlockmore.h
+gflux.o: ../../config.h
+gflux.o: $(HACK_SRC)/xlockmoreI.h
+gflux.o: $(HACK_SRC)/screenhack.h
+gflux.o: $(UTILS_SRC)/yarandom.h
+gflux.o: $(UTILS_SRC)/usleep.h
+gflux.o: $(UTILS_SRC)/resources.h
+gflux.o: $(UTILS_SRC)/hsv.h
+gflux.o: $(UTILS_SRC)/colors.h
+gflux.o: $(UTILS_SRC)/grabscreen.h
+gflux.o: $(UTILS_SRC)/visual.h
+gflux.o: $(UTILS_SRC)/xshm.h
 
diff --git a/hacks/glx/gflux.c b/hacks/glx/gflux.c
new file mode 100644 (file)
index 0000000..58a89f9
--- /dev/null
@@ -0,0 +1,732 @@
+/* -*- Mode: C; tab-width: 4 -*- emacs friendly */
+
+/* gflux - creates a fluctuating 3D grid 
+ * requires OpenGL or MesaGL
+ * 
+ * Copyright (c) Josiah Pease, 2000
+ * 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.
+ *
+ * Thanks go to all those who worked on...
+ * MesaGL, OpenGL, UtahGLX, XFree86, gcc, vim, rxvt, the PNM (anymap) format
+ * xscreensaver and the thousands of other tools, apps and daemons that make
+ * linux usable  
+ * Personal thanks to Kevin Moss, Paul Sheahee and Jamie Zawinski
+ * 
+ * some xscreensaver code lifted from superquadrics.  Most other glx hacks 
+ * used as reference at some time.
+ *
+ * This hack and others can cause UtahGLX to crash my X server
+ * wireframe looks good with software only rendering anyway
+ * If anyone can work out why and supply a fix I'd love to hear from them
+ * 
+ * Josiah Pease <gfluxcode@jpease.force9.co.uk> 21 July 2000
+ * 
+ * History 
+ * 10 June 2000 : wireframe rippling grid standalone written
+ * 18 June 2000 : xscreensaver code added
+ * 25 June 2000 : solid and light added
+ * 04 July 2000 : majour bug hunt, xscreensaver code rewritten
+ * 08 July 2000 : texture mapping, rotation and zoom added
+ * 21 July 2000 : cleaned up code from bug hunts, manpage written
+ */
+
+
+/*-
+ * due to a Bug/feature in VMS X11/Intrinsic.h has to be placed before xlock.
+ * otherwise caddr_t is not defined correctly
+ */
+
+#include <X11/Intrinsic.h>
+
+
+#ifdef STANDALONE
+# define PROGCLASS                                             "gflux"
+# define HACK_INIT                                             init_gflux
+# define HACK_DRAW                                             draw_gflux
+# define gflux_opts                            xlockmore_opts
+#define DEFAULTS                        "*squares:      19      \n" \
+                                        "*resolution:   0       \n" \
+                                        "*draw:         0       \n" \
+                                        "*flat:         0       \n" \
+                                        "*speed:        0.05    \n" \
+                                        "*rotationx:    0.01    \n" \
+                                        "*rotationy:    0.0     \n" \
+                                        "*rotationz:    0.1     \n" \
+                                        "*waves:        3       \n" \
+                                        "*waveChange:   50      \n" \
+                                        "*waveHeight:   1.0     \n" \
+                                        "*waveFreq:    3.0     \n" \
+                                        "*zoom:         1.0     \n" 
+
+
+# include "xlockmore.h"                                /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+# include "xlock.h"                                    /* from the xlockmore distribution */
+#endif /* !STANDALONE */
+
+#ifdef USE_GL /* whole file */
+
+#ifdef HAVE_XPM
+# include <X11/xpm.h>
+# ifndef PIXEL_ALREADY_TYPEDEFED
+# define PIXEL_ALREADY_TYPEDEFED /* Sigh, Xmu/Drawing.h needs this... */
+# endif
+#endif
+
+#ifdef HAVE_XMU
+# ifndef VMS
+#  include <X11/Xmu/Drawing.h>
+#else  /* VMS */
+#  include <Xmu/Drawing.h>
+# endif /* VMS */
+#endif
+
+#undef countof
+#define countof(x) (sizeof((x))/sizeof((*x)))
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <GL/gl.h>
+#include <GL/glu.h>
+#include <GL/glx.h>
+
+#include <math.h>
+
+static enum {wire=0,solid,light,checker,textured} _draw; /* draw style */
+static int _squares = 19;                                 /* grid size */
+static int _resolution = 4;                    /* wireframe resolution */
+static int _flat = 0;
+
+static float _speed = 0.05;
+static float _rotationx = 0.01;
+static float _rotationy = 0.0;
+static float _rotationz = 0.1;
+static float _zoom = 1.0;
+
+static int _waves = 3;
+static int _waveChange = 50;
+static float _waveHeight = 1.0;
+static float _waveFreq = 3.0;
+
+#define WIDTH 320
+#define HEIGHT 240
+
+static XrmOptionDescRec opts[] = {
+    {"-squares", ".gflux.squares", XrmoptionSepArg, (caddr_t) NULL},
+    {"-resolution", ".gflux.resolution", XrmoptionSepArg, (caddr_t) NULL},
+    {"-draw", ".gflux.draw", XrmoptionSepArg, (caddr_t) NULL},
+    {"-flat", ".gflux.flat", XrmoptionSepArg, (caddr_t) NULL},
+    {"-speed", ".gflux.speed", XrmoptionSepArg, (caddr_t) NULL},
+    {"-rotationx", ".gflux.rotationx", XrmoptionSepArg, (caddr_t) NULL},
+    {"-rotationy", ".gflux.rotationy", XrmoptionSepArg, (caddr_t) NULL},
+    {"-rotationz", ".gflux.rotationz", XrmoptionSepArg, (caddr_t) NULL},
+    {"-waves", ".gflux.waves", XrmoptionSepArg, (caddr_t) NULL},
+    {"-waveChange", ".gflux.waveChange", XrmoptionSepArg, (caddr_t) NULL},
+    {"-waveHeight", ".gflux.waveHeight", XrmoptionSepArg, (caddr_t) NULL},
+    {"-waveFreq", ".gflux.waveFreq", XrmoptionSepArg, (caddr_t) NULL},
+    {"-zoom", ".gflux.zoom", XrmoptionSepArg, (caddr_t) NULL},
+};
+
+
+static argtype vars[] = {
+    {(caddr_t *) & _squares, "squares", "Squares", "19", t_Int},
+    {(caddr_t *) & _resolution, "resolution", "Resolution", "4", t_Int},
+    {(caddr_t *) & _draw, "draw", "Draw", "0", t_Int},
+    {(caddr_t *) & _flat, "flat", "Flat", "0", t_Int},
+    {(caddr_t *) & _speed, "speed", "Speed", "0.05", t_Float},
+    {(caddr_t *) & _rotationx, "rotationx", "Rotationx", "0.01", t_Float},
+    {(caddr_t *) & _rotationy, "rotationy", "Rotationy", "0.0", t_Float},
+    {(caddr_t *) & _rotationz, "rotationz", "Rotationz", "0.1", t_Float},
+    {(caddr_t *) & _waves, "waves", "Waves", "3", t_Int},
+    {(caddr_t *) & _waveChange, "waveChange", "WaveChange", "50", t_Int},
+    {(caddr_t *) & _waveHeight, "waveHeight", "WaveHeight", "1.0", t_Float},
+    {(caddr_t *) & _waveFreq, "waveFreq", "WaveFreq", "3.0", t_Float},
+    {(caddr_t *) & _zoom, "zoom", "Zoom", "1.0", t_Float},
+};
+
+
+static OptionStruct desc[] =
+{
+    {"-squares num", "size of grid in squares (19)"},
+    {"-resolution num", "detail of lines making grid, wireframe only (4)"},
+    {"-draw num", "draw method to use: 0=wireframe 1=solid 2=lit (0)"},
+    {"-flat num", "shading method, not wireframe: 0=smooth 1=flat (0)"},
+    {"-speed num", "speed of waves (0.05)"},
+    {"-rotationx num", "speed of xrotation (0.01)"},
+    {"-rotationy num", "speed of yrotation (0.00)"},
+    {"-rotationz num", "speed of zrotation (0.10)"},
+    {"-waves num", "number of simultanious waves (3)"},
+    {"-waveChange num", "number of cyles for a wave to change (50)"},
+    {"-waveHeight num", "height of waves (1.0)"},
+    {"-waveFreq num", "max frequency of a wave (3.0)"},
+    {"-zoom num", "camera control (1.0)"},
+};
+
+ModeSpecOpt gflux_opts = {countof(opts), opts, countof(vars), vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   gflux_description =
+{"gflux", "init_gflux", "draw_gflux", "release_gflux",
+ "draw_gflux", "init_gflux", NULL, &gflux_opts,
+ 1000, 1, 2, 1, 4, 1.0, "",
+ "Gflux: an OpenGL gflux", 0, NULL};
+#endif
+
+/* structure for holding the gflux data */
+typedef struct {
+    int screen_width, screen_height;
+    GLXContext *glx_context;
+    Window window;
+    XColor fg, bg;
+#define MAXWAVES 10   /* should be dynamic    */
+    double wa[MAXWAVES];
+    double freq[MAXWAVES];
+    double dispy[MAXWAVES];
+    double dispx[MAXWAVES];
+    GLfloat colour[3];
+    int imageWidth;
+    int imageHeight;
+    GLubyte *image;
+    GLint texName;
+    void (*drawFunc)(void);
+} gfluxstruct;
+static gfluxstruct *gflux = NULL;
+
+/* prototypes */
+void initLighting(void);
+void initTexture(void);
+void loadTexture(void);
+void createTexture(void);
+void displaySolid(void);            /* drawFunc implementations */
+void displayLight(void);
+void displayTexture(void);
+void displayWire(void);
+void calcGrid(void);
+double getGrid(double,double,double);
+
+/* as macro for speed */
+/* could do with colour cycling here */
+/* void genColour(double);*/
+#define genColour(X) \
+{\
+    gflux->colour[0] = 0.0;\
+    gflux->colour[1] = 0.5+0.5*(X);\
+    gflux->colour[2] = 0.5-0.5*(X);\
+}
+
+/* BEGINNING OF FUNCTIONS */
+
+
+/* draw the gflux once */
+void draw_gflux(ModeInfo * mi)
+{
+    gfluxstruct *gp = &gflux[MI_SCREEN(mi)];
+    Display    *display = MI_DISPLAY(mi);
+    Window      window = MI_WINDOW(mi);
+
+    if (!gp->glx_context) return;
+
+    glXMakeCurrent(display, window, *(gp->glx_context));
+
+    calcGrid();
+    gflux->drawFunc();
+    glXSwapBuffers(display, window);
+}
+
+
+/* reset the projection matrix */
+void resetProjection(void) {
+    glMatrixMode(GL_PROJECTION);
+    glLoadIdentity();
+    glFrustum(-_zoom,_zoom,-0.8*_zoom,0.8*_zoom,2,6);
+    glTranslatef(0.0,0.0,-4.0);
+    glMatrixMode(GL_MODELVIEW);
+    glLoadIdentity();
+}
+
+/* Standard reshape function */
+static void
+reshape(int width, int height)
+{
+    glViewport( 0, 0, width, height );
+    resetProjection();
+}
+
+
+/* main OpenGL initialization routine */
+void initializeGL(GLsizei width, GLsizei height) 
+{
+  reshape(width, height);
+  glViewport( 0, 0, width, height ); 
+  switch(_draw) {
+    case solid :
+      gflux->drawFunc = (displaySolid);
+      glEnable(GL_DEPTH_TEST);
+    break;
+    case light :
+      gflux->drawFunc = (displayLight);
+      glEnable(GL_DEPTH_TEST);
+      initLighting();
+       break;
+       case checker :
+      gflux->drawFunc = (displayTexture);
+      glEnable(GL_DEPTH_TEST);
+      createTexture();
+      initTexture();
+      initLighting();
+    break;
+       case textured :
+      gflux->drawFunc = (displayTexture);
+      glEnable(GL_DEPTH_TEST);
+      loadTexture();
+      initTexture();
+      initLighting();
+    break;
+    case wire :
+       default :
+      gflux->drawFunc = (displayWire);
+      glDisable(GL_DEPTH_TEST);
+    break;
+  }
+
+  if(_flat) glShadeModel(GL_FLAT);
+  else glShadeModel(GL_SMOOTH);
+
+}
+
+
+/* xgflux initialization routine */
+void init_gflux(ModeInfo * mi)
+{
+    int screen = MI_SCREEN(mi);
+    gfluxstruct *gp;
+
+    if (gflux == NULL) {
+        if ((gflux = (gfluxstruct *) 
+                 calloc(MI_NUM_SCREENS(mi), sizeof (gfluxstruct))) == NULL)
+            return;
+    }
+    gp = &gflux[screen];
+
+    gp->window = MI_WINDOW(mi);
+    if ((gp->glx_context = init_GL(mi)) != NULL) {
+        reshape(MI_WIDTH(mi), MI_HEIGHT(mi));
+        initializeGL(MI_WIDTH(mi), MI_HEIGHT(mi));
+    } else {
+        MI_CLEARWINDOW(mi);
+    }
+}
+
+/* cleanup code */
+void release_gflux(ModeInfo * mi)
+{
+    if(gflux->image!=NULL) free(gflux->image);
+    if(gflux->glx_context!=NULL) free(gflux->glx_context);
+    if (gflux != NULL) {
+        (void) free((void *) gflux);
+        gflux = NULL;
+    }
+    FreeAllGL(mi);
+}
+
+/* loads several different types of PNM image from stdin */
+#define presult(A,B,C) (*(result+(A)*(gflux->imageWidth)*4+(B)*4+(C)))
+void loadTexture(void)
+{
+    int i, j, levels, width, height;
+    int red,green,blue;
+    char s[4];
+    int ppmType=0;
+    FILE *file = stdin;
+    GLubyte *result;
+
+    fgets(s,4,file);
+
+    if(!strncmp(s,"P6",2)) ppmType=6;
+    if(!strncmp(s,"P5",2)) ppmType=5;
+    if(!strncmp(s,"P3",2)) ppmType=3;
+    if(!strncmp(s,"P2",2)) ppmType=2;
+    if(!ppmType)exit(1);
+
+    while((i=getc(file))=='#')
+    {
+        while(getc(file)!='\n');
+    }
+    ungetc(i,file);
+
+    fscanf(file,"%d %d %d",&width,&height,&levels);
+
+    result = malloc(sizeof(GLubyte)*4*width*height);
+    gflux->imageWidth = width;
+       gflux->imageHeight = height;
+
+    switch(ppmType) {
+        case 2 :    /* ASCII grey */
+            for(i=0;i<height;i++) {
+                for(j=0;j<width;j++) {
+                    fscanf(file,"%d",&red);
+                    presult(j,i,0) = red;
+                    presult(j,i,1) = red;
+                    presult(j,i,2) = red;
+                }
+            }
+            break;
+        case 3 :    /* ASCII rgb */
+            for(i=0;i<height;i++) {
+                for(j=0;j<width;j++) {
+                    fscanf(file,"%d %d %d",&red,&green,&blue);
+                    presult(j,i,0) = red;
+                    presult(j,i,1) = green;
+                    presult(j,i,2) = blue;
+                }
+            }
+            break;
+        case 5 :    /* Binary grey */
+            getc(file); /* seems nessessary */
+            for(i=0;i<height;i++) {
+                for(j=0;j<width;j++) {
+                    red = getc(file);
+                    presult(j,i,0) = red;
+                    presult(j,i,1) = red;
+                    presult(j,i,2) = red;
+                }
+            }
+        break;
+        case 6 :    /* Binary rgb */
+            getc(file); /* seems nessessary */
+            for(i=0;i<height;i++) {
+                for(j=0;j<width;j++) {
+                    red = getc(file);
+                    green = getc(file);
+                    blue = getc(file);
+                    presult(j,i,0) = red;
+                    presult(j,i,1) = green;
+                    presult(j,i,2) = blue;
+                }
+            }
+        break;
+    }
+       gflux->image = result;
+}
+
+/* creates an image for texture mapping */
+void createTexture(void)
+{
+    int i,j,c;
+    GLubyte *result;
+
+       gflux->imageHeight = gflux->imageWidth = 8;
+
+       result = malloc(sizeof(GLubyte)*4*gflux->imageHeight*gflux->imageWidth);
+    for(i=0;i<gflux->imageHeight;i++) {
+        for(j=0;j<gflux->imageWidth;j++) {
+            c = (((i)%2 ^ (j)%2) ? 100 : 200 );
+            presult(i,j,0) = (GLubyte) c;
+            presult(i,j,1) = (GLubyte) c;
+            presult(i,j,2) = (GLubyte) c;
+            presult(i,j,3) = (GLubyte) 255;
+        }
+    }
+       gflux->image = result;
+}
+#undef presult
+
+/* specifies image as texture */    
+void initTexture(void)
+{
+       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+       glGenTextures(1, &gflux->texName);
+       glBindTexture(GL_TEXTURE_2D, gflux->texName);
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+       glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, gflux->imageWidth,
+                       gflux->imageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, gflux->image);
+       
+}
+
+void initLighting(void)
+{
+    static float ambientA[] = {0.0, 0.0, 0.0, 1.0};
+    static float diffuseA[] = {1.0, 1.0, 1.0, 1.0};
+    static float positionA[] = {5.0, 5.0, 15.0, 1.0};
+
+    static float front_mat_shininess[] = {30.0};
+    static float front_mat_specular[] = {0.5, 0.5, 0.5, 1.0};
+
+    static float mat_diffuse[] = {0.5, 0.5, 0.5, 1.0};
+
+    glMaterialfv(GL_FRONT, GL_SHININESS, front_mat_shininess);
+    glMaterialfv(GL_FRONT, GL_SPECULAR, front_mat_specular);
+
+    glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse);
+
+    glLightfv(GL_LIGHT0, GL_AMBIENT, ambientA);
+    glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuseA);
+    glLightfv(GL_LIGHT0, GL_POSITION, positionA);
+    glEnable(GL_LIGHTING);
+    glEnable(GL_LIGHT0);
+    glLightModelf(GL_LIGHT_MODEL_TWO_SIDE,1);
+
+    glEnable(GL_NORMALIZE);         /* would it be faster ...   */
+    glEnable(GL_COLOR_MATERIAL);
+    glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE);
+}
+
+/************************************/
+/* draw implementations             */
+/* somewhat inefficient since they  */
+/* all calculate previously         */
+/* calculated values again          */
+/* storing the values in an array   */
+/* is a posibility                  */
+/************************************/
+void displayTexture(void)
+{
+    static double time = 0.0;
+    static double anglex = 0.0;
+    static double angley = 0.0;
+    static double anglez = 0.0;
+
+    double x,y,u,v;
+    double z;
+    double dx = 2.0/((double)_squares);
+    double dy = 2.0/((double)_squares);
+
+       glMatrixMode (GL_TEXTURE);
+       glLoadIdentity ();
+       glTranslatef(-1,-1,0);
+       glScalef(0.5,0.5,1);
+       glMatrixMode (GL_MODELVIEW);
+
+    glLoadIdentity();
+    glRotatef(anglex,1,0,0);
+    glRotatef(angley,0,1,0);
+    glRotatef(anglez,0,0,1);
+    glScalef(1,1,(GLfloat)_waveHeight);
+    glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+       glEnable(GL_TEXTURE_2D);
+       glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+       glBindTexture(GL_TEXTURE_2D, gflux->texName);
+       glColor3f(0.5,0.5,0.5);
+
+    for(x=-1,u=0;x<=1;x+=dx,u+=dx) {
+        glBegin(GL_QUAD_STRIP);
+        for(y=-1,v=0;y<=1;y+=dy,v+=dx) {
+            z = getGrid(x,y,time);
+        /*  genColour(z);
+            glColor3fv(gflux->colour);
+        */  glTexCoord2f(u,v);
+            glNormal3f(
+                getGrid(x+dx,y,time)-getGrid(x-dx,y,time),
+                getGrid(x,y+dy,time)-getGrid(x,y-dy,time),
+                1
+            );
+            glVertex3f(x,y,z);
+
+            z = getGrid(x+dx,y,time);
+        /*  genColour(z);
+            glColor3fv(gflux->colour);
+        */  glTexCoord2f(u+dx,v);
+            glNormal3f(
+                getGrid(x+dx+dx,y,time)-getGrid(x,y,time),
+                getGrid(x+dx,y+dy,time)-getGrid(x+dx,y-dy,time),
+                1
+            );
+            glVertex3f(x+dx,y,z);
+        }
+        glEnd();
+    }
+
+    time -= _speed;
+    anglex -= _rotationx;
+    angley -= _rotationy;
+    anglez -= _rotationz;
+}
+void displaySolid(void)
+{
+    static double time = 0.0;
+    static double anglex = 0.0;
+    static double angley = 0.0;
+    static double anglez = 0.0;
+
+    double x,y;
+    double z;
+    double dx = 2.0/((double)_squares);
+    double dy = 2.0/((double)_squares);
+
+    glLoadIdentity();
+    glRotatef(anglex,1,0,0);
+    glRotatef(angley,0,1,0);
+    glRotatef(anglez,0,0,1);
+    glScalef(1,1,(GLfloat)_waveHeight);
+    glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+
+    for(x=-1;x<=1;x+=dx) {
+        glBegin(GL_QUAD_STRIP);
+        for(y=-1;y<=1;y+=dy) {
+            z = getGrid(x,y,time);
+            genColour(z);
+            glColor3fv(gflux->colour);
+            glVertex3f(x,y,z);
+
+            z = getGrid(x+dx,y,time);
+            genColour(z);
+            glColor3fv(gflux->colour);
+            glVertex3f(x+dx,y,z);
+        }
+        glEnd();
+    }
+
+    time -= _speed;
+    anglex -= _rotationx;
+    angley -= _rotationy;
+    anglez -= _rotationz;
+
+}
+
+void displayLight(void)
+{
+    static double time = 0.0;
+    static double anglex = 0.0;
+    static double angley = 0.0;
+    static double anglez = 0.0;
+
+    double x,y;
+    double z;
+    double dx = 2.0/((double)_squares);
+    double dy = 2.0/((double)_squares);
+
+    glLoadIdentity();
+    glRotatef(anglex,1,0,0);
+    glRotatef(angley,0,1,0);
+    glRotatef(anglez,0,0,1);
+    glScalef(1,1,(GLfloat)_waveHeight);
+    glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+
+    for(x=-1;x<=1;x+=dx) {
+        glBegin(GL_QUAD_STRIP);
+        for(y=-1;y<=1;y+=dy) {
+            z = getGrid(x,y,time);
+            genColour(z);
+            glColor3fv(gflux->colour);
+            glNormal3f(
+                getGrid(x+dx,y,time)-getGrid(x-dx,y,time),
+                getGrid(x,y+dy,time)-getGrid(x,y-dy,time),
+                1
+            );
+            glVertex3f(x,y,z);
+
+            z = getGrid(x+dx,y,time);
+            genColour(z);
+            glColor3fv(gflux->colour);
+            glNormal3f(
+                getGrid(x+dx+dx,y,time)-getGrid(x,y,time),
+                getGrid(x+dx,y+dy,time)-getGrid(x+dx,y-dy,time),
+                1
+            );
+            glVertex3f(x+dx,y,z);
+        }
+        glEnd();
+    }
+
+    time -= _speed;
+    anglex -= _rotationx;
+    angley -= _rotationy;
+    anglez -= _rotationz;
+}
+
+void displayWire(void)
+{
+    static double time = 0.0;
+    static double anglex = 0.0;
+    static double angley = 0.0;
+    static double anglez = 0.0;
+
+    double x,y;
+    double z;
+    double dx1 = 2.0/((double)(_squares*_resolution)) - 0.00001;
+    double dy1 = 2.0/((double)(_squares*_resolution)) - 0.00001;
+    double dx2 = 2.0/((double)_squares) - 0.00001;
+    double dy2 = 2.0/((double)_squares) - 0.00001;
+
+    glLoadIdentity();
+    glRotatef(anglex,1,0,0);
+    glRotatef(angley,0,1,0);
+    glRotatef(anglez,0,0,1);
+    glScalef(1,1,(GLfloat)_waveHeight);
+    glClear(GL_COLOR_BUFFER_BIT);
+
+    for(x=-1;x<=1;x+=dx2) {
+        glBegin(GL_LINE_STRIP);
+        for(y=-1;y<=1;y+=dy1) {
+            z = getGrid(x,y,time);
+            genColour(z);
+            glColor3fv(gflux->colour);
+            glVertex3f(x,y,z);
+        }
+        glEnd();
+    }
+    for(y=-1;y<=1;y+=dy2) {
+        glBegin(GL_LINE_STRIP);
+        for(x=-1;x<=1;x+=dx1) {
+            z = getGrid(x,y,time);
+            genColour(z);
+            glColor3fv(gflux->colour);
+            glVertex3f(x,y,z);
+        }
+        glEnd();
+    }
+
+    time -= _speed;
+    anglex -= _rotationx;
+    angley -= _rotationy;
+    anglez -= _rotationz;
+}
+
+/* generates new ripples */
+void calcGrid(void)
+{
+    static int counter=0;
+    double tmp;
+    static int newWave;
+
+    tmp = 1.0/((double)_waveChange);
+    if(!(counter%_waveChange)) {
+        newWave = ((int)(counter*tmp))%_waves;
+        gflux->dispx[newWave] = 1.0 - ((double)random())/RAND_MAX;
+        gflux->dispy[newWave] = 1.0 - ((double)random())/RAND_MAX;
+        gflux->freq[newWave] = _waveFreq * ((float)random())/RAND_MAX;
+        gflux->wa[newWave] = 0.0;
+    }
+    counter++;
+    gflux->wa[newWave] += tmp;
+    gflux->wa[(newWave+1)%_waves] -= tmp;
+}
+
+/* returns a height for the grid given time and x,y space co-ords */
+double getGrid(double x, double y, double a)
+{
+    register int i;
+    double retval=0.0;
+    double tmp;
+
+    tmp = 1.0/((float)_waves);
+    for(i=0;i<_waves;i++) {
+      retval += gflux->wa[i] * tmp * sin( gflux->freq[i]
+              * ( (x+gflux->dispx[i]) * (x+gflux->dispx[i]) 
+                + (y+gflux->dispy[i]) * (y+gflux->dispy[i]) +a ) );
+    }
+    return(retval);
+}
+
+#endif
+
diff --git a/hacks/glx/gflux.man b/hacks/glx/gflux.man
new file mode 100644 (file)
index 0000000..3391147
--- /dev/null
@@ -0,0 +1,82 @@
+.TH XScreenSaver 1 "July 2000"
+.SH NAME
+gflux \- rippling surface graphics hack
+.SH SYNOPSIS
+.B gflux
+[\-display \fIhost:display.screen\fP] [\-window] [\-root] [\-install] [\-visual \fIvisual\fP] [\-squares \fInum\fP] [\-resolution \fInum\fP] [\-draw \fInum\fP] [\-flat \fInum\fP] [\-speed \fInum\fP] [\-rotationx \fInum\fP] [\-rotationy \fInum\fP] [\-rotationz \fInum\fP]  [\-waves \fInum\fP] [\-waveChange \fInum\fP] [\-waveHeight \fInum\fP] [\-waveFreq \fInum\fP] [\-zoom \fInum\fP]
+.SH DESCRIPTION
+The \fIgflux\fP program draws a colourfull animated rippling square rotating in 3D space.
+.SH OPTIONS
+.I gflux
+accepts the following options:
+.TP 8
+.B \-window
+Draw on a newly-created window.  This is the default.
+.TP 8
+.B \-root
+Draw on the root window.
+.TP 8
+.B \-install
+Install a private colormap for the window.
+.TP 8
+.B \-visual \fIvisual\fP\fP
+Specify which visual to use.  Legal values are the name of a visual class,
+or the id number (decimal or hex) of a specific visual.
+.TP 8
+.B \-squares \fInum\fP\fP
+Specifies the size of the grid in squares. default 19
+.TP 8
+.B \-resolution \fInum\fP\fP
+Specifies the wireframe detail of the squares. default 4
+.TP 8
+.B \-draw \fInum\fP\fP
+Specifies the draw method. 0 = wireframe (default), 1 = solid, 2 = light, 3 = checker texture mapped, 4 = PNM image is read from stdin and mapped to the surface
+.TP 8
+.B \-flat \fInum\fP\fP
+0 for smooth shading 1 for flat. default 0
+.TP 8
+.B \-speed \fInum\fP\fP
+Specifies speed of ripples flowing over the surface. default 0.05
+.TP 8
+.B \-rotationx \fInum\fP \-rotationy \fInum\fP \-rotationz \fInum\fP\fP
+Specifies the speed of rotation of the surface in these axis 
+.TP 8
+.B \-waves \fInum\fP\fP
+Specifies the number of ripple centres at any one time.  Values should be greater than 1.  default 3
+.TP 8
+.B \-waveChange \fInum\fP\fP
+Specifies the duration of a ripple centre.  after this they fade away to be reborn elsewhere with a different frequency. default 50
+.TP 8
+.B \-waveHeight \fInum\fP\fP
+Specifies the height of ripples on the surface. default 1.0
+.TP 8
+.B \-waveFreq \fInum\fP\fP
+Specifies the maximum frequency of ripples. default 3.0
+.TP 8
+.B \-zoom \fInum\fP\fP
+Specifies the size of the viewport. Smaller values fill the screen with rippling surface. default 1.0
+.SH ENVIRONMENT
+.PP
+.TP 8
+.B DISPLAY
+to get the default host and display number.
+.TP 8
+.B XENVIRONMENT
+to get the name of a resource file that overrides the global resources
+stored in the RESOURCE_MANAGER property.
+.SH BUGS
+It's not unknown for this and other OpenGL hacks to fail under hardware accelaration (UtahGLX) and take the X server with them.  Texture images must be 16x16 or 32x32 or 64x64 etc.
+.SH SEE ALSO
+.BR X (1),
+.BR xscreensaver (1)
+.SH COPYRIGHT
+Copyright \(co 2000 by Josiah Pease.  Permission to use, copy, modify,
+distribute, and sell this software and its documentation for any purpose is
+hereby granted without fee, provided that the above copyright notice appear
+in all copies and that both that copyright notice and this permission notice
+appear in supporting documentation.  No representations are made about the
+suitability of this software for any purpose.  It is provided "as is" without
+express or implied warranty.
+.SH AUTHOR
+Josiah Pease <gflux@jpease.force9.co.uk>, 10-Jun-2000.
diff --git a/hacks/glx/xscreensaver-gl-helper.c b/hacks/glx/xscreensaver-gl-helper.c
new file mode 100644 (file)
index 0000000..7a4d66f
--- /dev/null
@@ -0,0 +1,75 @@
+/* xscreensaver, Copyright (c) 2000 by Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or 
+ * implied warranty.
+ */
+
+/* xscreensaver-gl-helper -- prints the ID of the best visual to use
+   for GL programs on stdout.
+ */
+
+#include "utils.h"
+#include "visual.h"
+
+#include <GL/gl.h>
+#include <GL/glx.h>
+
+char *progname = 0;
+char *progclass = "XScreenSaver";
+void *db = 0; /* hack hack -- no need for Xt in this program */
+
+int
+main (int argc, char **argv)
+{
+  Display *dpy;
+  Screen *screen;
+  Visual *visual;
+  char *d = getenv ("DISPLAY");
+  int i;
+
+  progname = argv[0];
+  for (i = 1; i < argc; i++)
+    {
+      if (argv[i][0] == '-' && argv[i][1] == '-') argv[i]++;
+      if (strlen(argv[i]) >= 2 &&
+          !strncmp ("-display", argv[i], strlen(argv[i])))
+        {
+          if (i == argc-1) goto LOSE;
+          d = argv[i+1];
+          i++;
+        }
+      else
+        {
+         LOSE:
+          fprintf (stderr, "usage: %s [ -display host:dpy.screen ]\n",
+                   progname);
+          fprintf (stderr,
+                   "This program prints out the ID of the best "
+                   "X visual for GL programs to use.\n");
+          exit (1);
+        }
+    }
+
+  dpy = XOpenDisplay (d);
+  if (!dpy)
+    {
+      fprintf (stderr, "%s: couldn't open display %s\n", progname,
+               (d ? d : "(null)"));
+      exit (1);
+    }
+
+  screen = DefaultScreenOfDisplay (dpy);
+  visual = get_gl_visual (screen);
+
+  if (visual)
+    printf ("0x%x\n", XVisualIDFromVisual (visual));
+  else
+    printf ("none\n");
+
+  exit (0);
+}
diff --git a/hacks/glx/xscreensaver-gl-helper.man b/hacks/glx/xscreensaver-gl-helper.man
new file mode 100644 (file)
index 0000000..7c40eb3
--- /dev/null
@@ -0,0 +1,33 @@
+.TH XScreenSaver 1 "5-Nov-00" "X Version 11"
+.SH NAME
+xscreensaver-gl-helper - figure out which X visual to use for GL programs
+.SH SYNOPSIS
+.B xscreensaver-gl-helper
+[\-display \fIhost:display.screen\fP]
+.SH DESCRIPTION
+This program prints the ID of the visual that should be used for proper
+operation of OpenGL programs.  This program only exists so that the 
+.BR xscreensaver (1)
+daemon does not need to link against the OpenGL library.
+.SH ENVIRONMENT
+.PP
+.TP 8
+.B DISPLAY
+to get the default host, display, and screen number.
+.SH SEE ALSO
+.BR X (1),
+.BR xdpyinfo (1),
+.BR xglinfo (1),
+.BR glxinfo (1),
+.BR glxdpyinfo (1),
+.BR xscreensaver (1),
+.BR xscreensaver\-demo (1),
+.BR xscreensaver\-command (1)
+.SH COPYRIGHT
+Copyright \(co 2000 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.
diff --git a/hacks/hyperball.c b/hacks/hyperball.c
new file mode 100644 (file)
index 0000000..34c2a2a
--- /dev/null
@@ -0,0 +1,2507 @@
+/* xscreensaver, Copyright (c) 1992, 1995, 1996, 1998, 2000
+ *  Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or 
+ * implied warranty.
+ *
+ * This code derived from TI Explorer Lisp code by Joe Keane, Fritz Mueller,
+ * and Jamie Zawinski.
+ */
+
+#include <math.h>
+#include "screenhack.h"
+
+#define POINT_COUNT 600
+#define LINE_COUNT 1200
+
+#define ANGLE_SCALE 0.001
+
+struct point_info
+{
+  float pg_a;
+  float pg_b;
+  float pg_c;
+  float pg_d;
+};
+
+struct line_info
+{
+  short li_ip;
+  short li_iq;
+  char li_color;
+  char li_pad[3];
+};
+
+struct point_state
+{
+  short old_x, old_y;
+  short new_x, new_y;
+  unsigned char old_dep, new_dep;
+};
+
+struct hyper_state
+{
+  char hs_stop;
+  char hs_resize;
+  char hs_redraw;
+  char hs_icon;
+  Display *hs_display;
+  Window hs_window;
+  float hs_observer_z;
+  float hs_unit_scale;
+  float hs_offset_x;
+  float hs_offset_y;
+  int hs_delay;
+  double hs_angle_xy;
+  double hs_angle_xz;
+  double hs_angle_yz;
+  double hs_angle_xw;
+  double hs_angle_yw;
+  double hs_angle_zw;
+  double hs_cos_xy, hs_sin_xy;
+  double hs_cos_xz, hs_sin_xz;
+  double hs_cos_yz, hs_sin_yz;
+  double hs_cos_xw, hs_sin_xw;
+  double hs_cos_yw, hs_sin_yw;
+  double hs_cos_zw, hs_sin_zw;
+  double hs_ref_ax, hs_ref_ay, hs_ref_az, hs_ref_aw;
+  double hs_ref_bx, hs_ref_by, hs_ref_bz, hs_ref_bw;
+  double hs_ref_cx, hs_ref_cy, hs_ref_cz, hs_ref_cw;
+  double hs_ref_dx, hs_ref_dy, hs_ref_dz, hs_ref_dw;
+  GC hs_color_gcs[8][8];
+  char hs_moved[POINT_COUNT];
+  struct point_state hs_points[POINT_COUNT];
+};
+
+static const struct point_info point_table[POINT_COUNT];
+static const struct line_info line_table[LINE_COUNT];
+
+static struct hyper_state hyper_state;
+
+static void init (struct hyper_state *hs);
+static void hyper (struct hyper_state *hs);
+static void check_events (struct hyper_state *hs);
+static void set_sizes (struct hyper_state *hs, int width, int height);
+
+
+char *progclass = "Hyperball";
+
+char *defaults[] =
+{
+  "*observer-z: 3",
+  "*delay: 20000",
+  "*xy: 3",
+  "*xz: 5",
+  "*yw: 10",
+  "*yz: 0",
+  "*xw: 0",
+  "*zw: 0",
+  ".background:        black",
+  ".foreground:        white",
+  "*color00:#FF66BE",
+  "*color10:#FFA300",
+  "*color20:#BEDC00",
+  "*color30:#12FB00",
+  "*color40:#00F9BE",
+  "*color50:#12D5FF",
+  "*color60:#BE9AFF",
+  "*color70:#FF5FFF",
+  "*color01:#FF5BAA",
+  "*color11:#F09200",
+  "*color21:#AAC500",
+  "*color31:#10E100",
+  "*color41:#00DFAA",
+  "*color51:#10BFFF",
+  "*color61:#AA8AFF",
+  "*color71:#F055FF",
+  "*color02:#EE529A",
+  "*color12:#D98400",
+  "*color22:#9AB200",
+  "*color32:#0ECB00",
+  "*color42:#00C99A",
+  "*color52:#0EADE7",
+  "*color62:#9A7DFF",
+  "*color72:#D94DE7",
+  "*color03:#DA4B8C",
+  "*color13:#C67900",
+  "*color23:#8CA300",
+  "*color33:#0DBA00",
+  "*color43:#00B88C",
+  "*color53:#0D9ED3",
+  "*color63:#8C72EA",
+  "*color73:#C646D3",
+  "*color04:#C84581",
+  "*color14:#B66F00",
+  "*color24:#819600",
+  "*color34:#0CAB00",
+  "*color44:#00A981",
+  "*color54:#0C91C2",
+  "*color64:#8169D7",
+  "*color74:#B641C2",
+  "*color05:#B94078",
+  "*color15:#A96700",
+  "*color25:#788B00",
+  "*color35:#0B9E00",
+  "*color45:#009D78",
+  "*color55:#0B86B3",
+  "*color65:#7861C7",
+  "*color75:#A93CB3",
+  "*color06:#AC3C6F",
+  "*color16:#9D6000",
+  "*color26:#6F8100",
+  "*color36:#0A9300",
+  "*color46:#00926F",
+  "*color56:#0A7DA7",
+  "*color66:#6F5AB9",
+  "*color76:#9D38A7",
+  "*color07:#A13868",
+  "*color17:#935900",
+  "*color27:#687900",
+  "*color37:#0A8A00",
+  "*color47:#008868",
+  "*color57:#0A759C",
+  "*color67:#6854AD",
+  "*color77:#93349C",
+  0,
+};
+
+XrmOptionDescRec options [] =
+{
+  { "-observer-z",     ".observer-z",  XrmoptionSepArg, 0 },
+  { "-delay",          ".delay",       XrmoptionSepArg, 0 },
+  { "-xw",             ".xw",          XrmoptionSepArg, 0 },
+  { "-xy",             ".xy",          XrmoptionSepArg, 0 },
+  { "-xz",             ".xz",          XrmoptionSepArg, 0 },
+  { "-yw",             ".yw",          XrmoptionSepArg, 0 },
+  { "-yz",             ".yz",          XrmoptionSepArg, 0 },
+  { "-zw",             ".zw",          XrmoptionSepArg, 0 },
+  { 0, 0, 0, 0 },
+};
+
+
+void
+screenhack (Display *d, Window w)
+{
+  struct hyper_state *hs;
+
+  hs = &hyper_state;
+  hs->hs_display = d;
+  hs->hs_window = w;
+
+  init (hs);
+
+  hyper (hs);
+}
+
+
+static void
+init (struct hyper_state *hs)
+{
+  Display *dpy;
+  Window win;
+  XGCValues gcv;
+  Colormap cmap;
+  /* double xy, xz, yz, xw, yw, zw; */
+  unsigned long bg_pixel;
+  float observer_z;
+  int delay;
+
+  dpy = hs->hs_display;
+  win = hs->hs_window;
+
+  observer_z = get_float_resource ("observer-z", "Float");
+  if (observer_z < 1.125)
+    observer_z = 1.125;
+  hs->hs_observer_z = observer_z;
+
+  {
+    int root;
+    XWindowAttributes wa;
+    int width;
+    int height;
+
+    root = get_boolean_resource("root", "Boolean");
+    XGetWindowAttributes (dpy, win, &wa);
+    XSelectInput(dpy, win, root ? ExposureMask :
+                wa.your_event_mask | ExposureMask |
+                ButtonPressMask | StructureNotifyMask);
+
+    width = wa.width;
+    height = wa.height;
+    cmap = wa.colormap;
+    set_sizes (hs, width, height);
+  }
+
+  hs->hs_angle_xy = get_float_resource ("xy", "Float") * ANGLE_SCALE;
+  hs->hs_angle_xz = get_float_resource ("xz", "Float") * ANGLE_SCALE;
+  hs->hs_angle_yz = get_float_resource ("yz", "Float") * ANGLE_SCALE;
+  hs->hs_angle_xw = get_float_resource ("xw", "Float") * ANGLE_SCALE;
+  hs->hs_angle_yw = get_float_resource ("yw", "Float") * ANGLE_SCALE;
+  hs->hs_angle_zw = get_float_resource ("zw", "Float") * ANGLE_SCALE;
+
+  delay = get_integer_resource ("delay", "Integer");
+  hs->hs_delay = delay;
+
+  bg_pixel = get_pixel_resource ("background", "Background", dpy, cmap);
+
+  if (mono_p)
+    {
+      GC black_gc;
+      unsigned long fg_pixel;
+      GC white_gc;
+
+      gcv.function = GXcopy;
+      gcv.foreground = bg_pixel;
+      black_gc = XCreateGC (dpy, win, GCForeground|GCFunction, &gcv);
+      fg_pixel = get_pixel_resource ("foreground", "Foreground", dpy, cmap);
+      gcv.foreground = fg_pixel;
+      white_gc = XCreateGC (dpy, win, GCForeground|GCFunction, &gcv);
+      hs->hs_color_gcs[0][0] = black_gc;
+      hs->hs_color_gcs[0][1] = white_gc;
+    }
+  else
+    {
+      int col;
+      int dep;
+
+      gcv.function = GXxor;
+      for (col = 0; col < 8; col++)
+       for (dep = 0; dep < 8; dep++)
+         {
+           char buffer[16];
+           unsigned long fg_pixel;
+           GC color_gc;
+
+           sprintf (buffer, "color%d%d", col, dep);
+           fg_pixel = get_pixel_resource (buffer, "Foreground", dpy, cmap);
+           gcv.foreground = fg_pixel ^ bg_pixel;
+           color_gc = XCreateGC (dpy, win, GCForeground|GCFunction, &gcv);
+           hs->hs_color_gcs[col][dep] = color_gc;
+         }
+    }
+
+  {
+  double xy;
+  double xz;
+  double yz;
+  double xw;
+  double yw;
+  double zw;
+#if 1
+  double cos_xy, sin_xy;
+  double cos_xz, sin_xz;
+  double cos_yz, sin_yz;
+  double cos_xw, sin_xw;
+  double cos_yw, sin_yw;
+  double cos_zw, sin_zw;
+#endif
+
+  hs->hs_ref_ax = 1.0, hs->hs_ref_ay = 0.0, hs->hs_ref_az = 0.0, hs->hs_ref_aw = 0.0;
+  hs->hs_ref_bx = 0.0, hs->hs_ref_by = 1.0, hs->hs_ref_bz = 0.0, hs->hs_ref_bw = 0.0;
+  hs->hs_ref_cx = 0.0, hs->hs_ref_cy = 0.0, hs->hs_ref_cz = 1.0, hs->hs_ref_cw = 0.0;
+  hs->hs_ref_dx = 0.0, hs->hs_ref_dy = 0.0, hs->hs_ref_dz = 0.0, hs->hs_ref_dw = 1.0;
+
+  xy = hs->hs_angle_xy;
+  xz = hs->hs_angle_xz;
+  yz = hs->hs_angle_yz;
+  xw = hs->hs_angle_xw;
+  yw = hs->hs_angle_yw;
+  zw = hs->hs_angle_zw;
+
+  cos_xy = cos (xy), sin_xy = sin (xy);
+  hs->hs_cos_xy = cos_xy, hs->hs_sin_xy = sin_xy;
+  cos_xz = cos (xz), sin_xz = sin (xz);
+  hs->hs_cos_xz = cos_xz, hs->hs_sin_xz = sin_xz;
+  cos_yz = cos (yz), sin_yz = sin (yz);
+  hs->hs_cos_yz = cos_yz, hs->hs_sin_yz = sin_yz;
+  cos_xw = cos (xw), sin_xw = sin (xw);
+  hs->hs_cos_xw = cos_xw, hs->hs_sin_xw = sin_xw;
+  cos_yw = cos (yw), sin_yw = sin (yw);
+  hs->hs_cos_yw = cos_yw, hs->hs_sin_yw = sin_yw;
+  cos_zw = cos (zw), sin_zw = sin (zw);
+  hs->hs_cos_zw = cos_zw, hs->hs_sin_zw = sin_zw;
+  }
+}
+
+
+static void
+hyper (struct hyper_state *hs)
+{
+  int roted;
+
+  roted = 0;
+
+  for (;;)
+    {
+      int icon;
+      int resize;
+      int redraw;
+      int stop;
+      int delay;
+
+      check_events (hs);
+
+      icon = hs->hs_icon;
+      resize = hs->hs_resize;
+      if (icon || !(roted | resize))
+       goto skip1;
+
+      {
+       int pc;
+       const struct point_info *point_ptr;
+       struct point_state *point_state;
+       float observer_z;
+       float unit_scale;
+       float offset_x;
+       float offset_y;
+       char *mark_ptr;
+
+       pc = POINT_COUNT;
+       point_ptr = &point_table[0];
+       point_state = &hs->hs_points[0];
+       mark_ptr = &hs->hs_moved[0];
+
+       while (--pc >= 0)
+         {
+           double pos_a;
+           double pos_b;
+           double pos_c;
+           double pos_d;
+           double az, bz, cz, dz;
+           double sum_z;
+           double ax, bx, cx, dx;
+           double sum_x;
+           double ay, by, cy, dy;
+           double sum_y;
+           double mul;
+           int old_x;
+           int old_y;
+           int old_dep;
+           double xf;
+           double yf;
+           int new_x;
+           int new_y;
+           int new_dep;
+           int mov;
+
+           pos_a = point_ptr->pg_a;
+           pos_b = point_ptr->pg_b;
+           pos_c = point_ptr->pg_c;
+           pos_d = point_ptr->pg_d;
+           point_ptr++;
+           az = hs->hs_ref_az; bz = hs->hs_ref_bz; cz = hs->hs_ref_cz; dz = hs->hs_ref_dz;
+           ax = hs->hs_ref_ax; bx = hs->hs_ref_bx; cx = hs->hs_ref_cx; dx = hs->hs_ref_dx;
+           ay = hs->hs_ref_ay; by = hs->hs_ref_by; cy = hs->hs_ref_cy; dy = hs->hs_ref_dy;
+           sum_z = pos_a * az + pos_b * bz + pos_c * cz + pos_d * dz;
+           observer_z = hs->hs_observer_z;
+           unit_scale = hs->hs_unit_scale;
+           sum_x = pos_a * ax + pos_b * bx + pos_c * cx + pos_d * dx;
+           sum_y = pos_a * ay + pos_b * by + pos_c * cy + pos_d * dy;
+           mul = unit_scale / (observer_z - sum_z);
+           offset_x = hs->hs_offset_x;
+           offset_y = hs->hs_offset_y;
+           old_x = point_state->new_x;
+           old_y = point_state->new_y;
+           old_dep = point_state->new_dep;
+           xf = sum_x * mul + offset_x;
+           yf = sum_y * mul + offset_y;
+           new_x = (int)rint(xf);
+           new_y = (int)rint(yf);
+           new_dep = (int)floor(sum_z * -128.0) + 128;
+           point_state->old_x = old_x;
+           point_state->old_y = old_y;
+           point_state->old_dep = old_dep;
+           point_state->new_x = new_x;
+           point_state->new_y = new_y;
+           point_state->new_dep = new_dep;
+           point_state++;
+           mov = new_x != old_x || new_y != old_y || new_dep != old_dep;
+           *mark_ptr = mov;
+           mark_ptr++;
+         }
+      }
+
+    skip1:
+      icon = hs->hs_icon;
+      redraw = hs->hs_redraw;
+      if (icon || !(roted | redraw))
+       goto skip2;
+
+      {
+       int lc;
+       const struct line_info *li_ptr;
+       int mono;
+       Display *dpy;
+       Window win;
+
+       lc = LINE_COUNT;
+       li_ptr = &line_table[0];
+       mono = mono_p;
+       dpy = hs->hs_display;
+       win = hs->hs_window;
+
+       while (--lc >= 0)
+         {
+           int ip;
+           int iq;
+           int col;
+           int mov_p;
+           int mov_q;
+           struct point_state *sp;
+           struct point_state *sq;
+           int p_x;
+           int p_y;
+           int q_x;
+           int q_y;
+           GC erase_gc;
+           GC draw_gc;
+           int old_sum;
+           int new_sum;
+           int old_dep;
+           int new_dep;
+
+           ip = li_ptr->li_ip;
+           iq = li_ptr->li_iq;
+           col = li_ptr->li_color;
+           li_ptr++;
+           mov_p = hs->hs_moved[ip];
+           mov_q = hs->hs_moved[iq];
+           if (!(redraw | mov_p | mov_q))
+             continue;
+
+           sp = &hs->hs_points[ip];
+           sq = &hs->hs_points[iq];
+
+           if (mono)
+             {
+               erase_gc = hs->hs_color_gcs[0][0];
+               draw_gc = hs->hs_color_gcs[0][1];
+             }
+           else
+             {
+               GC *row;
+
+               old_sum = sp->old_dep + sq->old_dep;
+               new_sum = sp->new_dep + sq->new_dep;
+               row = &hs->hs_color_gcs[col][0];
+               old_dep = old_sum >> 6;
+               new_dep = new_sum >> 6;
+               erase_gc = row[old_dep];
+               draw_gc = row[new_dep];
+             }
+
+           if (!redraw)
+             {
+               p_x = sp->old_x;
+               p_y = sp->old_y;
+               q_x = sq->old_x;
+               q_y = sq->old_y;
+               XDrawLine (dpy, win, erase_gc, p_x, p_y, q_x, q_y);
+             }
+
+           p_x = sp->new_x;
+           p_y = sp->new_y;
+           q_x = sq->new_x;
+           q_y = sq->new_y;
+           XDrawLine (dpy, win, draw_gc, p_x, p_y, q_x, q_y);
+         }
+
+       XFlush (dpy);
+      }
+
+    skip2:
+      stop = hs->hs_stop;
+      roted = 0;
+      if (stop)
+       goto skip3;
+
+      roted = 1;
+
+      {
+       double cos_a;
+       double sin_a;
+       double old_u;
+       double old_v;
+       double new_u;
+       double new_v;
+
+ /* If you get error messages about the following forms, and you think you're
+    using an ANSI C conforming compiler, then you're mistaken.  Possibly you're
+    mixing an ANSI compiler with a non-ANSI preprocessor, or vice versa.
+    Regardless, your system is broken; it's not a bug in this program.
+  */
+#if defined(__STDC__) || defined(__ANSI_CPP__)
+
+#define rotate(name,dim0,dim1) \
+  old_u = hs->hs_ref_##name##dim0; \
+  old_v = hs->hs_ref_##name##dim1; \
+  new_u = old_u * cos_a + old_v * sin_a; \
+  new_v = old_v * cos_a - old_u * sin_a; \
+  hs->hs_ref_##name##dim0 = new_u; \
+  hs->hs_ref_##name##dim1 = new_v;
+
+#define rotates(dim0,dim1) \
+  if (hs->hs_sin_##dim0##dim1 != 0) { \
+    cos_a = hs->hs_cos_##dim0##dim1; \
+    sin_a = hs->hs_sin_##dim0##dim1; \
+    rotate(a, dim0, dim1); \
+    rotate(b, dim0, dim1); \
+    rotate(c, dim0, dim1); \
+    rotate(d, dim0, dim1); \
+  }
+
+#else /* !__STDC__, courtesy of Andreas Luik <luik@isa.de> */
+
+#define rotate(name,dim0,dim1,cos,sin) \
+  old_u = hs->hs_ref_/**/name/**/dim0; \
+  old_v = hs->hs_ref_/**/name/**/dim1; \
+  new_u = old_u * cos_a + old_v * sin_a; \
+  new_v = old_v * cos_a - old_u * sin_a; \
+  hs->hs_ref_/**/name/**/dim0 = new_u; \
+  hs->hs_ref_/**/name/**/dim1 = new_v;
+
+#define rotates(dim0,dim1) \
+  if (hs->hs_sin_/**/dim0/**/dim1 != 0) { \
+    cos_a = hs->hs_cos_/**/dim0/**/dim1; \
+    sin_a = hs->hs_sin_/**/dim0/**/dim1; \
+    rotate(a, dim0, dim1); \
+    rotate(b, dim0, dim1); \
+    rotate(c, dim0, dim1); \
+    rotate(d, dim0, dim1); \
+  }
+
+#endif
+
+       rotates (x, y);
+       rotates (x, z);
+       rotates (y, z);
+       rotates (x, w);
+       rotates (y, w);
+       rotates (z, w);
+      }
+
+    skip3:
+      /* stop = hs->hs_stop; */
+      delay = hs->hs_delay;
+      if (stop && delay < 10000)
+       delay = 10000;
+      if (delay > 0)
+       usleep (delay);
+    }
+}
+
+
+static void
+check_events (struct hyper_state *hs)
+{
+  Display *dpy;
+  int count;
+  int ic;
+  int resize;
+  Window win;
+  int redraw;
+
+  dpy = hs->hs_display;
+  count = XEventsQueued (dpy, QueuedAfterReading);
+  ic = count;
+  hs->hs_resize = 0;
+  hs->hs_redraw = 0;
+
+  while (--ic >= 0)
+    {
+      XEvent   e;
+
+      XNextEvent (dpy, &e);
+
+      switch (e.type)
+       {
+       case Expose:
+         hs->hs_icon = 0;
+         hs->hs_redraw = 1;
+         break;
+
+       case ConfigureNotify:
+         hs->hs_icon = 0;
+         hs->hs_resize = 1;
+         hs->hs_redraw = 1;
+         break;
+
+       case ButtonPress:
+         switch (e.xbutton.button)
+           {
+           case 2:
+             hs->hs_stop = !hs->hs_stop;
+             break;
+           default:
+             break;
+           }
+         break;
+
+       case UnmapNotify:
+         hs->hs_icon = 1;
+         hs->hs_redraw = 0;
+         break;
+
+       default:
+         screenhack_handle_event(dpy, &e);
+         break;
+       }
+    }
+
+  resize = hs->hs_resize;
+  win = hs->hs_window;
+  if (resize)
+    {
+      XWindowAttributes wa;
+      int width;
+      int height;
+
+      XGetWindowAttributes (dpy, win, &wa);
+      width = wa.width;
+      height = wa.height;
+      set_sizes (hs, width, height);
+    }
+
+  redraw = hs->hs_redraw;
+  if (redraw)
+    XClearWindow (dpy, win);
+}
+
+
+static void
+set_sizes (struct hyper_state *hs, int width, int height)
+{
+  double observer_z;
+  int min_dim;
+  double var;
+  double offset_x;
+  double offset_y;
+  double unit_scale;
+
+  observer_z = hs->hs_observer_z;
+  min_dim = width < height ? width : height;
+  var = sqrt(observer_z * observer_z - 1.0);
+  offset_x = 0.5 * (width - 1);
+  offset_y = 0.5 * (height - 1);
+  unit_scale = 0.4 * min_dim * var;
+  hs->hs_offset_x = (float)offset_x;
+  hs->hs_offset_y = (float)offset_y;
+  hs->hs_unit_scale = (float)unit_scale;
+}
+
+
+/* data */
+
+static const struct point_info point_table[POINT_COUNT] =
+{
+    { 0.93, 0.30, 0.09, 0.03, },
+    { 0.84, 0.49, -0.08, 0.05, },
+    { 0.72, 0.65, 0.02, -0.09, },
+    { 0.57, 0.79, 0.05, 0.07, },
+    { 0.40, 0.89, -0.09, -0.01, },
+    { 0.20, 0.95, 0.07, -0.06, },
+    { 0.00, 0.97, 0.00, 0.09, },
+    { -0.20, 0.95, -0.07, -0.06, },
+    { -0.40, 0.89, 0.09, -0.01, },
+    { -0.57, 0.79, -0.05, 0.07, },
+    { -0.72, 0.65, -0.02, -0.09, },
+    { -0.84, 0.49, 0.08, 0.05, },
+    { -0.93, 0.30, -0.09, 0.03, },
+    { -0.97, 0.10, 0.04, -0.08, },
+    { -0.97, -0.10, 0.04, 0.08, },
+    { -0.93, -0.30, -0.09, -0.03, },
+    { -0.84, -0.49, 0.08, -0.05, },
+    { -0.72, -0.65, -0.02, 0.09, },
+    { -0.57, -0.79, -0.05, -0.07, },
+    { -0.40, -0.89, 0.09, 0.01, },
+    { -0.20, -0.95, -0.07, 0.06, },
+    { 0.00, -0.97, 0.00, -0.09, },
+    { 0.20, -0.95, 0.07, 0.06, },
+    { 0.40, -0.89, -0.09, 0.01, },
+    { 0.57, -0.79, 0.05, -0.07, },
+    { 0.72, -0.65, 0.02, 0.09, },
+    { 0.84, -0.49, -0.08, -0.05, },
+    { 0.93, -0.30, 0.09, -0.03, },
+    { 0.97, -0.10, -0.04, 0.08, },
+    { 0.97, 0.10, -0.04, -0.08, },
+    { 0.27, 0.83, -0.13, -0.41, },
+    { 0.09, 0.87, 0.40, 0.18, },
+    { -0.09, 0.87, -0.40, 0.18, },
+    { -0.27, 0.83, 0.13, -0.41, },
+    { -0.44, 0.76, 0.22, 0.38, },
+    { -0.59, 0.65, -0.42, -0.09, },
+    { -0.71, 0.51, 0.35, -0.25, },
+    { -0.80, 0.36, -0.05, 0.43, },
+    { -0.86, 0.18, -0.29, -0.32, },
+    { -0.88, 0.00, 0.43, 0.00, },
+    { -0.86, -0.18, -0.29, 0.32, },
+    { -0.80, -0.36, -0.05, -0.43, },
+    { -0.71, -0.51, 0.35, 0.25, },
+    { -0.59, -0.65, -0.42, 0.09, },
+    { -0.44, -0.76, 0.22, -0.38, },
+    { -0.27, -0.83, 0.13, 0.41, },
+    { -0.09, -0.87, -0.40, -0.18, },
+    { 0.09, -0.87, 0.40, -0.18, },
+    { 0.27, -0.83, -0.13, 0.41, },
+    { 0.44, -0.76, -0.22, -0.38, },
+    { 0.59, -0.65, 0.42, 0.09, },
+    { 0.71, -0.51, -0.35, 0.25, },
+    { 0.80, -0.36, 0.05, -0.43, },
+    { 0.86, -0.18, 0.29, 0.32, },
+    { 0.88, 0.00, -0.43, 0.00, },
+    { 0.86, 0.18, 0.29, -0.32, },
+    { 0.80, 0.36, 0.05, 0.43, },
+    { 0.71, 0.51, -0.35, -0.25, },
+    { 0.59, 0.65, 0.42, -0.09, },
+    { 0.44, 0.76, -0.22, 0.38, },
+    { -0.13, 0.41, -0.27, 0.83, },
+    { -0.22, 0.38, -0.44, -0.76, },
+    { -0.29, 0.32, 0.86, 0.18, },
+    { -0.35, 0.25, -0.71, 0.51, },
+    { -0.40, 0.18, 0.09, -0.87, },
+    { -0.42, 0.09, 0.59, 0.65, },
+    { -0.43, 0.00, -0.88, 0.00, },
+    { -0.42, -0.09, 0.59, -0.65, },
+    { -0.40, -0.18, 0.09, 0.87, },
+    { -0.35, -0.25, -0.71, -0.51, },
+    { -0.29, -0.32, 0.86, -0.18, },
+    { -0.22, -0.38, -0.44, 0.76, },
+    { -0.13, -0.41, -0.27, -0.83, },
+    { -0.05, -0.43, 0.80, 0.36, },
+    { 0.05, -0.43, -0.80, 0.36, },
+    { 0.13, -0.41, 0.27, -0.83, },
+    { 0.22, -0.38, 0.44, 0.76, },
+    { 0.29, -0.32, -0.86, -0.18, },
+    { 0.35, -0.25, 0.71, -0.51, },
+    { 0.40, -0.18, -0.09, 0.87, },
+    { 0.42, -0.09, -0.59, -0.65, },
+    { 0.43, 0.00, 0.88, 0.00, },
+    { 0.42, 0.09, -0.59, 0.65, },
+    { 0.40, 0.18, -0.09, -0.87, },
+    { 0.35, 0.25, 0.71, 0.51, },
+    { 0.29, 0.32, -0.86, 0.18, },
+    { 0.22, 0.38, 0.44, -0.76, },
+    { 0.13, 0.41, 0.27, 0.83, },
+    { 0.05, 0.43, -0.80, -0.36, },
+    { -0.05, 0.43, 0.80, -0.36, },
+    { 0.09, -0.03, -0.93, 0.30, },
+    { 0.09, -0.01, 0.40, -0.89, },
+    { 0.09, 0.01, 0.40, 0.89, },
+    { 0.09, 0.03, -0.93, -0.30, },
+    { 0.08, 0.05, 0.84, -0.49, },
+    { 0.07, 0.06, -0.20, 0.95, },
+    { 0.05, 0.07, -0.57, -0.79, },
+    { 0.04, 0.08, 0.97, 0.10, },
+    { 0.02, 0.09, -0.72, 0.65, },
+    { 0.00, 0.09, 0.00, -0.97, },
+    { -0.02, 0.09, 0.72, 0.65, },
+    { -0.04, 0.08, -0.97, 0.10, },
+    { -0.05, 0.07, 0.57, -0.79, },
+    { -0.07, 0.06, 0.20, 0.95, },
+    { -0.08, 0.05, -0.84, -0.49, },
+    { -0.09, 0.03, 0.93, -0.30, },
+    { -0.09, 0.01, -0.40, 0.89, },
+    { -0.09, -0.01, -0.40, -0.89, },
+    { -0.09, -0.03, 0.93, 0.30, },
+    { -0.08, -0.05, -0.84, 0.49, },
+    { -0.07, -0.06, 0.20, -0.95, },
+    { -0.05, -0.07, 0.57, 0.79, },
+    { -0.04, -0.08, -0.97, -0.10, },
+    { -0.02, -0.09, 0.72, -0.65, },
+    { 0.00, -0.09, 0.00, 0.97, },
+    { 0.02, -0.09, -0.72, -0.65, },
+    { 0.04, -0.08, 0.97, -0.10, },
+    { 0.05, -0.07, -0.57, 0.79, },
+    { 0.07, -0.06, -0.20, -0.95, },
+    { 0.08, -0.05, 0.84, 0.49, },
+    { 0.64, 0.67, -0.15, -0.28, },
+    { 0.49, 0.79, 0.30, 0.07, },
+    { 0.31, 0.87, -0.26, 0.18, },
+    { 0.13, 0.92, 0.04, -0.31, },
+    { -0.07, 0.92, 0.20, 0.24, },
+    { -0.26, 0.89, -0.31, -0.01, },
+    { -0.44, 0.82, 0.22, -0.23, },
+    { -0.60, 0.71, 0.02, 0.31, },
+    { -0.73, 0.57, -0.25, -0.19, },
+    { -0.83, 0.40, 0.31, -0.06, },
+    { -0.90, 0.22, -0.16, 0.27, },
+    { -0.93, 0.03, -0.09, -0.30, },
+    { -0.91, -0.16, 0.28, 0.14, },
+    { -0.86, -0.35, -0.29, 0.12, },
+    { -0.77, -0.52, 0.11, -0.29, },
+    { -0.64, -0.67, 0.15, 0.28, },
+    { -0.49, -0.79, -0.30, -0.07, },
+    { -0.31, -0.87, 0.26, -0.18, },
+    { -0.13, -0.92, -0.04, 0.31, },
+    { 0.07, -0.92, -0.20, -0.24, },
+    { 0.26, -0.89, 0.31, 0.01, },
+    { 0.44, -0.82, -0.22, 0.23, },
+    { 0.60, -0.71, -0.02, -0.31, },
+    { 0.73, -0.57, 0.25, 0.19, },
+    { 0.83, -0.40, -0.31, 0.06, },
+    { 0.90, -0.22, 0.16, -0.27, },
+    { 0.93, -0.03, 0.09, 0.30, },
+    { 0.91, 0.16, -0.28, -0.14, },
+    { 0.86, 0.35, 0.29, -0.12, },
+    { 0.77, 0.52, -0.11, 0.29, },
+    { 0.44, 0.82, -0.22, -0.23, },
+    { 0.26, 0.89, 0.31, -0.01, },
+    { 0.07, 0.92, -0.20, 0.24, },
+    { -0.12, 0.92, -0.04, -0.31, },
+    { -0.31, 0.87, 0.26, 0.18, },
+    { -0.49, 0.79, -0.30, 0.07, },
+    { -0.64, 0.67, 0.15, -0.28, },
+    { -0.77, 0.52, 0.11, 0.29, },
+    { -0.86, 0.35, -0.29, -0.12, },
+    { -0.91, 0.16, 0.28, -0.14, },
+    { -0.93, -0.03, -0.09, 0.30, },
+    { -0.90, -0.22, -0.16, -0.27, },
+    { -0.83, -0.40, 0.31, 0.06, },
+    { -0.73, -0.57, -0.25, 0.19, },
+    { -0.60, -0.71, 0.02, -0.31, },
+    { -0.44, -0.82, 0.22, 0.23, },
+    { -0.26, -0.89, -0.31, 0.01, },
+    { -0.07, -0.92, 0.20, -0.24, },
+    { 0.12, -0.92, 0.04, 0.31, },
+    { 0.31, -0.87, -0.26, -0.18, },
+    { 0.49, -0.79, 0.30, -0.07, },
+    { 0.64, -0.67, -0.15, 0.28, },
+    { 0.77, -0.52, -0.11, -0.29, },
+    { 0.86, -0.35, 0.29, 0.12, },
+    { 0.91, -0.16, -0.28, 0.14, },
+    { 0.93, 0.03, 0.09, -0.30, },
+    { 0.90, 0.22, 0.16, 0.27, },
+    { 0.83, 0.40, -0.31, -0.06, },
+    { 0.73, 0.57, 0.25, -0.19, },
+    { 0.60, 0.71, -0.02, 0.31, },
+    { -0.13, 0.83, -0.27, -0.41, },
+    { -0.30, 0.79, 0.49, 0.07, },
+    { -0.46, 0.71, -0.38, 0.31, },
+    { -0.60, 0.60, 0.02, -0.49, },
+    { -0.71, 0.46, 0.35, 0.35, },
+    { -0.79, 0.30, -0.49, 0.03, },
+    { -0.83, 0.13, 0.31, -0.38, },
+    { -0.84, -0.05, 0.08, 0.49, },
+    { -0.81, -0.22, -0.41, -0.27, },
+    { -0.75, -0.38, 0.48, -0.13, },
+    { -0.65, -0.53, -0.22, 0.44, },
+    { -0.53, -0.66, -0.18, -0.46, },
+    { -0.38, -0.75, 0.46, 0.17, },
+    { -0.22, -0.82, -0.44, 0.23, },
+    { -0.04, -0.84, 0.12, -0.48, },
+    { 0.13, -0.83, 0.27, 0.41, },
+    { 0.30, -0.79, -0.49, -0.07, },
+    { 0.46, -0.71, 0.38, -0.31, },
+    { 0.60, -0.60, -0.02, 0.49, },
+    { 0.71, -0.46, -0.35, -0.35, },
+    { 0.79, -0.30, 0.49, -0.03, },
+    { 0.83, -0.13, -0.31, 0.38, },
+    { 0.84, 0.05, -0.08, -0.49, },
+    { 0.81, 0.22, 0.41, 0.27, },
+    { 0.75, 0.38, -0.48, 0.13, },
+    { 0.65, 0.53, 0.22, -0.44, },
+    { 0.53, 0.66, 0.18, 0.46, },
+    { 0.38, 0.75, -0.46, -0.17, },
+    { 0.22, 0.82, 0.44, -0.23, },
+    { 0.04, 0.84, -0.12, 0.48, },
+    { -0.65, 0.53, -0.22, -0.44, },
+    { -0.75, 0.38, 0.48, 0.13, },
+    { -0.81, 0.22, -0.41, 0.27, },
+    { -0.84, 0.05, 0.08, -0.49, },
+    { -0.83, -0.13, 0.31, 0.38, },
+    { -0.79, -0.30, -0.49, -0.03, },
+    { -0.71, -0.46, 0.35, -0.35, },
+    { -0.60, -0.60, 0.02, 0.49, },
+    { -0.46, -0.71, -0.38, -0.31, },
+    { -0.30, -0.79, 0.49, -0.07, },
+    { -0.13, -0.83, -0.27, 0.41, },
+    { 0.04, -0.84, -0.13, -0.48, },
+    { 0.22, -0.82, 0.44, 0.23, },
+    { 0.38, -0.75, -0.46, 0.17, },
+    { 0.53, -0.66, 0.18, -0.46, },
+    { 0.65, -0.53, 0.22, 0.44, },
+    { 0.75, -0.38, -0.48, -0.13, },
+    { 0.81, -0.22, 0.41, -0.27, },
+    { 0.84, -0.05, -0.08, 0.49, },
+    { 0.83, 0.13, -0.31, -0.38, },
+    { 0.79, 0.30, 0.49, 0.03, },
+    { 0.71, 0.46, -0.35, 0.35, },
+    { 0.60, 0.60, -0.02, -0.49, },
+    { 0.46, 0.71, 0.38, 0.31, },
+    { 0.30, 0.79, -0.49, 0.07, },
+    { 0.13, 0.83, 0.27, -0.41, },
+    { -0.04, 0.84, 0.13, 0.48, },
+    { -0.22, 0.82, -0.44, -0.23, },
+    { -0.38, 0.75, 0.46, -0.17, },
+    { -0.53, 0.66, -0.18, 0.46, },
+    { 0.11, 0.78, -0.33, -0.47, },
+    { -0.05, 0.79, 0.57, 0.07, },
+    { -0.22, 0.76, -0.44, 0.38, },
+    { -0.37, 0.70, 0.01, -0.58, },
+    { -0.51, 0.60, 0.42, 0.40, },
+    { -0.62, 0.49, -0.57, 0.05, },
+    { -0.71, 0.35, 0.35, -0.46, },
+    { -0.77, 0.19, 0.11, 0.57, },
+    { -0.79, 0.03, -0.49, -0.30, },
+    { -0.78, -0.14, 0.55, -0.16, },
+    { -0.73, -0.29, -0.25, 0.52, },
+    { -0.65, -0.44, -0.22, -0.53, },
+    { -0.55, -0.57, 0.54, 0.19, },
+    { -0.42, -0.67, -0.51, 0.28, },
+    { -0.27, -0.74, 0.13, -0.56, },
+    { -0.11, -0.78, 0.33, 0.47, },
+    { 0.05, -0.79, -0.57, -0.07, },
+    { 0.22, -0.76, 0.44, -0.38, },
+    { 0.37, -0.70, -0.01, 0.58, },
+    { 0.51, -0.60, -0.42, -0.40, },
+    { 0.62, -0.49, 0.57, -0.05, },
+    { 0.71, -0.35, -0.35, 0.46, },
+    { 0.77, -0.19, -0.11, -0.57, },
+    { 0.79, -0.03, 0.49, 0.30, },
+    { 0.78, 0.14, -0.55, 0.16, },
+    { 0.73, 0.29, 0.25, -0.52, },
+    { 0.65, 0.44, 0.22, 0.53, },
+    { 0.55, 0.57, -0.54, -0.19, },
+    { 0.42, 0.67, 0.51, -0.28, },
+    { 0.27, 0.74, -0.13, 0.56, },
+    { -0.73, 0.29, -0.25, -0.52, },
+    { -0.78, 0.14, 0.55, 0.16, },
+    { -0.79, -0.03, -0.49, 0.30, },
+    { -0.77, -0.19, 0.11, -0.57, },
+    { -0.71, -0.35, 0.35, 0.46, },
+    { -0.62, -0.49, -0.57, -0.05, },
+    { -0.51, -0.60, 0.42, -0.40, },
+    { -0.37, -0.70, 0.01, 0.58, },
+    { -0.22, -0.76, -0.44, -0.38, },
+    { -0.05, -0.79, 0.57, -0.07, },
+    { 0.11, -0.78, -0.33, 0.47, },
+    { 0.27, -0.74, -0.13, -0.56, },
+    { 0.42, -0.67, 0.51, 0.28, },
+    { 0.55, -0.57, -0.54, 0.19, },
+    { 0.65, -0.44, 0.22, -0.53, },
+    { 0.73, -0.29, 0.25, 0.52, },
+    { 0.78, -0.14, -0.55, -0.16, },
+    { 0.79, 0.03, 0.49, -0.30, },
+    { 0.77, 0.19, -0.11, 0.57, },
+    { 0.71, 0.35, -0.35, -0.46, },
+    { 0.62, 0.49, 0.57, 0.05, },
+    { 0.51, 0.60, -0.42, 0.40, },
+    { 0.37, 0.70, -0.01, -0.58, },
+    { 0.22, 0.76, 0.44, 0.38, },
+    { 0.05, 0.79, -0.57, 0.07, },
+    { -0.11, 0.78, 0.33, -0.47, },
+    { -0.27, 0.74, 0.13, 0.56, },
+    { -0.42, 0.67, -0.51, -0.28, },
+    { -0.55, 0.57, 0.54, -0.19, },
+    { -0.65, 0.44, -0.22, 0.53, },
+    { -0.28, 0.70, -0.24, -0.58, },
+    { -0.42, 0.62, 0.59, 0.21, },
+    { -0.54, 0.52, -0.55, 0.29, },
+    { -0.64, 0.40, 0.15, -0.60, },
+    { -0.71, 0.25, 0.35, 0.51, },
+    { -0.75, 0.10, -0.62, -0.08, },
+    { -0.75, -0.06, 0.48, -0.40, },
+    { -0.72, -0.21, -0.02, 0.62, },
+    { -0.66, -0.36, -0.45, -0.43, },
+    { -0.57, -0.49, 0.62, -0.05, },
+    { -0.46, -0.60, -0.38, 0.49, },
+    { -0.33, -0.68, -0.11, -0.61, },
+    { -0.18, -0.73, 0.53, 0.33, },
+    { -0.02, -0.75, -0.60, 0.17, },
+    { 0.13, -0.74, 0.27, -0.56, },
+    { 0.28, -0.70, 0.24, 0.58, },
+    { 0.42, -0.62, -0.59, -0.21, },
+    { 0.54, -0.52, 0.55, -0.29, },
+    { 0.64, -0.40, -0.15, 0.60, },
+    { 0.71, -0.25, -0.35, -0.51, },
+    { 0.75, -0.10, 0.62, 0.08, },
+    { 0.75, 0.06, -0.48, 0.40, },
+    { 0.72, 0.21, 0.02, -0.62, },
+    { 0.66, 0.36, 0.45, 0.43, },
+    { 0.57, 0.49, -0.62, 0.05, },
+    { 0.46, 0.60, 0.38, -0.49, },
+    { 0.33, 0.68, 0.11, 0.61, },
+    { 0.18, 0.73, -0.53, -0.33, },
+    { 0.02, 0.75, 0.60, -0.17, },
+    { -0.13, 0.74, -0.27, 0.56, },
+    { -0.46, 0.60, -0.38, -0.49, },
+    { -0.57, 0.49, 0.62, 0.05, },
+    { -0.66, 0.36, -0.45, 0.43, },
+    { -0.72, 0.21, -0.02, -0.62, },
+    { -0.75, 0.06, 0.48, 0.40, },
+    { -0.75, -0.10, -0.62, 0.08, },
+    { -0.71, -0.25, 0.35, -0.51, },
+    { -0.64, -0.40, 0.15, 0.60, },
+    { -0.54, -0.52, -0.55, -0.29, },
+    { -0.42, -0.62, 0.59, -0.21, },
+    { -0.28, -0.70, -0.24, 0.58, },
+    { -0.13, -0.74, -0.27, -0.56, },
+    { 0.02, -0.75, 0.60, 0.17, },
+    { 0.18, -0.73, -0.53, 0.33, },
+    { 0.33, -0.68, 0.11, -0.61, },
+    { 0.46, -0.60, 0.38, 0.49, },
+    { 0.57, -0.49, -0.62, -0.05, },
+    { 0.66, -0.36, 0.45, -0.43, },
+    { 0.72, -0.21, 0.02, 0.62, },
+    { 0.75, -0.06, -0.48, -0.40, },
+    { 0.75, 0.10, 0.62, -0.08, },
+    { 0.71, 0.25, -0.35, 0.51, },
+    { 0.64, 0.40, -0.15, -0.60, },
+    { 0.54, 0.52, 0.55, 0.29, },
+    { 0.42, 0.62, -0.59, 0.21, },
+    { 0.28, 0.70, 0.24, -0.58, },
+    { 0.13, 0.74, 0.27, 0.56, },
+    { -0.02, 0.75, -0.60, -0.17, },
+    { -0.18, 0.73, 0.53, -0.33, },
+    { -0.33, 0.68, -0.11, 0.61, },
+    { -0.24, 0.58, 0.28, 0.70, },
+    { -0.35, 0.51, -0.71, -0.25, },
+    { -0.45, 0.43, 0.66, -0.36, },
+    { -0.53, 0.33, -0.18, 0.73, },
+    { -0.59, 0.21, -0.42, -0.62, },
+    { -0.62, 0.08, 0.75, 0.10, },
+    { -0.62, -0.05, -0.57, 0.49, },
+    { -0.60, -0.17, 0.02, -0.75, },
+    { -0.55, -0.29, 0.54, 0.52, },
+    { -0.48, -0.40, -0.75, 0.06, },
+    { -0.38, -0.49, 0.46, -0.60, },
+    { -0.27, -0.56, 0.13, 0.74, },
+    { -0.15, -0.60, -0.64, -0.40, },
+    { -0.02, -0.62, 0.72, -0.21, },
+    { 0.11, -0.61, -0.33, 0.68, },
+    { 0.24, -0.58, -0.29, -0.70, },
+    { 0.35, -0.51, 0.71, 0.25, },
+    { 0.45, -0.43, -0.66, 0.36, },
+    { 0.53, -0.33, 0.18, -0.73, },
+    { 0.59, -0.21, 0.42, 0.62, },
+    { 0.62, -0.08, -0.75, -0.10, },
+    { 0.62, 0.05, 0.57, -0.49, },
+    { 0.60, 0.17, -0.02, 0.75, },
+    { 0.55, 0.29, -0.54, -0.52, },
+    { 0.48, 0.40, 0.75, -0.06, },
+    { 0.38, 0.49, -0.46, 0.60, },
+    { 0.27, 0.56, -0.13, -0.74, },
+    { 0.15, 0.60, 0.64, 0.40, },
+    { 0.02, 0.62, -0.72, 0.21, },
+    { -0.11, 0.61, 0.33, -0.68, },
+    { -0.38, 0.49, 0.46, 0.60, },
+    { -0.48, 0.40, -0.75, -0.06, },
+    { -0.55, 0.29, 0.54, -0.52, },
+    { -0.60, 0.17, 0.02, 0.75, },
+    { -0.62, 0.05, -0.57, -0.49, },
+    { -0.62, -0.08, 0.75, -0.10, },
+    { -0.59, -0.21, -0.42, 0.62, },
+    { -0.53, -0.33, -0.18, -0.73, },
+    { -0.45, -0.43, 0.66, 0.36, },
+    { -0.35, -0.51, -0.71, 0.25, },
+    { -0.24, -0.58, 0.28, -0.70, },
+    { -0.11, -0.61, 0.33, 0.68, },
+    { 0.02, -0.62, -0.72, -0.21, },
+    { 0.15, -0.60, 0.64, -0.40, },
+    { 0.27, -0.56, -0.13, 0.74, },
+    { 0.38, -0.49, -0.46, -0.60, },
+    { 0.48, -0.40, 0.75, 0.06, },
+    { 0.55, -0.29, -0.54, 0.52, },
+    { 0.60, -0.17, -0.02, -0.75, },
+    { 0.62, -0.05, 0.57, 0.49, },
+    { 0.62, 0.08, -0.75, 0.10, },
+    { 0.59, 0.21, 0.42, -0.62, },
+    { 0.53, 0.33, 0.18, 0.73, },
+    { 0.45, 0.43, -0.66, -0.36, },
+    { 0.35, 0.51, 0.71, -0.25, },
+    { 0.24, 0.58, -0.28, 0.70, },
+    { 0.11, 0.61, -0.33, -0.68, },
+    { -0.02, 0.62, 0.72, 0.21, },
+    { -0.15, 0.60, -0.64, 0.40, },
+    { -0.27, 0.56, 0.13, -0.74, },
+    { -0.33, 0.47, -0.11, 0.78, },
+    { -0.42, 0.40, -0.51, -0.60, },
+    { -0.49, 0.30, 0.79, 0.03, },
+    { -0.54, 0.19, -0.55, 0.57, },
+    { -0.57, 0.07, -0.05, -0.79, },
+    { -0.57, -0.05, 0.62, 0.49, },
+    { -0.55, -0.16, -0.78, 0.14, },
+    { -0.51, -0.28, 0.42, -0.67, },
+    { -0.44, -0.38, 0.22, 0.76, },
+    { -0.35, -0.46, -0.71, -0.35, },
+    { -0.25, -0.52, 0.73, -0.29, },
+    { -0.13, -0.56, -0.27, 0.74, },
+    { -0.01, -0.58, -0.37, -0.70, },
+    { 0.11, -0.57, 0.77, 0.19, },
+    { 0.22, -0.53, -0.65, 0.44, },
+    { 0.33, -0.47, 0.11, -0.78, },
+    { 0.42, -0.40, 0.51, 0.60, },
+    { 0.49, -0.30, -0.79, -0.03, },
+    { 0.54, -0.19, 0.55, -0.57, },
+    { 0.57, -0.07, 0.05, 0.79, },
+    { 0.57, 0.05, -0.62, -0.49, },
+    { 0.55, 0.16, 0.78, -0.14, },
+    { 0.51, 0.28, -0.42, 0.67, },
+    { 0.44, 0.38, -0.22, -0.76, },
+    { 0.35, 0.46, 0.71, 0.35, },
+    { 0.25, 0.52, -0.73, 0.29, },
+    { 0.13, 0.56, 0.27, -0.74, },
+    { 0.01, 0.58, 0.37, 0.70, },
+    { -0.11, 0.57, -0.77, -0.19, },
+    { -0.22, 0.53, 0.65, -0.44, },
+    { -0.25, 0.52, 0.73, 0.29, },
+    { -0.35, 0.46, -0.71, 0.35, },
+    { -0.44, 0.38, 0.22, -0.76, },
+    { -0.51, 0.28, 0.42, 0.67, },
+    { -0.55, 0.16, -0.78, -0.14, },
+    { -0.57, 0.05, 0.62, -0.49, },
+    { -0.57, -0.07, -0.05, 0.79, },
+    { -0.54, -0.19, -0.55, -0.57, },
+    { -0.49, -0.30, 0.79, -0.03, },
+    { -0.42, -0.40, -0.51, 0.60, },
+    { -0.33, -0.47, -0.11, -0.78, },
+    { -0.22, -0.53, 0.65, 0.44, },
+    { -0.11, -0.57, -0.77, 0.19, },
+    { 0.01, -0.58, 0.37, -0.70, },
+    { 0.13, -0.56, 0.27, 0.74, },
+    { 0.25, -0.52, -0.73, -0.29, },
+    { 0.35, -0.46, 0.71, -0.35, },
+    { 0.44, -0.38, -0.22, 0.76, },
+    { 0.51, -0.28, -0.42, -0.67, },
+    { 0.55, -0.16, 0.78, 0.14, },
+    { 0.57, -0.05, -0.62, 0.49, },
+    { 0.57, 0.07, 0.05, -0.79, },
+    { 0.54, 0.19, 0.55, 0.57, },
+    { 0.49, 0.30, -0.79, 0.03, },
+    { 0.42, 0.40, 0.51, -0.60, },
+    { 0.33, 0.47, 0.11, 0.78, },
+    { 0.22, 0.53, -0.65, -0.44, },
+    { 0.11, 0.57, 0.77, -0.19, },
+    { -0.01, 0.58, -0.37, 0.70, },
+    { -0.13, 0.56, -0.27, -0.74, },
+    { -0.27, 0.41, 0.13, 0.83, },
+    { -0.35, 0.35, -0.71, -0.46, },
+    { -0.41, 0.27, 0.81, -0.22, },
+    { -0.46, 0.17, -0.38, 0.75, },
+    { -0.49, 0.07, -0.30, -0.79, },
+    { -0.49, -0.03, 0.79, 0.30, },
+    { -0.48, -0.13, -0.75, 0.38, },
+    { -0.44, -0.23, 0.22, -0.82, },
+    { -0.38, -0.31, 0.46, 0.71, },
+    { -0.31, -0.38, -0.83, -0.13, },
+    { -0.22, -0.44, 0.65, -0.53, },
+    { -0.13, -0.48, -0.04, 0.84, },
+    { -0.02, -0.49, -0.60, -0.60, },
+    { 0.08, -0.49, 0.84, -0.05, },
+    { 0.18, -0.46, -0.53, 0.66, },
+    { 0.27, -0.41, -0.13, -0.83, },
+    { 0.35, -0.35, 0.71, 0.46, },
+    { 0.41, -0.27, -0.81, 0.22, },
+    { 0.46, -0.17, 0.38, -0.75, },
+    { 0.49, -0.07, 0.30, 0.79, },
+    { 0.49, 0.03, -0.79, -0.30, },
+    { 0.48, 0.13, 0.75, -0.38, },
+    { 0.44, 0.23, -0.22, 0.82, },
+    { 0.38, 0.31, -0.46, -0.71, },
+    { 0.31, 0.38, 0.83, 0.13, },
+    { 0.22, 0.44, -0.65, 0.53, },
+    { 0.12, 0.48, 0.04, -0.84, },
+    { 0.02, 0.49, 0.60, 0.60, },
+    { -0.08, 0.49, -0.84, 0.05, },
+    { -0.18, 0.46, 0.53, -0.66, },
+    { -0.22, 0.44, 0.65, 0.53, },
+    { -0.31, 0.38, -0.83, 0.13, },
+    { -0.38, 0.31, 0.46, -0.71, },
+    { -0.44, 0.23, 0.22, 0.82, },
+    { -0.48, 0.13, -0.75, -0.38, },
+    { -0.49, 0.03, 0.79, -0.30, },
+    { -0.49, -0.07, -0.30, 0.79, },
+    { -0.46, -0.17, -0.38, -0.75, },
+    { -0.41, -0.27, 0.81, 0.22, },
+    { -0.35, -0.35, -0.71, 0.46, },
+    { -0.27, -0.41, 0.13, -0.83, },
+    { -0.18, -0.46, 0.53, 0.66, },
+    { -0.08, -0.49, -0.84, -0.05, },
+    { 0.02, -0.49, 0.60, -0.60, },
+    { 0.12, -0.48, 0.04, 0.84, },
+    { 0.22, -0.44, -0.65, -0.53, },
+    { 0.31, -0.38, 0.83, -0.13, },
+    { 0.38, -0.31, -0.46, 0.71, },
+    { 0.44, -0.23, -0.22, -0.82, },
+    { 0.48, -0.13, 0.75, 0.38, },
+    { 0.49, -0.03, -0.79, 0.30, },
+    { 0.49, 0.07, 0.30, -0.79, },
+    { 0.46, 0.17, 0.38, 0.75, },
+    { 0.41, 0.27, -0.81, -0.22, },
+    { 0.35, 0.35, 0.71, -0.46, },
+    { 0.27, 0.41, -0.13, 0.83, },
+    { 0.18, 0.46, -0.53, -0.66, },
+    { 0.08, 0.49, 0.84, 0.05, },
+    { -0.02, 0.49, -0.60, 0.60, },
+    { -0.12, 0.48, -0.04, -0.84, },
+    { -0.15, 0.28, -0.64, 0.67, },
+    { -0.20, 0.24, -0.07, -0.92, },
+    { -0.25, 0.19, 0.73, 0.57, },
+    { -0.28, 0.14, -0.91, 0.16, },
+    { -0.30, 0.07, 0.49, -0.79, },
+    { -0.31, 0.01, 0.26, 0.89, },
+    { -0.31, -0.06, -0.83, -0.40, },
+    { -0.29, -0.12, 0.86, -0.35, },
+    { -0.26, -0.18, -0.31, 0.87, },
+    { -0.22, -0.23, -0.44, -0.82, },
+    { -0.16, -0.27, 0.90, 0.22, },
+    { -0.11, -0.29, -0.77, 0.52, },
+    { -0.04, -0.31, 0.12, -0.92, },
+    { 0.02, -0.31, 0.60, 0.71, },
+    { 0.09, -0.30, -0.93, -0.03, },
+    { 0.15, -0.28, 0.64, -0.67, },
+    { 0.20, -0.24, 0.07, 0.92, },
+    { 0.25, -0.19, -0.73, -0.57, },
+    { 0.28, -0.14, 0.91, -0.16, },
+    { 0.30, -0.07, -0.49, 0.79, },
+    { 0.31, -0.01, -0.26, -0.89, },
+    { 0.31, 0.06, 0.83, 0.40, },
+    { 0.29, 0.12, -0.86, 0.35, },
+    { 0.26, 0.18, 0.31, -0.87, },
+    { 0.22, 0.23, 0.44, 0.82, },
+    { 0.16, 0.27, -0.90, -0.22, },
+    { 0.11, 0.29, 0.77, -0.52, },
+    { 0.04, 0.31, -0.12, 0.92, },
+    { -0.02, 0.31, -0.60, -0.71, },
+    { -0.09, 0.30, 0.93, 0.03, },
+    { -0.22, 0.23, -0.44, 0.82, },
+    { -0.26, 0.18, -0.31, -0.87, },
+    { -0.29, 0.12, 0.86, 0.35, },
+    { -0.31, 0.06, -0.83, 0.40, },
+    { -0.31, -0.01, 0.26, -0.89, },
+    { -0.30, -0.07, 0.49, 0.79, },
+    { -0.28, -0.14, -0.91, -0.16, },
+    { -0.25, -0.19, 0.73, -0.57, },
+    { -0.20, -0.24, -0.07, 0.92, },
+    { -0.15, -0.28, -0.64, -0.67, },
+    { -0.09, -0.30, 0.93, -0.03, },
+    { -0.02, -0.31, -0.60, 0.71, },
+    { 0.04, -0.31, -0.13, -0.92, },
+    { 0.11, -0.29, 0.77, 0.52, },
+    { 0.16, -0.27, -0.90, 0.22, },
+    { 0.22, -0.23, 0.44, -0.82, },
+    { 0.26, -0.18, 0.31, 0.87, },
+    { 0.29, -0.12, -0.86, -0.35, },
+    { 0.31, -0.06, 0.83, -0.40, },
+    { 0.31, 0.01, -0.26, 0.89, },
+    { 0.30, 0.07, -0.49, -0.79, },
+    { 0.28, 0.14, 0.91, 0.16, },
+    { 0.25, 0.19, -0.73, 0.57, },
+    { 0.20, 0.24, 0.07, -0.92, },
+    { 0.15, 0.28, 0.64, 0.67, },
+    { 0.09, 0.30, -0.93, 0.03, },
+    { 0.02, 0.31, 0.60, -0.71, },
+    { -0.04, 0.31, 0.13, 0.92, },
+    { -0.11, 0.29, -0.77, -0.52, },
+    { -0.16, 0.27, 0.90, -0.22, },
+};
+
+static const struct line_info line_table[LINE_COUNT] =
+{
+    { 0, 1, 0, },
+    { 0, 29, 0, },
+    { 0, 148, 0, },
+    { 0, 176, 0, },
+    { 1, 2, 0, },
+    { 1, 149, 0, },
+    { 1, 177, 0, },
+    { 2, 3, 0, },
+    { 2, 120, 0, },
+    { 2, 178, 0, },
+    { 3, 4, 0, },
+    { 3, 121, 0, },
+    { 3, 179, 0, },
+    { 4, 5, 0, },
+    { 4, 122, 0, },
+    { 4, 150, 0, },
+    { 5, 6, 0, },
+    { 5, 123, 0, },
+    { 5, 151, 0, },
+    { 6, 7, 0, },
+    { 6, 124, 0, },
+    { 6, 152, 0, },
+    { 7, 8, 0, },
+    { 7, 125, 0, },
+    { 7, 153, 0, },
+    { 8, 9, 0, },
+    { 8, 126, 0, },
+    { 8, 154, 0, },
+    { 9, 10, 0, },
+    { 9, 127, 0, },
+    { 9, 155, 0, },
+    { 10, 11, 0, },
+    { 10, 128, 0, },
+    { 10, 156, 0, },
+    { 11, 12, 0, },
+    { 11, 129, 0, },
+    { 11, 157, 0, },
+    { 12, 13, 0, },
+    { 12, 130, 0, },
+    { 12, 158, 0, },
+    { 13, 14, 0, },
+    { 13, 131, 0, },
+    { 13, 159, 0, },
+    { 14, 15, 0, },
+    { 14, 132, 0, },
+    { 14, 160, 0, },
+    { 15, 16, 0, },
+    { 15, 133, 0, },
+    { 15, 161, 0, },
+    { 16, 17, 0, },
+    { 16, 134, 0, },
+    { 16, 162, 0, },
+    { 17, 18, 0, },
+    { 17, 135, 0, },
+    { 17, 163, 0, },
+    { 18, 19, 0, },
+    { 18, 136, 0, },
+    { 18, 164, 0, },
+    { 19, 20, 0, },
+    { 19, 137, 0, },
+    { 19, 165, 0, },
+    { 20, 21, 0, },
+    { 20, 138, 0, },
+    { 20, 166, 0, },
+    { 21, 22, 0, },
+    { 21, 139, 0, },
+    { 21, 167, 0, },
+    { 22, 23, 0, },
+    { 22, 140, 0, },
+    { 22, 168, 0, },
+    { 23, 24, 0, },
+    { 23, 141, 0, },
+    { 23, 169, 0, },
+    { 24, 25, 0, },
+    { 24, 142, 0, },
+    { 24, 170, 0, },
+    { 25, 26, 0, },
+    { 25, 143, 0, },
+    { 25, 171, 0, },
+    { 26, 27, 0, },
+    { 26, 144, 0, },
+    { 26, 172, 0, },
+    { 27, 28, 0, },
+    { 27, 145, 0, },
+    { 27, 173, 0, },
+    { 28, 29, 0, },
+    { 28, 146, 0, },
+    { 28, 174, 0, },
+    { 29, 147, 0, },
+    { 29, 175, 0, },
+    { 30, 123, 0, },
+    { 30, 150, 0, },
+    { 30, 240, 0, },
+    { 30, 292, 0, },
+    { 31, 124, 0, },
+    { 31, 151, 0, },
+    { 31, 241, 0, },
+    { 31, 293, 0, },
+    { 32, 125, 0, },
+    { 32, 152, 0, },
+    { 32, 242, 0, },
+    { 32, 294, 0, },
+    { 33, 126, 0, },
+    { 33, 153, 0, },
+    { 33, 243, 0, },
+    { 33, 295, 0, },
+    { 34, 127, 0, },
+    { 34, 154, 0, },
+    { 34, 244, 0, },
+    { 34, 296, 0, },
+    { 35, 128, 0, },
+    { 35, 155, 0, },
+    { 35, 245, 0, },
+    { 35, 297, 0, },
+    { 36, 129, 0, },
+    { 36, 156, 0, },
+    { 36, 246, 0, },
+    { 36, 298, 0, },
+    { 37, 130, 0, },
+    { 37, 157, 0, },
+    { 37, 247, 0, },
+    { 37, 299, 0, },
+    { 38, 131, 0, },
+    { 38, 158, 0, },
+    { 38, 248, 0, },
+    { 38, 270, 0, },
+    { 39, 132, 0, },
+    { 39, 159, 0, },
+    { 39, 249, 0, },
+    { 39, 271, 0, },
+    { 40, 133, 0, },
+    { 40, 160, 0, },
+    { 40, 250, 0, },
+    { 40, 272, 0, },
+    { 41, 134, 0, },
+    { 41, 161, 0, },
+    { 41, 251, 0, },
+    { 41, 273, 0, },
+    { 42, 135, 0, },
+    { 42, 162, 0, },
+    { 42, 252, 0, },
+    { 42, 274, 0, },
+    { 43, 136, 0, },
+    { 43, 163, 0, },
+    { 43, 253, 0, },
+    { 43, 275, 0, },
+    { 44, 137, 0, },
+    { 44, 164, 0, },
+    { 44, 254, 0, },
+    { 44, 276, 0, },
+    { 45, 138, 1, },
+    { 45, 165, 1, },
+    { 45, 255, 1, },
+    { 45, 277, 1, },
+    { 46, 139, 1, },
+    { 46, 166, 1, },
+    { 46, 256, 1, },
+    { 46, 278, 1, },
+    { 47, 140, 1, },
+    { 47, 167, 1, },
+    { 47, 257, 1, },
+    { 47, 279, 1, },
+    { 48, 141, 1, },
+    { 48, 168, 1, },
+    { 48, 258, 1, },
+    { 48, 280, 1, },
+    { 49, 142, 1, },
+    { 49, 169, 1, },
+    { 49, 259, 1, },
+    { 49, 281, 1, },
+    { 50, 143, 1, },
+    { 50, 170, 1, },
+    { 50, 260, 1, },
+    { 50, 282, 1, },
+    { 51, 144, 1, },
+    { 51, 171, 1, },
+    { 51, 261, 1, },
+    { 51, 283, 1, },
+    { 52, 145, 1, },
+    { 52, 172, 1, },
+    { 52, 262, 1, },
+    { 52, 284, 1, },
+    { 53, 146, 1, },
+    { 53, 173, 1, },
+    { 53, 263, 1, },
+    { 53, 285, 1, },
+    { 54, 147, 1, },
+    { 54, 174, 1, },
+    { 54, 264, 1, },
+    { 54, 286, 1, },
+    { 55, 148, 1, },
+    { 55, 175, 1, },
+    { 55, 265, 1, },
+    { 55, 287, 1, },
+    { 56, 149, 1, },
+    { 56, 176, 1, },
+    { 56, 266, 1, },
+    { 56, 288, 1, },
+    { 57, 120, 1, },
+    { 57, 177, 1, },
+    { 57, 267, 1, },
+    { 57, 289, 1, },
+    { 58, 121, 1, },
+    { 58, 178, 1, },
+    { 58, 268, 1, },
+    { 58, 290, 1, },
+    { 59, 122, 1, },
+    { 59, 179, 1, },
+    { 59, 269, 1, },
+    { 59, 291, 1, },
+    { 60, 420, 1, },
+    { 60, 478, 1, },
+    { 60, 567, 1, },
+    { 60, 570, 1, },
+    { 61, 421, 1, },
+    { 61, 479, 1, },
+    { 61, 568, 1, },
+    { 61, 571, 1, },
+    { 62, 422, 1, },
+    { 62, 450, 1, },
+    { 62, 569, 1, },
+    { 62, 572, 1, },
+    { 63, 423, 1, },
+    { 63, 451, 1, },
+    { 63, 540, 1, },
+    { 63, 573, 1, },
+    { 64, 424, 1, },
+    { 64, 452, 1, },
+    { 64, 541, 1, },
+    { 64, 574, 1, },
+    { 65, 425, 1, },
+    { 65, 453, 1, },
+    { 65, 542, 1, },
+    { 65, 575, 1, },
+    { 66, 426, 1, },
+    { 66, 454, 1, },
+    { 66, 543, 1, },
+    { 66, 576, 1, },
+    { 67, 427, 1, },
+    { 67, 455, 1, },
+    { 67, 544, 1, },
+    { 67, 577, 1, },
+    { 68, 428, 1, },
+    { 68, 456, 1, },
+    { 68, 545, 1, },
+    { 68, 578, 1, },
+    { 69, 429, 1, },
+    { 69, 457, 1, },
+    { 69, 546, 1, },
+    { 69, 579, 1, },
+    { 70, 430, 1, },
+    { 70, 458, 1, },
+    { 70, 547, 1, },
+    { 70, 580, 1, },
+    { 71, 431, 1, },
+    { 71, 459, 1, },
+    { 71, 548, 1, },
+    { 71, 581, 1, },
+    { 72, 432, 1, },
+    { 72, 460, 1, },
+    { 72, 549, 1, },
+    { 72, 582, 1, },
+    { 73, 433, 1, },
+    { 73, 461, 1, },
+    { 73, 550, 1, },
+    { 73, 583, 1, },
+    { 74, 434, 1, },
+    { 74, 462, 1, },
+    { 74, 551, 1, },
+    { 74, 584, 1, },
+    { 75, 435, 1, },
+    { 75, 463, 1, },
+    { 75, 552, 1, },
+    { 75, 585, 1, },
+    { 76, 436, 1, },
+    { 76, 464, 1, },
+    { 76, 553, 1, },
+    { 76, 586, 1, },
+    { 77, 437, 1, },
+    { 77, 465, 1, },
+    { 77, 554, 1, },
+    { 77, 587, 1, },
+    { 78, 438, 1, },
+    { 78, 466, 1, },
+    { 78, 555, 1, },
+    { 78, 588, 1, },
+    { 79, 439, 1, },
+    { 79, 467, 1, },
+    { 79, 556, 1, },
+    { 79, 589, 1, },
+    { 80, 440, 1, },
+    { 80, 468, 1, },
+    { 80, 557, 1, },
+    { 80, 590, 1, },
+    { 81, 441, 1, },
+    { 81, 469, 1, },
+    { 81, 558, 1, },
+    { 81, 591, 1, },
+    { 82, 442, 1, },
+    { 82, 470, 1, },
+    { 82, 559, 2, },
+    { 82, 592, 2, },
+    { 83, 443, 2, },
+    { 83, 471, 2, },
+    { 83, 560, 2, },
+    { 83, 593, 2, },
+    { 84, 444, 2, },
+    { 84, 472, 2, },
+    { 84, 561, 2, },
+    { 84, 594, 2, },
+    { 85, 445, 2, },
+    { 85, 473, 2, },
+    { 85, 562, 2, },
+    { 85, 595, 2, },
+    { 86, 446, 2, },
+    { 86, 474, 2, },
+    { 86, 563, 2, },
+    { 86, 596, 2, },
+    { 87, 447, 2, },
+    { 87, 475, 2, },
+    { 87, 564, 2, },
+    { 87, 597, 2, },
+    { 88, 448, 2, },
+    { 88, 476, 2, },
+    { 88, 565, 2, },
+    { 88, 598, 2, },
+    { 89, 449, 2, },
+    { 89, 477, 2, },
+    { 89, 566, 2, },
+    { 89, 599, 2, },
+    { 90, 101, 2, },
+    { 90, 109, 2, },
+    { 90, 562, 2, },
+    { 90, 584, 2, },
+    { 91, 102, 2, },
+    { 91, 110, 2, },
+    { 91, 563, 2, },
+    { 91, 585, 2, },
+    { 92, 103, 2, },
+    { 92, 111, 2, },
+    { 92, 564, 2, },
+    { 92, 586, 2, },
+    { 93, 104, 2, },
+    { 93, 112, 2, },
+    { 93, 565, 2, },
+    { 93, 587, 2, },
+    { 94, 105, 2, },
+    { 94, 113, 2, },
+    { 94, 566, 2, },
+    { 94, 588, 2, },
+    { 95, 106, 2, },
+    { 95, 114, 2, },
+    { 95, 567, 2, },
+    { 95, 589, 2, },
+    { 96, 107, 2, },
+    { 96, 115, 2, },
+    { 96, 568, 2, },
+    { 96, 590, 2, },
+    { 97, 108, 2, },
+    { 97, 116, 2, },
+    { 97, 569, 2, },
+    { 97, 591, 2, },
+    { 98, 109, 2, },
+    { 98, 117, 2, },
+    { 98, 540, 2, },
+    { 98, 592, 2, },
+    { 99, 110, 2, },
+    { 99, 118, 2, },
+    { 99, 541, 2, },
+    { 99, 593, 2, },
+    { 100, 111, 2, },
+    { 100, 119, 2, },
+    { 100, 542, 2, },
+    { 100, 594, 2, },
+    { 101, 112, 2, },
+    { 101, 543, 2, },
+    { 101, 595, 2, },
+    { 102, 113, 2, },
+    { 102, 544, 2, },
+    { 102, 596, 2, },
+    { 103, 114, 2, },
+    { 103, 545, 2, },
+    { 103, 597, 2, },
+    { 104, 115, 2, },
+    { 104, 546, 2, },
+    { 104, 598, 2, },
+    { 105, 116, 2, },
+    { 105, 547, 2, },
+    { 105, 599, 2, },
+    { 106, 117, 2, },
+    { 106, 548, 2, },
+    { 106, 570, 2, },
+    { 107, 118, 2, },
+    { 107, 549, 2, },
+    { 107, 571, 2, },
+    { 108, 119, 2, },
+    { 108, 550, 2, },
+    { 108, 572, 2, },
+    { 109, 551, 2, },
+    { 109, 573, 2, },
+    { 110, 552, 2, },
+    { 110, 574, 2, },
+    { 111, 553, 2, },
+    { 111, 575, 2, },
+    { 112, 554, 2, },
+    { 112, 576, 2, },
+    { 113, 555, 2, },
+    { 113, 577, 2, },
+    { 114, 556, 2, },
+    { 114, 578, 2, },
+    { 115, 557, 2, },
+    { 115, 579, 2, },
+    { 116, 558, 2, },
+    { 116, 580, 2, },
+    { 117, 559, 2, },
+    { 117, 581, 2, },
+    { 118, 560, 2, },
+    { 118, 582, 2, },
+    { 119, 561, 2, },
+    { 119, 583, 2, },
+    { 120, 150, 2, },
+    { 120, 232, 2, },
+    { 121, 151, 2, },
+    { 121, 233, 2, },
+    { 122, 152, 2, },
+    { 122, 234, 2, },
+    { 123, 153, 2, },
+    { 123, 235, 2, },
+    { 124, 154, 2, },
+    { 124, 236, 2, },
+    { 125, 155, 2, },
+    { 125, 237, 2, },
+    { 126, 156, 2, },
+    { 126, 238, 2, },
+    { 127, 157, 2, },
+    { 127, 239, 2, },
+    { 128, 158, 2, },
+    { 128, 210, 2, },
+    { 129, 159, 2, },
+    { 129, 211, 2, },
+    { 130, 160, 2, },
+    { 130, 212, 2, },
+    { 131, 161, 2, },
+    { 131, 213, 2, },
+    { 132, 162, 2, },
+    { 132, 214, 2, },
+    { 133, 163, 2, },
+    { 133, 215, 2, },
+    { 134, 164, 2, },
+    { 134, 216, 2, },
+    { 135, 165, 3, },
+    { 135, 217, 3, },
+    { 136, 166, 3, },
+    { 136, 218, 3, },
+    { 137, 167, 3, },
+    { 137, 219, 3, },
+    { 138, 168, 3, },
+    { 138, 220, 3, },
+    { 139, 169, 3, },
+    { 139, 221, 3, },
+    { 140, 170, 3, },
+    { 140, 222, 3, },
+    { 141, 171, 3, },
+    { 141, 223, 3, },
+    { 142, 172, 3, },
+    { 142, 224, 3, },
+    { 143, 173, 3, },
+    { 143, 225, 3, },
+    { 144, 174, 3, },
+    { 144, 226, 3, },
+    { 145, 175, 3, },
+    { 145, 227, 3, },
+    { 146, 176, 3, },
+    { 146, 228, 3, },
+    { 147, 177, 3, },
+    { 147, 229, 3, },
+    { 148, 178, 3, },
+    { 148, 230, 3, },
+    { 149, 179, 3, },
+    { 149, 231, 3, },
+    { 150, 207, 3, },
+    { 151, 208, 3, },
+    { 152, 209, 3, },
+    { 153, 180, 3, },
+    { 154, 181, 3, },
+    { 155, 182, 3, },
+    { 156, 183, 3, },
+    { 157, 184, 3, },
+    { 158, 185, 3, },
+    { 159, 186, 3, },
+    { 160, 187, 3, },
+    { 161, 188, 3, },
+    { 162, 189, 3, },
+    { 163, 190, 3, },
+    { 164, 191, 3, },
+    { 165, 192, 3, },
+    { 166, 193, 3, },
+    { 167, 194, 3, },
+    { 168, 195, 3, },
+    { 169, 196, 3, },
+    { 170, 197, 3, },
+    { 171, 198, 3, },
+    { 172, 199, 3, },
+    { 173, 200, 3, },
+    { 174, 201, 3, },
+    { 175, 202, 3, },
+    { 176, 203, 3, },
+    { 177, 204, 3, },
+    { 178, 205, 3, },
+    { 179, 206, 3, },
+    { 180, 237, 3, },
+    { 180, 240, 3, },
+    { 180, 300, 3, },
+    { 181, 238, 3, },
+    { 181, 241, 3, },
+    { 181, 301, 3, },
+    { 182, 239, 3, },
+    { 182, 242, 3, },
+    { 182, 302, 3, },
+    { 183, 210, 3, },
+    { 183, 243, 3, },
+    { 183, 303, 3, },
+    { 184, 211, 3, },
+    { 184, 244, 3, },
+    { 184, 304, 3, },
+    { 185, 212, 3, },
+    { 185, 245, 3, },
+    { 185, 305, 3, },
+    { 186, 213, 3, },
+    { 186, 246, 3, },
+    { 186, 306, 3, },
+    { 187, 214, 3, },
+    { 187, 247, 3, },
+    { 187, 307, 3, },
+    { 188, 215, 3, },
+    { 188, 248, 3, },
+    { 188, 308, 3, },
+    { 189, 216, 3, },
+    { 189, 249, 3, },
+    { 189, 309, 3, },
+    { 190, 217, 3, },
+    { 190, 250, 3, },
+    { 190, 310, 3, },
+    { 191, 218, 3, },
+    { 191, 251, 3, },
+    { 191, 311, 3, },
+    { 192, 219, 3, },
+    { 192, 252, 3, },
+    { 192, 312, 3, },
+    { 193, 220, 3, },
+    { 193, 253, 3, },
+    { 193, 313, 3, },
+    { 194, 221, 3, },
+    { 194, 254, 3, },
+    { 194, 314, 3, },
+    { 195, 222, 3, },
+    { 195, 255, 3, },
+    { 195, 315, 3, },
+    { 196, 223, 3, },
+    { 196, 256, 3, },
+    { 196, 316, 3, },
+    { 197, 224, 3, },
+    { 197, 257, 3, },
+    { 197, 317, 3, },
+    { 198, 225, 3, },
+    { 198, 258, 3, },
+    { 198, 318, 3, },
+    { 199, 226, 3, },
+    { 199, 259, 3, },
+    { 199, 319, 3, },
+    { 200, 227, 3, },
+    { 200, 260, 3, },
+    { 200, 320, 3, },
+    { 201, 228, 3, },
+    { 201, 261, 3, },
+    { 201, 321, 3, },
+    { 202, 229, 3, },
+    { 202, 262, 3, },
+    { 202, 322, 3, },
+    { 203, 230, 3, },
+    { 203, 263, 3, },
+    { 203, 323, 3, },
+    { 204, 231, 3, },
+    { 204, 264, 3, },
+    { 204, 324, 3, },
+    { 205, 232, 3, },
+    { 205, 265, 3, },
+    { 205, 325, 3, },
+    { 206, 233, 3, },
+    { 206, 266, 3, },
+    { 206, 326, 3, },
+    { 207, 234, 3, },
+    { 207, 267, 3, },
+    { 207, 327, 3, },
+    { 208, 235, 3, },
+    { 208, 268, 3, },
+    { 208, 328, 3, },
+    { 209, 236, 3, },
+    { 209, 269, 3, },
+    { 209, 329, 3, },
+    { 210, 270, 4, },
+    { 210, 330, 4, },
+    { 211, 271, 4, },
+    { 211, 331, 4, },
+    { 212, 272, 4, },
+    { 212, 332, 4, },
+    { 213, 273, 4, },
+    { 213, 333, 4, },
+    { 214, 274, 4, },
+    { 214, 334, 4, },
+    { 215, 275, 4, },
+    { 215, 335, 4, },
+    { 216, 276, 4, },
+    { 216, 336, 4, },
+    { 217, 277, 4, },
+    { 217, 337, 4, },
+    { 218, 278, 4, },
+    { 218, 338, 4, },
+    { 219, 279, 4, },
+    { 219, 339, 4, },
+    { 220, 280, 4, },
+    { 220, 340, 4, },
+    { 221, 281, 4, },
+    { 221, 341, 4, },
+    { 222, 282, 4, },
+    { 222, 342, 4, },
+    { 223, 283, 4, },
+    { 223, 343, 4, },
+    { 224, 284, 4, },
+    { 224, 344, 4, },
+    { 225, 285, 4, },
+    { 225, 345, 4, },
+    { 226, 286, 4, },
+    { 226, 346, 4, },
+    { 227, 287, 4, },
+    { 227, 347, 4, },
+    { 228, 288, 4, },
+    { 228, 348, 4, },
+    { 229, 289, 4, },
+    { 229, 349, 4, },
+    { 230, 290, 4, },
+    { 230, 350, 4, },
+    { 231, 291, 4, },
+    { 231, 351, 4, },
+    { 232, 292, 4, },
+    { 232, 352, 4, },
+    { 233, 293, 4, },
+    { 233, 353, 4, },
+    { 234, 294, 4, },
+    { 234, 354, 4, },
+    { 235, 295, 4, },
+    { 235, 355, 4, },
+    { 236, 296, 4, },
+    { 236, 356, 4, },
+    { 237, 297, 4, },
+    { 237, 357, 4, },
+    { 238, 298, 4, },
+    { 238, 358, 4, },
+    { 239, 299, 4, },
+    { 239, 359, 4, },
+    { 240, 327, 4, },
+    { 240, 416, 4, },
+    { 241, 328, 4, },
+    { 241, 417, 4, },
+    { 242, 329, 4, },
+    { 242, 418, 4, },
+    { 243, 300, 4, },
+    { 243, 419, 4, },
+    { 244, 301, 4, },
+    { 244, 390, 4, },
+    { 245, 302, 4, },
+    { 245, 391, 4, },
+    { 246, 303, 4, },
+    { 246, 392, 4, },
+    { 247, 304, 4, },
+    { 247, 393, 4, },
+    { 248, 305, 4, },
+    { 248, 394, 4, },
+    { 249, 306, 4, },
+    { 249, 395, 4, },
+    { 250, 307, 4, },
+    { 250, 396, 4, },
+    { 251, 308, 4, },
+    { 251, 397, 4, },
+    { 252, 309, 4, },
+    { 252, 398, 4, },
+    { 253, 310, 4, },
+    { 253, 399, 4, },
+    { 254, 311, 4, },
+    { 254, 400, 4, },
+    { 255, 312, 4, },
+    { 255, 401, 4, },
+    { 256, 313, 4, },
+    { 256, 402, 4, },
+    { 257, 314, 4, },
+    { 257, 403, 4, },
+    { 258, 315, 4, },
+    { 258, 404, 4, },
+    { 259, 316, 4, },
+    { 259, 405, 4, },
+    { 260, 317, 4, },
+    { 260, 406, 4, },
+    { 261, 318, 4, },
+    { 261, 407, 4, },
+    { 262, 319, 4, },
+    { 262, 408, 4, },
+    { 263, 320, 4, },
+    { 263, 409, 4, },
+    { 264, 321, 4, },
+    { 264, 410, 4, },
+    { 265, 322, 4, },
+    { 265, 411, 4, },
+    { 266, 323, 4, },
+    { 266, 412, 4, },
+    { 267, 324, 4, },
+    { 267, 413, 4, },
+    { 268, 325, 4, },
+    { 268, 414, 4, },
+    { 269, 326, 4, },
+    { 269, 415, 4, },
+    { 270, 333, 4, },
+    { 270, 364, 4, },
+    { 271, 334, 4, },
+    { 271, 365, 4, },
+    { 272, 335, 4, },
+    { 272, 366, 4, },
+    { 273, 336, 4, },
+    { 273, 367, 4, },
+    { 274, 337, 4, },
+    { 274, 368, 4, },
+    { 275, 338, 4, },
+    { 275, 369, 4, },
+    { 276, 339, 4, },
+    { 276, 370, 4, },
+    { 277, 340, 4, },
+    { 277, 371, 4, },
+    { 278, 341, 4, },
+    { 278, 372, 4, },
+    { 279, 342, 4, },
+    { 279, 373, 4, },
+    { 280, 343, 4, },
+    { 280, 374, 4, },
+    { 281, 344, 4, },
+    { 281, 375, 4, },
+    { 282, 345, 4, },
+    { 282, 376, 4, },
+    { 283, 346, 4, },
+    { 283, 377, 4, },
+    { 284, 347, 4, },
+    { 284, 378, 4, },
+    { 285, 348, 5, },
+    { 285, 379, 5, },
+    { 286, 349, 5, },
+    { 286, 380, 5, },
+    { 287, 350, 5, },
+    { 287, 381, 5, },
+    { 288, 351, 5, },
+    { 288, 382, 5, },
+    { 289, 352, 5, },
+    { 289, 383, 5, },
+    { 290, 353, 5, },
+    { 290, 384, 5, },
+    { 291, 354, 5, },
+    { 291, 385, 5, },
+    { 292, 355, 5, },
+    { 292, 386, 5, },
+    { 293, 356, 5, },
+    { 293, 387, 5, },
+    { 294, 357, 5, },
+    { 294, 388, 5, },
+    { 295, 358, 5, },
+    { 295, 389, 5, },
+    { 296, 359, 5, },
+    { 296, 360, 5, },
+    { 297, 330, 5, },
+    { 297, 361, 5, },
+    { 298, 331, 5, },
+    { 298, 362, 5, },
+    { 299, 332, 5, },
+    { 299, 363, 5, },
+    { 300, 330, 5, },
+    { 300, 479, 5, },
+    { 301, 331, 5, },
+    { 301, 450, 5, },
+    { 302, 332, 5, },
+    { 302, 451, 5, },
+    { 303, 333, 5, },
+    { 303, 452, 5, },
+    { 304, 334, 5, },
+    { 304, 453, 5, },
+    { 305, 335, 5, },
+    { 305, 454, 5, },
+    { 306, 336, 5, },
+    { 306, 455, 5, },
+    { 307, 337, 5, },
+    { 307, 456, 5, },
+    { 308, 338, 5, },
+    { 308, 457, 5, },
+    { 309, 339, 5, },
+    { 309, 458, 5, },
+    { 310, 340, 5, },
+    { 310, 459, 5, },
+    { 311, 341, 5, },
+    { 311, 460, 5, },
+    { 312, 342, 5, },
+    { 312, 461, 5, },
+    { 313, 343, 5, },
+    { 313, 462, 5, },
+    { 314, 344, 5, },
+    { 314, 463, 5, },
+    { 315, 345, 5, },
+    { 315, 464, 5, },
+    { 316, 346, 5, },
+    { 316, 465, 5, },
+    { 317, 347, 5, },
+    { 317, 466, 5, },
+    { 318, 348, 5, },
+    { 318, 467, 5, },
+    { 319, 349, 5, },
+    { 319, 468, 5, },
+    { 320, 350, 5, },
+    { 320, 469, 5, },
+    { 321, 351, 5, },
+    { 321, 470, 5, },
+    { 322, 352, 5, },
+    { 322, 471, 5, },
+    { 323, 353, 5, },
+    { 323, 472, 5, },
+    { 324, 354, 5, },
+    { 324, 473, 5, },
+    { 325, 355, 5, },
+    { 325, 474, 5, },
+    { 326, 356, 5, },
+    { 326, 475, 5, },
+    { 327, 357, 5, },
+    { 327, 476, 5, },
+    { 328, 358, 5, },
+    { 328, 477, 5, },
+    { 329, 359, 5, },
+    { 329, 478, 5, },
+    { 330, 421, 5, },
+    { 331, 422, 5, },
+    { 332, 423, 5, },
+    { 333, 424, 5, },
+    { 334, 425, 5, },
+    { 335, 426, 5, },
+    { 336, 427, 5, },
+    { 337, 428, 5, },
+    { 338, 429, 5, },
+    { 339, 430, 5, },
+    { 340, 431, 5, },
+    { 341, 432, 5, },
+    { 342, 433, 5, },
+    { 343, 434, 5, },
+    { 344, 435, 5, },
+    { 345, 436, 5, },
+    { 346, 437, 5, },
+    { 347, 438, 5, },
+    { 348, 439, 5, },
+    { 349, 440, 5, },
+    { 350, 441, 5, },
+    { 351, 442, 5, },
+    { 352, 443, 5, },
+    { 353, 444, 5, },
+    { 354, 445, 5, },
+    { 355, 446, 5, },
+    { 356, 447, 5, },
+    { 357, 448, 5, },
+    { 358, 449, 5, },
+    { 359, 420, 5, },
+    { 360, 390, 5, },
+    { 360, 447, 5, },
+    { 360, 480, 5, },
+    { 361, 391, 5, },
+    { 361, 448, 5, },
+    { 361, 481, 5, },
+    { 362, 392, 5, },
+    { 362, 449, 5, },
+    { 362, 482, 5, },
+    { 363, 393, 5, },
+    { 363, 420, 5, },
+    { 363, 483, 5, },
+    { 364, 394, 5, },
+    { 364, 421, 5, },
+    { 364, 484, 5, },
+    { 365, 395, 5, },
+    { 365, 422, 5, },
+    { 365, 485, 5, },
+    { 366, 396, 5, },
+    { 366, 423, 5, },
+    { 366, 486, 5, },
+    { 367, 397, 5, },
+    { 367, 424, 5, },
+    { 367, 487, 5, },
+    { 368, 398, 5, },
+    { 368, 425, 5, },
+    { 368, 488, 5, },
+    { 369, 399, 5, },
+    { 369, 426, 5, },
+    { 369, 489, 5, },
+    { 370, 400, 6, },
+    { 370, 427, 6, },
+    { 370, 490, 6, },
+    { 371, 401, 6, },
+    { 371, 428, 6, },
+    { 371, 491, 6, },
+    { 372, 402, 6, },
+    { 372, 429, 6, },
+    { 372, 492, 6, },
+    { 373, 403, 6, },
+    { 373, 430, 6, },
+    { 373, 493, 6, },
+    { 374, 404, 6, },
+    { 374, 431, 6, },
+    { 374, 494, 6, },
+    { 375, 405, 6, },
+    { 375, 432, 6, },
+    { 375, 495, 6, },
+    { 376, 406, 6, },
+    { 376, 433, 6, },
+    { 376, 496, 6, },
+    { 377, 407, 6, },
+    { 377, 434, 6, },
+    { 377, 497, 6, },
+    { 378, 408, 6, },
+    { 378, 435, 6, },
+    { 378, 498, 6, },
+    { 379, 409, 6, },
+    { 379, 436, 6, },
+    { 379, 499, 6, },
+    { 380, 410, 6, },
+    { 380, 437, 6, },
+    { 380, 500, 6, },
+    { 381, 411, 6, },
+    { 381, 438, 6, },
+    { 381, 501, 6, },
+    { 382, 412, 6, },
+    { 382, 439, 6, },
+    { 382, 502, 6, },
+    { 383, 413, 6, },
+    { 383, 440, 6, },
+    { 383, 503, 6, },
+    { 384, 414, 6, },
+    { 384, 441, 6, },
+    { 384, 504, 6, },
+    { 385, 415, 6, },
+    { 385, 442, 6, },
+    { 385, 505, 6, },
+    { 386, 416, 6, },
+    { 386, 443, 6, },
+    { 386, 506, 6, },
+    { 387, 417, 6, },
+    { 387, 444, 6, },
+    { 387, 507, 6, },
+    { 388, 418, 6, },
+    { 388, 445, 6, },
+    { 388, 508, 6, },
+    { 389, 419, 6, },
+    { 389, 446, 6, },
+    { 389, 509, 6, },
+    { 390, 453, 6, },
+    { 390, 510, 6, },
+    { 391, 454, 6, },
+    { 391, 511, 6, },
+    { 392, 455, 6, },
+    { 392, 512, 6, },
+    { 393, 456, 6, },
+    { 393, 513, 6, },
+    { 394, 457, 6, },
+    { 394, 514, 6, },
+    { 395, 458, 6, },
+    { 395, 515, 6, },
+    { 396, 459, 6, },
+    { 396, 516, 6, },
+    { 397, 460, 6, },
+    { 397, 517, 6, },
+    { 398, 461, 6, },
+    { 398, 518, 6, },
+    { 399, 462, 6, },
+    { 399, 519, 6, },
+    { 400, 463, 6, },
+    { 400, 520, 6, },
+    { 401, 464, 6, },
+    { 401, 521, 6, },
+    { 402, 465, 6, },
+    { 402, 522, 6, },
+    { 403, 466, 6, },
+    { 403, 523, 6, },
+    { 404, 467, 6, },
+    { 404, 524, 6, },
+    { 405, 468, 6, },
+    { 405, 525, 6, },
+    { 406, 469, 6, },
+    { 406, 526, 6, },
+    { 407, 470, 6, },
+    { 407, 527, 6, },
+    { 408, 471, 6, },
+    { 408, 528, 6, },
+    { 409, 472, 6, },
+    { 409, 529, 6, },
+    { 410, 473, 6, },
+    { 410, 530, 6, },
+    { 411, 474, 6, },
+    { 411, 531, 6, },
+    { 412, 475, 6, },
+    { 412, 532, 6, },
+    { 413, 476, 6, },
+    { 413, 533, 6, },
+    { 414, 477, 6, },
+    { 414, 534, 6, },
+    { 415, 478, 6, },
+    { 415, 535, 6, },
+    { 416, 479, 6, },
+    { 416, 536, 6, },
+    { 417, 450, 6, },
+    { 417, 537, 6, },
+    { 418, 451, 6, },
+    { 418, 538, 6, },
+    { 419, 452, 6, },
+    { 419, 539, 6, },
+    { 420, 480, 6, },
+    { 421, 481, 6, },
+    { 422, 482, 6, },
+    { 423, 483, 6, },
+    { 424, 484, 6, },
+    { 425, 485, 6, },
+    { 426, 486, 6, },
+    { 427, 487, 6, },
+    { 428, 488, 6, },
+    { 429, 489, 6, },
+    { 430, 490, 6, },
+    { 431, 491, 6, },
+    { 432, 492, 6, },
+    { 433, 493, 6, },
+    { 434, 494, 6, },
+    { 435, 495, 6, },
+    { 436, 496, 6, },
+    { 437, 497, 6, },
+    { 438, 498, 6, },
+    { 439, 499, 6, },
+    { 440, 500, 6, },
+    { 441, 501, 6, },
+    { 442, 502, 6, },
+    { 443, 503, 6, },
+    { 444, 504, 6, },
+    { 445, 505, 6, },
+    { 446, 506, 6, },
+    { 447, 507, 6, },
+    { 448, 508, 6, },
+    { 449, 509, 6, },
+    { 450, 510, 7, },
+    { 451, 511, 7, },
+    { 452, 512, 7, },
+    { 453, 513, 7, },
+    { 454, 514, 7, },
+    { 455, 515, 7, },
+    { 456, 516, 7, },
+    { 457, 517, 7, },
+    { 458, 518, 7, },
+    { 459, 519, 7, },
+    { 460, 520, 7, },
+    { 461, 521, 7, },
+    { 462, 522, 7, },
+    { 463, 523, 7, },
+    { 464, 524, 7, },
+    { 465, 525, 7, },
+    { 466, 526, 7, },
+    { 467, 527, 7, },
+    { 468, 528, 7, },
+    { 469, 529, 7, },
+    { 470, 530, 7, },
+    { 471, 531, 7, },
+    { 472, 532, 7, },
+    { 473, 533, 7, },
+    { 474, 534, 7, },
+    { 475, 535, 7, },
+    { 476, 536, 7, },
+    { 477, 537, 7, },
+    { 478, 538, 7, },
+    { 479, 539, 7, },
+    { 480, 513, 7, },
+    { 480, 597, 7, },
+    { 481, 514, 7, },
+    { 481, 598, 7, },
+    { 482, 515, 7, },
+    { 482, 599, 7, },
+    { 483, 516, 7, },
+    { 483, 570, 7, },
+    { 484, 517, 7, },
+    { 484, 571, 7, },
+    { 485, 518, 7, },
+    { 485, 572, 7, },
+    { 486, 519, 7, },
+    { 486, 573, 7, },
+    { 487, 520, 7, },
+    { 487, 574, 7, },
+    { 488, 521, 7, },
+    { 488, 575, 7, },
+    { 489, 522, 7, },
+    { 489, 576, 7, },
+    { 490, 523, 7, },
+    { 490, 577, 7, },
+    { 491, 524, 7, },
+    { 491, 578, 7, },
+    { 492, 525, 7, },
+    { 492, 579, 7, },
+    { 493, 526, 7, },
+    { 493, 580, 7, },
+    { 494, 527, 7, },
+    { 494, 581, 7, },
+    { 495, 528, 7, },
+    { 495, 582, 7, },
+    { 496, 529, 7, },
+    { 496, 583, 7, },
+    { 497, 530, 7, },
+    { 497, 584, 7, },
+    { 498, 531, 7, },
+    { 498, 585, 7, },
+    { 499, 532, 7, },
+    { 499, 586, 7, },
+    { 500, 533, 7, },
+    { 500, 587, 7, },
+    { 501, 534, 7, },
+    { 501, 588, 7, },
+    { 502, 535, 7, },
+    { 502, 589, 7, },
+    { 503, 536, 7, },
+    { 503, 590, 7, },
+    { 504, 537, 7, },
+    { 504, 591, 7, },
+    { 505, 538, 7, },
+    { 505, 592, 7, },
+    { 506, 539, 7, },
+    { 506, 593, 7, },
+    { 507, 510, 7, },
+    { 507, 594, 7, },
+    { 508, 511, 7, },
+    { 508, 595, 7, },
+    { 509, 512, 7, },
+    { 509, 596, 7, },
+    { 510, 542, 7, },
+    { 511, 543, 7, },
+    { 512, 544, 7, },
+    { 513, 545, 7, },
+    { 514, 546, 7, },
+    { 515, 547, 7, },
+    { 516, 548, 7, },
+    { 517, 549, 7, },
+    { 518, 550, 7, },
+    { 519, 551, 7, },
+    { 520, 552, 7, },
+    { 521, 553, 7, },
+    { 522, 554, 7, },
+    { 523, 555, 7, },
+    { 524, 556, 7, },
+    { 525, 557, 7, },
+    { 526, 558, 7, },
+    { 527, 559, 7, },
+    { 528, 560, 7, },
+    { 529, 561, 7, },
+    { 530, 562, 7, },
+    { 531, 563, 7, },
+    { 532, 564, 7, },
+    { 533, 565, 7, },
+    { 534, 566, 7, },
+    { 535, 567, 7, },
+    { 536, 568, 7, },
+    { 537, 569, 7, },
+    { 538, 540, 7, },
+    { 539, 541, 7, },
+    { 540, 570, 7, },
+    { 541, 571, 7, },
+    { 542, 572, 7, },
+    { 543, 573, 7, },
+    { 544, 574, 7, },
+    { 545, 575, 7, },
+    { 546, 576, 7, },
+    { 547, 577, 7, },
+    { 548, 578, 7, },
+    { 549, 579, 7, },
+    { 550, 580, 7, },
+    { 551, 581, 7, },
+    { 552, 582, 7, },
+    { 553, 583, 7, },
+    { 554, 584, 7, },
+    { 555, 585, 7, },
+    { 556, 586, 7, },
+    { 557, 587, 7, },
+    { 558, 588, 7, },
+    { 559, 589, 7, },
+    { 560, 590, 7, },
+    { 561, 591, 7, },
+    { 562, 592, 7, },
+    { 563, 593, 7, },
+    { 564, 594, 7, },
+    { 565, 595, 7, },
+    { 566, 596, 7, },
+    { 567, 597, 7, },
+    { 568, 598, 7, },
+    { 569, 599, 7, },
+};
+
index 5150ec3bdfbc130e49f6bf6ae4c66ba03ffc85cd..e1410742bfa10a27e79b3beda9dc0d7bde82024d 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1992, 1995, 1996, 1998
+/* xscreensaver, Copyright (c) 1992, 1995, 1996, 1998, 2000
  *  Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
 #include <math.h>
 #include "screenhack.h"
 
-static Display *dpy;
-static Window window;
-static GC color0, color1, color2, color3, color4, color5, color6, color7;
-static GC black;
+#define POINT_COUNT 16
+#define LINE_COUNT 32
 
-static int delay;
+#define ANGLE_SCALE 0.001
 
-static int observer_z;
-static int x_offset, y_offset;
-static int unit_pixels;
-
-struct point_state {
-  int old_x, old_y;
-  int new_x, new_y;
-  Bool same_p;
+struct line_info
+{
+  char li_ip;
+  char li_iq;
+  char li_color;
+  char li_pad;
 };
 
-static void
-move_line (struct point_state *state0, struct point_state *state1, GC gc)
+struct point_state
 {
-  if (state0->same_p && state1->same_p)
-    return;
-  if (mono_p)
-    {
-      XDrawLine (dpy, window, black,
-                state0->old_x, state0->old_y, state1->old_x, state1->old_y);
-      XDrawLine (dpy, window, gc,
-                state0->new_x, state0->new_y, state1->new_x, state1->new_y);
-    }
-  else
-    {
-      XSegment segments [2];
-      segments [0].x1 = state0->old_x; segments [0].y1 = state0->old_y;
-      segments [0].x2 = state1->old_x; segments [0].y2 = state1->old_y;
-      segments [1].x1 = state0->new_x; segments [1].y1 = state0->new_y;
-      segments [1].x2 = state1->new_x; segments [1].y2 = state1->new_y;
-      XDrawSegments (dpy, window, gc, segments, 2);
-    }
-}
+  short old_x, old_y;
+  short new_x, new_y;
+};
 
-static void
-hyper (double xy, double xz, double yz, double xw, double yw, double zw)
+struct hyper_state
 {
-  double cos_xy = cos (xy), sin_xy = sin (xy);
-  double cos_xz = cos (xz), sin_xz = sin (xz);
-  double cos_yz = cos (yz), sin_yz = sin (yz);
-  double cos_xw = cos (xw), sin_xw = sin (xw);
-  double cos_yw = cos (yw), sin_yw = sin (yw);
-  double cos_zw = cos (zw), sin_zw = sin (zw);
-
-  double ax = 1.0, ay = 0.0, az = 0.0, aw = 0.0;
-  double bx = 0.0, by = 1.0, bz = 0.0, bw = 0.0;
-  double cx = 0.0, cy = 0.0, cz = 1.0, cw = 0.0;
-  double dx = 0.0, dy = 0.0, dz = 0.0, dw = 1.0;
-
-  double _tmp0_, _tmp1_;
-
-  struct point_state points [16];
-  memset (points, 0, sizeof (points));
-
-#define mmmm (&points[0])
-#define mmmp (&points[1])
-#define mmpm (&points[2])
-#define mmpp (&points[3])
-#define mpmm (&points[4])
-#define mpmp (&points[5])
-#define mppm (&points[6])
-#define mppp (&points[7])
-#define pmmm (&points[8])
-#define pmmp (&points[9])
-#define pmpm (&points[10])
-#define pmpp (&points[11])
-#define ppmm (&points[12])
-#define ppmp (&points[13])
-#define pppm (&points[14])
-#define pppp (&points[15])
-
-  while (1)
-    {
-      double temp_mult;
-
-#define compute(a,b,c,d,point_state) \
-      temp_mult = (unit_pixels / (((a*az) + (b*bz) + (c*cz) + (d*dz) +   \
-                                  (a*aw) + (b*bw) + (c*cw) + (d*dw))     \
-                                 - observer_z));                         \
-  point_state->old_x = point_state->new_x;                               \
-  point_state->old_y = point_state->new_y;                               \
-  point_state->new_x = ((((a*ax) + (b*bx) + (c*cx) + (d*dx)) * temp_mult) \
-                       + x_offset);                                      \
-  point_state->new_y = ((((a*ay) + (b*by) + (c*cy) + (d*dy)) * temp_mult) \
-                       + y_offset);                                      \
-  point_state->same_p = (point_state->old_x == point_state->new_x &&     \
-                        point_state->old_y == point_state->new_y);
-
-      compute (-1, -1, -1, -1, mmmm);
-      compute (-1, -1, -1,  1, mmmp);
-      compute (-1, -1,  1, -1, mmpm);
-      compute (-1, -1,  1,  1, mmpp);
-      compute (-1,  1, -1, -1, mpmm);
-      compute (-1,  1, -1,  1, mpmp);
-      compute (-1,  1,  1, -1, mppm);
-      compute (-1,  1,  1,  1, mppp);
-      compute ( 1, -1, -1, -1, pmmm);
-      compute ( 1, -1, -1,  1, pmmp);
-      compute ( 1, -1,  1, -1, pmpm);
-      compute ( 1, -1,  1,  1, pmpp);
-      compute ( 1,  1, -1, -1, ppmm);
-      compute ( 1,  1, -1,  1, ppmp);
-      compute ( 1,  1,  1, -1, pppm);
-      compute ( 1,  1,  1,  1, pppp);
-
-      move_line (mmmm, mmmp, color0);
-      move_line (mmmm, mmpm, color0);
-      move_line (mmpm, mmpp, color0);
-      move_line (mmmp, mmpp, color0);
-      
-      move_line (pmmm, pmmp, color1);
-      move_line (pmmm, pmpm, color1);
-      move_line (pmpm, pmpp, color1);
-      move_line (pmmp, pmpp, color1);
-      
-      move_line (mpmm, mpmp, color2);
-      move_line (mpmm, mppm, color2);
-      move_line (mppm, mppp, color2);
-      move_line (mpmp, mppp, color2);
-      
-      move_line (mmpp, mppp, color3);
-      move_line (mmpp, pmpp, color3);
-      move_line (pmpp, pppp, color3);
-      move_line (mppp, pppp, color3);
-      
-      move_line (mmmm, mpmm, color4);
-      move_line (mmmm, pmmm, color4);
-      move_line (mpmm, ppmm, color4);
-      move_line (pmmm, ppmm, color4);
-      
-      move_line (mmmp, mpmp, color5);
-      move_line (mmmp, pmmp, color5);
-      move_line (pmmp, ppmp, color5);
-      move_line (mpmp, ppmp, color5);
-      
-      move_line (mmpm, mppm, color6);
-      move_line (mmpm, pmpm, color6);
-      move_line (pmpm, pppm, color6);
-      move_line (mppm, pppm, color6);
-      
-      move_line (ppmm, ppmp, color7);
-      move_line (ppmm, pppm, color7);
-      move_line (pppm, pppp, color7);
-      move_line (ppmp, pppp, color7);
+  char hs_stop;
+  char hs_icon;
+  char hs_resize;
+  char hs_redraw;
+  Display *hs_display;
+  Window hs_window;
+  float hs_two_observer_z;
+  float hs_offset_x;
+  float hs_offset_y;
+  float hs_unit_scale;
+  int hs_delay;
+  GC hs_color_gcs[8];
+#if 0
+  double hs_angle_xy;
+  double hs_angle_xz;
+  double hs_angle_yz;
+  double hs_angle_xw;
+  double hs_angle_yw;
+  double hs_angle_zw;
+#endif
+  double hs_cos_xy, hs_sin_xy;
+  double hs_cos_xz, hs_sin_xz;
+  double hs_cos_yz, hs_sin_yz;
+  double hs_cos_xw, hs_sin_xw;
+  double hs_cos_yw, hs_sin_yw;
+  double hs_cos_zw, hs_sin_zw;
+  double hs_ref_ax, hs_ref_ay, hs_ref_az, hs_ref_aw;
+  double hs_ref_bx, hs_ref_by, hs_ref_bz, hs_ref_bw;
+  double hs_ref_cx, hs_ref_cy, hs_ref_cz, hs_ref_cw;
+  double hs_ref_dx, hs_ref_dy, hs_ref_dz, hs_ref_dw;
+  struct point_state hs_points[POINT_COUNT];
+};
 
- /* If you get error messages about the following forms, and you think you're
-    using an ANSI C conforming compiler, then you're mistaken.  Possibly you're
-    mixing an ANSI compiler with a non-ANSI preprocessor, or vice versa.
-    Regardless, your system is broken; it's not a bug in this program.
-  */
-#if defined(__STDC__) || defined(__ANSI_CPP__)
-# define rotate(name,dim0,dim1,cos,sin) \
-      _tmp0_ = ((name##dim0 * cos) + (name##dim1 * sin)); \
-      _tmp1_ = ((name##dim1 * cos) - (name##dim0 * sin)); \
-      name##dim0 = _tmp0_; \
-      name##dim1 = _tmp1_;
-
-# define rotates(dim0,dim1) \
-      if (sin_##dim0##dim1 != 0) {                                \
-        rotate(a, dim0, dim1, cos_##dim0##dim1, sin_##dim0##dim1); \
-        rotate(b, dim0, dim1, cos_##dim0##dim1, sin_##dim0##dim1); \
-        rotate(c, dim0, dim1, cos_##dim0##dim1, sin_##dim0##dim1); \
-        rotate(d, dim0, dim1, cos_##dim0##dim1, sin_##dim0##dim1); \
-      }
+static const struct line_info line_table[LINE_COUNT];
 
-#else /* !__STDC__, courtesy of Andreas Luik <luik@isa.de> */
-# define rotate(name,dim0,dim1,cos,sin) \
-      _tmp0_ = ((name/**/dim0 * cos) + (name/**/dim1 * sin)); \
-      _tmp1_ = ((name/**/dim1 * cos) - (name/**/dim0 * sin)); \
-      name/**/dim0 = _tmp0_; \
-      name/**/dim1 = _tmp1_;
-
-# define rotates(dim0,dim1) \
-      if (sin_/**/dim0/**/dim1 != 0) {                                \
-        rotate(a,dim0,dim1,cos_/**/dim0/**/dim1,sin_/**/dim0/**/dim1); \
-        rotate(b,dim0,dim1,cos_/**/dim0/**/dim1,sin_/**/dim0/**/dim1); \
-        rotate(c,dim0,dim1,cos_/**/dim0/**/dim1,sin_/**/dim0/**/dim1); \
-        rotate(d,dim0,dim1,cos_/**/dim0/**/dim1,sin_/**/dim0/**/dim1); \
-      }
-#endif /* !__STDC__ */
+static void init (struct hyper_state *hs);
+static void hyper (struct hyper_state *hs);
+static void check_events (struct hyper_state *hs);
+static void set_sizes (struct hyper_state *hs, int width, int height);
 
-      rotates (x,y);
-      rotates (x,z);
-      rotates (y,z);
-      rotates (x,w);
-      rotates (y,w);
-      rotates (z,w);
+static struct hyper_state hyper_state;
 
-      XSync (dpy, False);
-      screenhack_handle_events (dpy);
-      if (delay) usleep (delay);
-    }
-}
 
-\f
 char *progclass = "Hypercube";
 
-char *defaults [] = {
+char *defaults[] =
+{
+  "*observer-z:        3",
+  "*delay: 10000",
+  "*xy: 3",
+  "*xz:        5",
+  "*yw:        10",
+  "*yz:        0",
+  "*xw:        0",
+  "*zw:        0",
   ".background:        black",
   ".foreground:        white",
-  "*color0:    red",
-  "*color1:    orange",
-  "*color2:    yellow",
-  "*color3:    white",
+  "*color0:    magenta",
+  "*color3:    #FF0093",
+  "*color1:    yellow",
+  "*color2:    #FF9300",
   "*color4:    green",
-  "*color5:    cyan",
-  "*color6:    dodgerblue",
-  "*color7:    magenta",
-
-  "*xw:                0.000",
-  "*xy:                0.010",
-  "*xz:                0.005",
-  "*yw:                0.010",
-  "*yz:                0.000",
-  "*zw:                0.000",
-
-  "*observer-z:        5",
-  "*delay:     30000",
+  "*color7:    #00FFD0",
+  "*color5:    #8080FF",
+  "*color6:    #00D0FF",
+
   0
 };
 
-XrmOptionDescRec options [] = {
+XrmOptionDescRec options [] =
+{
   { "-color0",         ".color0",      XrmoptionSepArg, 0 },
   { "-color1",         ".color1",      XrmoptionSepArg, 0 },
   { "-color2",         ".color2",      XrmoptionSepArg, 0 },
@@ -265,65 +129,526 @@ XrmOptionDescRec options [] = {
   { 0, 0, 0, 0 }
 };
 
+
 void
 screenhack (Display *d, Window w)
 {
-  XGCValues gcv;
-  XWindowAttributes xgwa;
-  Colormap cmap;
-  double xy, xz, yz, xw, yw, zw;
-  unsigned long bg;
+  struct hyper_state *hs;
 
-  dpy = d;
-  window = w;
-  XGetWindowAttributes (dpy, window, &xgwa);
-  cmap = xgwa.colormap;
+  hs = &hyper_state;
+  hs->hs_display = d;
+  hs->hs_window = w;
 
-  x_offset = xgwa.width / 2;
-  y_offset = xgwa.height / 2;
-  unit_pixels = xgwa.width < xgwa.height ? xgwa.width : xgwa.height;
+  init (hs);
 
-  xy = get_float_resource ("xy", "Float");
-  xz = get_float_resource ("xz", "Float");
-  yz = get_float_resource ("yz", "Float");
-  xw = get_float_resource ("xw", "Float");
-  yw = get_float_resource ("yw", "Float");
-  zw = get_float_resource ("zw", "Float");
+  hyper (hs);
+}
 
-  observer_z = get_integer_resource ("observer-z", "Integer");
+
+static void
+init (struct hyper_state *hs)
+{
+  Display *dpy;
+  Window win;
+  XGCValues gcv;
+  Colormap cmap;
+  unsigned long bg_pixel;
+  int delay;
+  float observer_z;
+
+  dpy = hs->hs_display;
+  win = hs->hs_window;
+
+  observer_z = get_float_resource ("observer-z", "Float");
+  if (observer_z < 1.125)
+    observer_z = 1.125;
+  /* hs->hs_observer_z = observer_z; */
+  hs->hs_two_observer_z = 2.0 * observer_z;
+
+  {
+    int root;
+    XWindowAttributes wa;
+    int width;
+    int height;
+
+    root = get_boolean_resource("root", "Boolean");
+    XGetWindowAttributes (dpy, win, &wa);
+    XSelectInput(dpy, win, root ? ExposureMask :
+                wa.your_event_mask | ExposureMask |
+                ButtonPressMask | StructureNotifyMask);
+    
+    width = wa.width;
+    height = wa.height;
+    cmap = wa.colormap;
+    set_sizes (hs, width, height);
+  }
 
   delay = get_integer_resource ("delay", "Integer");
+  hs->hs_delay = delay;
 
-  bg = get_pixel_resource ("background", "Background", dpy, cmap);
+  bg_pixel = get_pixel_resource ("background", "Background", dpy, cmap);
 
   if (mono_p)
     {
+      GC black_gc;
+      unsigned long fg_pixel;
+      GC white_gc;
+
       gcv.function = GXcopy;
-      gcv.foreground = bg;
-      black = XCreateGC (dpy, window, GCForeground|GCFunction, &gcv);
-      gcv.foreground = get_pixel_resource ("foreground", "Foreground",
-                                          dpy, cmap);
-      color0 = color1 = color2 = color3 = color4 = color5 = color6 = color7 =
-       XCreateGC (dpy, window, GCForeground|GCFunction, &gcv);
+      gcv.foreground = bg_pixel;
+      black_gc = XCreateGC (dpy, win, GCForeground|GCFunction, &gcv);
+      fg_pixel = get_pixel_resource ("foreground", "Foreground", dpy, cmap);
+      gcv.foreground = fg_pixel ^ bg_pixel;
+      white_gc = XCreateGC (dpy, win, GCForeground|GCFunction, &gcv);
+      hs->hs_color_gcs[0] = black_gc;
+      hs->hs_color_gcs[1] = white_gc;
     }
   else
     {
-      black = 0;
+      int col;
+
       gcv.function = GXxor;
-#define make_gc(color,name) \
-       gcv.foreground = bg ^ get_pixel_resource ((name), "Foreground", \
-                                                 dpy, cmap);           \
-       color = XCreateGC (dpy, window, GCForeground|GCFunction, &gcv)
-
-      make_gc (color0,"color0");
-      make_gc (color1,"color1");
-      make_gc (color2,"color2");
-      make_gc (color3,"color3");
-      make_gc (color4,"color4");
-      make_gc (color5,"color5");
-      make_gc (color6,"color6");
-      make_gc (color7,"color7");
+      for (col = 0; col < 8; col++)
+       {
+         char buffer[16];
+         unsigned long fg_pixel;
+         GC color_gc;
+
+         sprintf (buffer, "color%d", col);
+         fg_pixel = get_pixel_resource (buffer, "Foreground", dpy, cmap);
+         gcv.foreground = fg_pixel ^ bg_pixel;
+         color_gc = XCreateGC (dpy, win, GCForeground|GCFunction, &gcv);
+         hs->hs_color_gcs[col] = color_gc;
+       }
     }
 
-  hyper (xy, xz, yz, xw, yw, zw);
+  hs->hs_ref_ax = 1.0, hs->hs_ref_ay = 0.0, hs->hs_ref_az = 0.0, hs->hs_ref_aw = 0.0;
+  hs->hs_ref_bx = 0.0, hs->hs_ref_by = 1.0, hs->hs_ref_bz = 0.0, hs->hs_ref_bw = 0.0;
+  hs->hs_ref_cx = 0.0, hs->hs_ref_cy = 0.0, hs->hs_ref_cz = 1.0, hs->hs_ref_cw = 0.0;
+  hs->hs_ref_dx = 0.0, hs->hs_ref_dy = 0.0, hs->hs_ref_dz = 0.0, hs->hs_ref_dw = 1.0;
+
+  {
+  double xy;
+  double xz;
+  double yz;
+  double xw;
+  double yw;
+  double zw;
+  double cos_xy, sin_xy;
+  double cos_xz, sin_xz;
+  double cos_yz, sin_yz;
+  double cos_xw, sin_xw;
+  double cos_yw, sin_yw;
+  double cos_zw, sin_zw;
+
+  xy = get_float_resource ("xy", "Float") * ANGLE_SCALE;
+  xz = get_float_resource ("xz", "Float") * ANGLE_SCALE;
+  yz = get_float_resource ("yz", "Float") * ANGLE_SCALE;
+  xw = get_float_resource ("xw", "Float") * ANGLE_SCALE;
+  yw = get_float_resource ("yw", "Float") * ANGLE_SCALE;
+  zw = get_float_resource ("zw", "Float") * ANGLE_SCALE;
+
+  cos_xy = cos (xy), sin_xy = sin (xy);
+  hs->hs_cos_xy = cos_xy, hs->hs_sin_xy = sin_xy;
+  cos_xz = cos (xz), sin_xz = sin (xz);
+  hs->hs_cos_xz = cos_xz, hs->hs_sin_xz = sin_xz;
+  cos_yz = cos (yz), sin_yz = sin (yz);
+  hs->hs_cos_yz = cos_yz, hs->hs_sin_yz = sin_yz;
+  cos_xw = cos (xw), sin_xw = sin (xw);
+  hs->hs_cos_xw = cos_xw, hs->hs_sin_xw = sin_xw;
+  cos_yw = cos (yw), sin_yw = sin (yw);
+  hs->hs_cos_yw = cos_yw, hs->hs_sin_yw = sin_yw;
+  cos_zw = cos (zw), sin_zw = sin (zw);
+  hs->hs_cos_zw = cos_zw, hs->hs_sin_zw = sin_zw;
+  }
 }
+
+
+static void
+hyper (struct hyper_state *hs)
+{
+  int roted;
+
+  roted = 0;
+
+  for (;;)
+    {
+      int icon;
+      int resize;
+      char moved[POINT_COUNT];
+      int redraw;
+      int stop;
+      int delay;
+
+      check_events (hs);
+
+      icon = hs->hs_icon;
+      resize = hs->hs_resize;
+      if (icon || !(roted | resize))
+       goto skip1;
+
+      {
+       float observer_z;
+       float unit_scale;
+       float offset_x;
+       float offset_y;
+       double az, bz, cz, dz;
+       double sum_z;
+       double ax, bx, cx, dx;
+       double sum_x;
+       double ay, by, cy, dy;
+       double sum_y;
+       struct point_state *ps;
+       int old_x;
+       int old_y;
+       double mul;
+       double xf;
+       double yf;
+       int new_x;
+       int new_y;
+       int mov;
+
+
+#define compute(as,bs,cs,ds,i) \
+  az = hs->hs_ref_az; bz = hs->hs_ref_bz; cz = hs->hs_ref_cz; dz = hs->hs_ref_dz; \
+  ax = hs->hs_ref_ax; bx = hs->hs_ref_bx; cx = hs->hs_ref_cx; dx = hs->hs_ref_dx; \
+  ay = hs->hs_ref_ay; by = hs->hs_ref_by; cy = hs->hs_ref_cy; dy = hs->hs_ref_dy; \
+  sum_z = as az bs bz cs cz ds dz; \
+  observer_z = hs->hs_two_observer_z; \
+  unit_scale = hs->hs_unit_scale; \
+  sum_x = as ax bs bx cs cx ds dx; \
+  sum_y = as ay bs by cs cy ds dy; \
+  ps = &hs->hs_points[i]; \
+  mul = unit_scale / (observer_z - sum_z); \
+  offset_x = hs->hs_offset_x; \
+  offset_y = hs->hs_offset_y; \
+  old_x = ps->new_x; \
+  old_y = ps->new_y; \
+  xf = sum_x * mul + offset_x; \
+  yf = sum_y * mul + offset_y; \
+  new_x = (int)rint(xf); \
+  new_y = (int)rint(yf); \
+  ps->old_x = old_x; \
+  ps->old_y = old_y; \
+  ps->new_x = new_x; \
+  ps->new_y = new_y; \
+  mov = old_x != new_x || old_y != new_y; \
+  moved[i] = mov;
+
+       compute (-, -, -, -, 0);
+       compute (-, -, -, +, 1);
+       compute (-, -, +, -, 2);
+       compute (-, -, +, +, 3);
+       compute (-, +, -, -, 4);
+       compute (-, +, -, +, 5);
+       compute (-, +, +, -, 6);
+       compute (-, +, +, +, 7);
+       compute (+, -, -, -, 8);
+       compute (+, -, -, +, 9);
+       compute (+, -, +, -, 10);
+       compute (+, -, +, +, 11);
+       compute (+, +, -, -, 12);
+       compute (+, +, -, +, 13);
+       compute (+, +, +, -, 14);
+       compute (+, +, +, +, 15);
+      }
+
+    skip1:
+      icon = hs->hs_icon;
+      redraw = hs->hs_redraw;
+      if (icon || !(roted | redraw))
+       goto skip2;
+
+      {
+       int lc;
+       const struct line_info *lip;
+       int mono;
+       Display *dpy;
+       Window win;
+
+       lc = LINE_COUNT;
+       lip = &line_table[0];
+       mono = mono_p;
+       dpy = hs->hs_display;
+       win = hs->hs_window;
+
+       while (--lc >= 0)
+         {
+           int ip;
+           int iq;
+           int col;
+           struct point_state *sp;
+           struct point_state *sq;
+           int mov_p;
+           int mov_q;
+           GC erase_gc;
+           GC draw_gc;
+           int p_x;
+           int p_y;
+           int q_x;
+           int q_y;
+
+           ip = lip->li_ip;
+           iq = lip->li_iq;
+           col = lip->li_color;
+           lip++;
+           mov_p = moved[ip];
+           mov_q = moved[iq];
+           if (!(redraw | mov_p | mov_q))
+             continue;
+
+           sp = &hs->hs_points[ip];
+           sq = &hs->hs_points[iq];
+
+           if (mono)
+             {
+               erase_gc = hs->hs_color_gcs[0];
+               draw_gc = hs->hs_color_gcs[1];
+             }
+           else
+             {
+               GC color_gc;
+
+               color_gc = hs->hs_color_gcs[col];
+               erase_gc = color_gc;
+               draw_gc = color_gc;
+             }
+
+           if (!redraw)
+             {
+               p_x = sp->old_x;
+               p_y = sp->old_y;
+               q_x = sq->old_x;
+               q_y = sq->old_y;
+               XDrawLine (dpy, win, erase_gc, p_x, p_y, q_x, q_y);
+             }
+
+           p_x = sp->new_x;
+           p_y = sp->new_y;
+           q_x = sq->new_x;
+           q_y = sq->new_y;
+           XDrawLine (dpy, win, draw_gc, p_x, p_y, q_x, q_y);
+         }
+
+        XFlush (dpy);
+      }
+
+    skip2:
+      stop = hs->hs_stop;
+      roted = 0;
+      if (stop)
+       goto skip3;
+
+      roted = 1;
+
+      {
+       double cos_a;
+       double sin_a;
+       double old_u;
+       double old_v;
+       double new_u;
+       double new_v;
+
+ /* If you get error messages about the following forms, and you think you're
+    using an ANSI C conforming compiler, then you're mistaken.  Possibly you're
+    mixing an ANSI compiler with a non-ANSI preprocessor, or vice versa.
+    Regardless, your system is broken; it's not a bug in this program.
+  */
+#if defined(__STDC__) || defined(__ANSI_CPP__)
+
+#define rotate(name,dim0,dim1) \
+  old_u = hs->hs_ref_##name##dim0; \
+  old_v = hs->hs_ref_##name##dim1; \
+  new_u = old_u * cos_a + old_v * sin_a; \
+  new_v = old_v * cos_a - old_u * sin_a; \
+  hs->hs_ref_##name##dim0 = new_u; \
+  hs->hs_ref_##name##dim1 = new_v;
+
+#define rotates(dim0,dim1) \
+  if (hs->hs_sin_##dim0##dim1 != 0) { \
+    cos_a = hs->hs_cos_##dim0##dim1; \
+    sin_a = hs->hs_sin_##dim0##dim1; \
+    rotate(a,dim0,dim1); \
+    rotate(b,dim0,dim1); \
+    rotate(c,dim0,dim1); \
+    rotate(d,dim0,dim1); \
+  }
+
+#else /* !__STDC__, courtesy of Andreas Luik <luik@isa.de> */
+
+#define rotate(name,dim0,dim1) \
+  old_u = hs->hs_ref_/**/name/**/dim0; \
+  old_v = hs->hs_ref_/**/name/**/dim1; \
+  new_u = old_u * cos_a + old_v * sin_a; \
+  new_v = old_v * cos_a - old_u * sin_a; \
+  hs->hs_ref_/**/name/**/dim0 = new_u; \
+  hs->hs_ref_/**/name/**/dim1 = new_v;
+
+#define rotates(dim0,dim1) \
+  if (hs->hs_sin_/**/dim0/**/dim1 != 0) { \
+    cos_a = hs->hs_cos_/**/dim0/**/dim1; \
+    sin_a = hs->hs_sin_/**/dim0/**/dim1; \
+    rotate(a,dim0,dim1); \
+    rotate(b,dim0,dim1); \
+    rotate(c,dim0,dim1); \
+    rotate(d,dim0,dim1); \
+  }
+
+#endif /* !__STDC__ */
+
+       rotates (x,y);
+       rotates (x,z);
+       rotates (y,z);
+       rotates (x,w);
+       rotates (y,w);
+       rotates (z,w);
+      }
+
+    skip3:
+      /* stop = hs->hs_stop; */
+      delay = hs->hs_delay;
+      if (stop && delay < 10000)
+       delay = 10000;
+      if (delay > 0)
+       usleep (delay);
+    }
+}
+
+
+static void
+check_events (struct hyper_state *hs)
+{
+  Display *dpy;
+  int count;
+  int ic;
+  int resize;
+  Window win;
+  int redraw;
+
+  dpy = hs->hs_display;
+  count = XEventsQueued (dpy, QueuedAfterReading);
+  ic = count;
+  hs->hs_resize = 0;
+  hs->hs_redraw = 0;
+
+  while (--ic >= 0)
+    {
+      XEvent   e;
+
+      XNextEvent (dpy, &e);
+
+      switch (e.type)
+       {
+       case Expose:
+         hs->hs_icon = 0;
+         hs->hs_redraw = 1;
+         break;
+
+       case ConfigureNotify:
+         hs->hs_icon = 0;
+         hs->hs_resize = 1;
+         hs->hs_redraw = 1;
+         break;
+
+       case ButtonPress:
+         switch (e.xbutton.button)
+           {
+           case 2:
+             hs->hs_stop = !hs->hs_stop;
+             break;
+           default:
+             break;
+           }
+         break;
+
+       case UnmapNotify:
+         hs->hs_icon = 1;
+         hs->hs_redraw = 0;
+         break;
+
+       default:
+         screenhack_handle_event(dpy, &e);
+         break;
+       }
+    }
+
+  resize = hs->hs_resize;
+  win = hs->hs_window;
+  if (resize)
+    {
+      XWindowAttributes wa;
+      int width;
+      int height;
+
+      XGetWindowAttributes (dpy, win, &wa);
+      width = wa.width;
+      height = wa.height;
+      set_sizes (&hyper_state, width, height);
+    }
+
+  redraw = hs->hs_redraw;
+  if (redraw)
+    XClearWindow (dpy, win);
+}
+
+
+static void
+set_sizes (struct hyper_state *hs, int width, int height)
+{
+  double observer_z;
+  int min_dim;
+  double var;
+  double offset_x;
+  double offset_y;
+  double unit_scale;
+
+  observer_z = 0.5 * hs->hs_two_observer_z;
+  min_dim = width < height ? width : height;
+  var = sqrt(observer_z * observer_z - 1.0);
+  offset_x = 0.5 * (double)(width - 1);
+  offset_y = 0.5 * (double)(height - 1);
+  unit_scale = 0.4 * min_dim * var;
+  hs->hs_offset_x = (float)offset_x;
+  hs->hs_offset_y = (float)offset_y;
+  hs->hs_unit_scale = (float)unit_scale;
+}
+
+
+/* data */
+
+static const struct line_info line_table[LINE_COUNT] =
+{
+    { 0, 1, 0, },
+    { 0, 2, 0, },
+    { 1, 3, 0, },
+    { 2, 3, 0, },
+    { 4, 5, 1, },
+    { 4, 6, 1, },
+    { 5, 7, 1, },
+    { 6, 7, 1, },
+    { 0, 4, 4, },
+    { 0, 8, 4, },
+    { 4, 12, 4, },
+    { 8, 12, 4, },
+    { 1, 5, 5, },
+    { 1, 9, 5, },
+    { 5, 13, 5, },
+    { 9, 13, 5, },
+    { 2, 6, 6, },
+    { 2, 10, 6, },
+    { 6, 14, 6, },
+    { 10, 14, 6, },
+    { 3, 7, 7, },
+    { 3, 11, 7, },
+    { 7, 15, 7, },
+    { 11, 15, 7, },
+    { 8, 9, 2, },
+    { 8, 10, 2, },
+    { 9, 11, 2, },
+    { 10, 11, 2, },
+    { 12, 13, 3, },
+    { 12, 14, 3, },
+    { 13, 15, 3, },
+    { 14, 15, 3, },
+};
+
index dcacb5ae097d24ef1c0a2f1c5023f41bee8cd0ce..0695cf37252d480a6b566f15f78730f35c027f27 100644 (file)
@@ -1,4 +1,4 @@
-/* nerverot, nervous rotation of random thingies, v1.0
+/* nerverot, nervous rotation of random thingies, v1.2
  * by Dan Bornstein, danfuzz@milk.com
  * Copyright (c) 2000 Dan Bornstein.
  *
  * The goal of this screensaver is to be interesting and compelling to
  * watch, yet induce a state of nervous edginess in the viewer.
  *
- * Brief description of options/resources:
- *
- *   -fg <color>: foreground color
- *   -bg <color>: background color
- *   -delay <usec>: delay between frames
- *   -event-chance <frac>: chance, per iteration, that an interesting event
- *     will happen (range 0..1)
- *   -iter-amt <frac>: amount, per iteration, to move towards rotation and
- *     scale targets (range 0..1)
- *   -count <n>: number of blots
- *   -colors <n>: number of colors to use
- *   -lineWidth <n>: width of lines (0 means an optimized thin line)
- *   -nervousness <frac>: amount of nervousness (range 0..1)
- *   -min-scale <frac>: minimum scale of drawing as fraction of base scale
- *     (which is the minumum of the width or height of the screen) (range
- *     0..10)
- *   -max-scale <frac>: maximum scale of drawing as fraction of base scale
- *     (which is the minumum of the width or height of the screen) (range
- *     0..10)
- *   -min-radius <n>: minimum radius for drawing blots (range 1..100)
- *   -max-radius <n>: maximum radius for drawing blots (range 1..100)
- *   -max-nerve-radius <frac>: maximum nervousness radius (range 0..1)
+ * See the included man page for more details.
  */
 
 #include <math.h>
 
 /* random float in the range (-1..1) */
 #define RAND_FLOAT_PM1 \
-        (((FLOAT) (random() & 0xffff)) / ((FLOAT) 0x10000) * 2 - 1)
+        (((FLOAT) ((random() >> 8) & 0xffff)) / ((FLOAT) 0x10000) * 2 - 1)
 
 /* random float in the range (0..1) */
 #define RAND_FLOAT_01 \
-        (((FLOAT) (random() & 0xffff)) / ((FLOAT) 0x10000))
+        (((FLOAT) ((random() >> 8) & 0xffff)) / ((FLOAT) 0x10000))
 
 
 
@@ -87,6 +66,9 @@ static int colorCount;
 /* width of lines */
 static int lineWidth;
 
+/* whether or not to do double-buffering */
+static Bool doubleBuffer;
+
 
 
 /* non-user-modifiable immutable definitions */
@@ -103,9 +85,10 @@ static int windowHeight;
 static int centerX;
 static int centerY;
 
-static Display *display; /* the display to draw on */
-static Window window;    /* the window to draw on */
-static GC *gcs;          /* array of gcs, one per color used */
+static Display *display;  /* the display to draw on */
+static Window window;     /* the window to draw on */
+static Drawable drawable; /* the thing to directly draw on */
+static GC *gcs;           /* array of gcs, one per color used */
 
 
 
@@ -278,9 +261,10 @@ static void setupBlotsSphere (void)
 
        initBlot (&blots[n], x, y, z);
     }
-
 }
 
+
+
 /* set up the initial array of blots to be a simple cube */
 static void setupBlotsCube (void)
 {
@@ -338,6 +322,7 @@ static void setupBlotsCube (void)
 }
 
 
+
 /* set up the initial array of blots to be a cylinder */
 static void setupBlotsCylinder (void)
 {
@@ -436,6 +421,115 @@ static void setupBlotsSquiggle (void)
 
 
 
+/* set up the initial array of blots to be near the corners of a
+ * cube, distributed slightly */
+static void setupBlotsCubeCorners (void)
+{
+    int n;
+
+    blotCount = requestedBlotCount;
+    blots = calloc (sizeof (Blot), blotCount);
+
+    for (n = 0; n < blotCount; n++)
+    {
+       FLOAT x = rint (RAND_FLOAT_01) * 2 - 1;
+       FLOAT y = rint (RAND_FLOAT_01) * 2 - 1;
+       FLOAT z = rint (RAND_FLOAT_01) * 2 - 1;
+
+       x += RAND_FLOAT_PM1 * 0.3;
+       y += RAND_FLOAT_PM1 * 0.3;
+       z += RAND_FLOAT_PM1 * 0.3;
+
+       initBlot (&blots[n], x, y, z);
+    }
+
+    scaleBlotsToRadius1 ();
+}
+
+
+
+/* forward declaration for recursive use immediately below */
+static void setupBlots (void);
+
+/* set up the blots to be two of the other choices, placed next to
+ * each other */
+static void setupBlotsDuo (void)
+{
+    int origRequest = requestedBlotCount;
+    FLOAT tx, ty, tz, radius;
+    Blot *blots1, *blots2;
+    int count1, count2;
+    int n;
+
+    if (requestedBlotCount < 15)
+    {
+       /* special case bottom-out */
+       setupBlotsSphere ();
+       return;
+    }
+
+    tx = RAND_FLOAT_PM1;
+    ty = RAND_FLOAT_PM1;
+    tz = RAND_FLOAT_PM1;
+    radius = sqrt (tx * tx + ty * ty + tz * tz);
+    tx /= radius;
+    ty /= radius;
+    tz /= radius;
+
+    /* recursive call to setup set 1 */
+    requestedBlotCount = origRequest / 2;
+    setupBlots ();
+
+    if (blotCount >= origRequest)
+    {
+       /* return immediately if this satisfies the original count request */
+       return;
+    }
+
+    blots1 = blots;
+    count1 = blotCount;
+    blots = NULL;
+    blotCount = 0;
+    
+    /* translate to new position */
+    for (n = 0; n < count1; n++)
+    {
+       blots1[n].x += tx;
+       blots1[n].y += ty;
+       blots1[n].z += tz;
+    }
+
+    /* recursive call to setup set 2 */
+    requestedBlotCount = origRequest - count1;
+    setupBlots ();
+    blots2 = blots;
+    count2 = blotCount;
+
+    /* translate to new position */
+    for (n = 0; n < count2; n++)
+    {
+       blots2[n].x -= tx;
+       blots2[n].y -= ty;
+       blots2[n].z -= tz;
+    }
+
+    /* combine the two arrays */
+    blotCount = count1 + count2;
+    blots = calloc (sizeof (Blot), blotCount);
+    memcpy (&blots[0],      blots1, sizeof (Blot) * count1);
+    memcpy (&blots[count1], blots2, sizeof (Blot) * count2);
+    free (blots1);
+    free (blots2);
+
+    scaleBlotsToRadius1 ();
+    randomlyReorderBlots ();
+
+    /* restore the original requested count, for future iterations */
+    requestedBlotCount = origRequest;
+}
+
+
+
 /* free the blots, in preparation for a new shape */
 static void freeBlots (void)
 {
@@ -463,7 +557,7 @@ static void freeBlots (void)
 /* set up the initial arrays of blots */
 static void setupBlots (void)
 {
-    int which = RAND_FLOAT_01 * 4;
+    int which = RAND_FLOAT_01 * 7;
 
     freeBlots ();
 
@@ -481,15 +575,29 @@ static void setupBlots (void)
        case 3:
            setupBlotsSquiggle ();
            break;
+       case 4:
+           setupBlotsCubeCorners ();
+           break;
+       case 5:
+       case 6:
+           setupBlotsDuo ();
+           break;
     }
+}
+
 
+
+/* set up the segments arrays */
+static void setupSegs (void)
+{
     /* there are blotShapeCount - 1 line segments per blot */
     segCount = blotCount * (blotShapeCount - 1);
     segsToErase = calloc (sizeof (LineSegment), segCount);
     segsToDraw = calloc (sizeof (LineSegment), segCount);
 
     /* erase the world */
-    XFillRectangle (display, window, gcs[0], 0, 0, windowWidth, windowHeight);
+    XFillRectangle (display, drawable, gcs[0], 0, 0, 
+                   windowWidth, windowHeight);
 }
 
 
@@ -566,8 +674,19 @@ static void setup (void)
     centerY = windowHeight / 2;
     baseScale = (xgwa.height < xgwa.width) ? xgwa.height : xgwa.width;
 
+    if (doubleBuffer)
+    {
+       drawable = XCreatePixmap (display, window, xgwa.width, xgwa.height,
+                                 xgwa.depth);
+    }
+    else
+    {
+       drawable = window;
+    }
+
     setupColormap (&xgwa);
     setupBlots ();
+    setupSegs ();
 
     /* set up the initial rotation, scale, and light values as random, but
      * with the targets equal to where it is */
@@ -683,6 +802,7 @@ static void updateWithFeeling (void)
     {
        itersTillNext = RAND_FLOAT_01 * 1234;
        setupBlots ();
+       setupSegs ();
        renderSegs ();
     }
 
@@ -770,18 +890,18 @@ static void updateWithFeeling (void)
            }
            case 7:
            {
-               centerXOff = RAND_FLOAT_PM1 * maxRadius / 2;
+               centerXOff = RAND_FLOAT_PM1 * maxRadius;
                break;
            }
            case 8:
            {
-               centerYOff = RAND_FLOAT_PM1 * maxRadius / 2;
+               centerYOff = RAND_FLOAT_PM1 * maxRadius;
                break;
            }
            case 9:
            {
-               centerXOff = RAND_FLOAT_PM1 * maxRadius / 2;
-               centerYOff = RAND_FLOAT_PM1 * maxRadius / 2;
+               centerXOff = RAND_FLOAT_PM1 * maxRadius;
+               centerYOff = RAND_FLOAT_PM1 * maxRadius;
                break;
            }
            case 10:
@@ -822,12 +942,18 @@ static void eraseAndDraw (void)
     for (n = 0; n < segCount; n++)
     {
        LineSegment *seg = &segsToErase[n];
-       XDrawLine (display, window, gcs[0], 
+       XDrawLine (display, drawable, gcs[0], 
                   seg->x1, seg->y1, seg->x2, seg->y2);
        seg = &segsToDraw[n];
-       XDrawLine (display, window, seg->gc,
+       XDrawLine (display, drawable, seg->gc,
                   seg->x1, seg->y1, seg->x2, seg->y2);
     }
+
+    if (doubleBuffer)
+    {
+       XCopyArea (display, drawable, window, gcs[0], 0, 0, 
+                  windowWidth, windowHeight, 0, 0);
+    }
 }
 
 /* do one iteration */
@@ -856,6 +982,7 @@ char *defaults [] = {
     "*count:           250",
     "*colors:          4",
     "*delay:           10000",
+    "*doubleBuffer:    false",
     "*eventChance:      0.2",
     "*iterAmt:          0.01",
     "*lineWidth:        0",
@@ -871,8 +998,9 @@ char *defaults [] = {
 XrmOptionDescRec options [] = {
   { "-count",            ".count",          XrmoptionSepArg, 0 },
   { "-colors",           ".colors",         XrmoptionSepArg, 0 },
-  { "-cube",             ".cube",           XrmoptionNoArg,  "true" },
   { "-delay",            ".delay",          XrmoptionSepArg, 0 },
+  { "-db",               ".doubleBuffer",   XrmoptionNoArg,  "true" },
+  { "-no-db",            ".doubleBuffer",   XrmoptionNoArg,  "false" },
   { "-event-chance",     ".eventChance",    XrmoptionSepArg, 0 },
   { "-iter-amt",         ".iterAmt",        XrmoptionSepArg, 0 },
   { "-line-width",       ".lineWidth",      XrmoptionSepArg, 0 },
@@ -896,6 +1024,8 @@ static void initParams (void)
        fprintf (stderr, "error: delay must be at least 0\n");
        problems = 1;
     }
+    
+    doubleBuffer = get_boolean_resource ("doubleBuffer", "Boolean");
 
     requestedBlotCount = get_integer_resource ("count", "Count");
     if (requestedBlotCount <= 0)
index c080b40c138dca6cdac577e8a4e8176867e6c9dc..de723fbf4c1114a978b741828a4618c04d5aed3e 100644 (file)
@@ -1,12 +1,13 @@
-.TH XScreenSaver 1 "05-Jul-2000" "X Version 11"
+.TH XScreenSaver 1 "11-Aug-2000" "X Version 11"
 .SH NAME
 nerverot - induces edginess in the viewer
 .SH SYNOPSIS
 .B nerverot
-[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install] [\-visual \fIvisual\fP] [\-colors \fIinteger\fP] [\-delay \fImicroseconds\fP] [\-count \fIinteger\fP] [\-line-width \fIinteger\fP] [\-event-chance \fIfraction\fP] [\-iter-amt \fIfraction\fP] [\-nervousness \fIfraction\fP] [\-max-nerve-radius \fIfraction\fP] [\-min-radius \fIinteger\fP] [\-max-radius \fIinteger\fP] [\-min-scale \fIfraction\fP] [\-max-scale \fIfraction\fP]
+[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install] [\-visual \fIvisual\fP] [\-db] [\-no-db] [\-colors \fIinteger\fP] [\-delay \fImicroseconds\fP] [\-count \fIinteger\fP] [\-line-width \fIinteger\fP] [\-event-chance \fIfraction\fP] [\-iter-amt \fIfraction\fP] [\-nervousness \fIfraction\fP] [\-max-nerve-radius \fIfraction\fP] [\-min-radius \fIinteger\fP] [\-max-radius \fIinteger\fP] [\-min-scale \fIfraction\fP] [\-max-scale \fIfraction\fP]
 .SH DESCRIPTION
 The goal of \fInerverot\fP is to be interesting and compelling to
-watch, yet induce a state of nervous edginess in the viewer.
+watch, yet induce a state of nervous edginess in the viewer. This manpage
+describes v1.2 of the program.
 .SH OPTIONS
 .I nerverot
 accepts the following options:
@@ -27,6 +28,15 @@ Install a private colormap for the window.
 Which visual to use.  Legal values are the name of a visual class,
 or the id number (decimal or hex) of a specific visual.
 .TP 8
+.B \-db
+.B \-no-db
+Use double-buffering (or not, respectively). Double-buffering may make 
+things look better for larger line widths and/or larger numbers of
+blots, but "better" may equate to yielding less of the desired edginess
+effect. You'll be calmer after watching the double-buffered variant;
+you're more likely to go into epileptic fits with it off. Hence, it
+is off (false) by default, resource \fIdoubleBuffer\fP.
+.TP 8
 .B \-colors \fIinteger\fP
 How many colors should be used (if possible). The colors
 form a smooth ramp between two randomly-chosen colors. Defaults to 4,
index 22e9495e3fd832c0608de34e17dc9e9e8850dd3a..1188f2e60696504e35889b621005504dcebb0558 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1999 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1999, 2000 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -529,6 +529,7 @@ static void
 scroll (p_state *state)
 {
   int x, y;
+
   for (x = 0; x < state->grid_width; x++)
     {
       p_cell *from = 0, *to = 0;
@@ -553,7 +554,7 @@ scroll (p_state *state)
         }
 
       to = from;
-      if (to->state == FLARE || to->state == NORMAL)
+      if (to && (to->state == FLARE || to->state == NORMAL))
         {
           to->state = FADE;
           to->changed = True;
index 670d667750f6abd2e445212f7dc1634913edc2bd..d384605add37067ddf55db4ccc62a4b5b945982a 100644 (file)
@@ -384,13 +384,17 @@ void screenhack(Display *pDisplay, Window Win )
 
                if( i++ >= cycles )
                {
+                        XWindowAttributes XWinAttribs;
+                        XGetWindowAttributes( pDisplay, Win, &XWinAttribs );
+
                        i = 0;
-                       XClearWindow( pDisplay, Win );
                        memset( pImage->data, 0, pImage->bytes_per_line * pImage->height );
                        for( iShadeBob=0; iShadeBob<nShadeBobCount; iShadeBob++ )
                                ResetShadeBob( &aShadeBobs[ iShadeBob ] );
+                        XFreeColors( pDisplay, XWinAttribs.colormap, aiColorVals, iColorCount, 0 );
                        free( aiColorVals );
                        aiColorVals = SetPalette( pDisplay, Win, sColor, &iColorCount );
+                        XClearWindow( pDisplay, Win );
                }
 
                for( iShadeBob=0; iShadeBob<nShadeBobCount; iShadeBob++ )
index 0608ac5bf668e94c0f92ccd4add89a4aab495cea..5ccbc44c079b4219031f66befd7d4c618a9f1208 100644 (file)
@@ -37,7 +37,7 @@
  * software for any purpose.  It is provided "as is" without express or 
  * implied warranty.
  *
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
  *
  * Version 1.0 April 27, 1998.
  * - Initial version
@@ -215,13 +215,14 @@ void *sensor_info;                        /* Information about the sensor */
  * A list of targets to ping.
  */
 
-#ifdef HAVE_PING
 typedef struct ping_target {
     char *name;                        /* The name of the target */
     struct sockaddr address;   /* The address of the target */
     struct ping_target *next;  /* The next one in the list */
 } ping_target;
 
+
+#ifdef HAVE_PING
 /*
  * Ping Information.
  *
index 289cd5be48579ca1acfb80bb809545985ecdbe46..a630e9938663fa6b20d0ab04b649cc79d768beea 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/local/bin/perl5 -w
 #
-# webcollage, Copyright (c) 1999 by Jamie Zawinski <jwz@jwz.org>
+# webcollage, Copyright (c) 1999, 2000 by Jamie Zawinski <jwz@jwz.org>
 # This program decorates the screen with random images from the web.
 # One satisfied customer described it as "a nonstop pop culture brainbath."
 #
@@ -27,7 +27,7 @@ require POSIX;
 use Fcntl ':flock'; # import LOCK_* constants
 
 
-my $version = q{ $Revision: 1.54 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
+my $version = q{ $Revision: 1.60 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
 my $copyright = "WebCollage $version, Copyright (c) 1999" .
     " Jamie Zawinski <jwz\@jwz.org>\n" .
     "            http://www.jwz.org/xscreensaver/\n";
@@ -96,7 +96,10 @@ my $delay = 0;
 my $wordlist = "/usr/dict/words";
 
 if (!-r $wordlist) {
-    $wordlist = "/usr/share/lib/dict/words";    # irix
+    $wordlist = "/usr/share/dict/words";       # BSD
+}
+if (!-r $wordlist) {
+    $wordlist = "/usr/share/lib/dict/words";    # Irix
 }
 die "$wordlist doesn't exist!\n" unless (-r $wordlist);
 
@@ -665,6 +668,8 @@ sub pick_from_image_randomizer {
 #    s/Result [Pp]ages:.*$//s;            # trim off page footer
 #    s/^.*?IMAGE RESULTS//s;              # trim off page header
 
+    s/Have you tried these resources.*//s;  # let's try it again
+
     s/[\r\n\t ]+/ /g;
 
     s/(<A )/\n$1/gi;
@@ -683,22 +688,29 @@ sub pick_from_image_randomizer {
 
         next unless ($u =~ m@^http://@i);  # skip non-http and relative urls.
 
-        next if ($u =~ m@[/.]altavista\.com@i);  # skip altavista builtins
-        next if ($u =~ m@[/.]av\.com@i);
-        next if ($u =~ m@[/.]virage\.com@i);
-        next if ($u =~ m@[/.]photoloft\.com@i);
-        next if ($u =~ m@[/.]shopping\.com@i);
-        next if ($u =~ m@[/.]thetrip\.com@i);
-        next if ($u =~ m@[/.]cmgi\.com@i);
-        next if ($u =~ m@[/.]intelihealth\.com@i);
-        next if ($u =~ m@[/.]wildweb\.com@i);
-        next if ($u =~ m@[/.]digital\.com@i);
-        next if ($u =~ m@[/.]doubleclick\.net@i);
-        next if ($u =~ m@[/.]freeim\.org@i);
-        next if ($u =~ m@[/.]clicktomarket\.com@i);  # you cretins
+        next if ($u =~ m@[/.]altavista\.com\b@i);     # skip altavista builtins
+        next if ($u =~ m@[/.]altavista\.[a-z]{2}\b@i); # altavista.fr, etc
+        next if ($u =~ m@[/.]av\.com\b@i);
+        next if ($u =~ m@[/.]virage\.com\b@i);
+        next if ($u =~ m@[/.]photoloft\.com\b@i);
+        next if ($u =~ m@[/.]shopping\.com\b@i);
+        next if ($u =~ m@[/.]thetrip\.com\b@i);
+        next if ($u =~ m@[/.]cmgi\.com\b@i);
+        next if ($u =~ m@[/.]intelihealth\.com\b@i);
+        next if ($u =~ m@[/.]wildweb\.com\b@i);
+        next if ($u =~ m@[/.]digital\.com\b@i);
+        next if ($u =~ m@[/.]doubleclick\.net\b@i);
+        next if ($u =~ m@[/.]freeim\.org\b@i);
+        next if ($u =~ m@[/.]clicktomarket\.com\b@i);  # you cretins
+        next if ($u =~ m@[/.]teragram\.com\b@i);
+
+        # must lose this one for altavista, even though it loses images of
+        # every single customer of akamai.  Oh well, those people have lots
+        # of money, and so their images are probably boring anyway.
+        next if ($u =~ m@[/.]akamai\.net@i);
 
         if ($which == 0 && $u =~ m@[/.]corbis\.com@) {
-            $skipped = 1;
+           $skipped = 1;
             if ( $verbose > 3 ) {
                 print STDERR "$progname: skipping corbis URL: $u\n";
             }
@@ -804,7 +816,6 @@ my $count_4 = 0;
 
 sub pick_image {
     my ( $timeout ) = @_;
-
     my $r = int(rand(100));
 
     my ($base, $img, $source, $total, $count);
@@ -819,7 +830,7 @@ sub pick_image {
         $total = ++$total_1;
         $count = ++$count_1 if $img;
 
-     } elsif ($r < 70) {
+     } elsif ($r < 65) {
          ($base, $img, $source) = pick_from_image_randomizer ($timeout, 3);
          $total = ++$total_4;
          $count = ++$count_4 if $img;
@@ -1207,7 +1218,7 @@ sub x_output {
         } elsif ((@_ = jpeg_size ($body))) {
             ($iw, $ih) = @_;
             $cmd = "djpeg |";
-        } elsif ($body =~ "^P\d\n(\d+) (\d+)\n") {
+        } elsif ($body =~ m/^P\d\n(\d+) (\d+)\n/) {
             $iw = $1;
             $ih = $2;
             $cmd = "";
index 4b41df383ce3058f586a7798184b76aec09f983c..3e8872d411fdb84cd73d8a41e314b82385c22a11 100644 (file)
@@ -97,7 +97,7 @@ stored in the RESOURCE_MANAGER property.
 to get the default HTTP proxy host and port.
 .SH FILES AND URLS
 .TP
-.I /usr/dict/words \fRor\fP /usr/share/lib/dict/words
+.I /usr/dict/words \fRor\fP /usr/share/lib/dict/words \fRor\fP /usr/share/dict/words
 To find the random words to feed to search engines.
 .PP
 .I http://random.yahoo.com/bin/ryl, http://image.altavista.com/
index 2e569e07cb959ea3be9ae81dca8dbcd3271d45c7..bd2be990f36923e8e5da306fb6affb39ad702ba9 100644 (file)
@@ -533,6 +533,13 @@ FlameAdvance(void)
           if (used) 
             newtop = y - 1;
         }
+      /* clean up the right gutter */
+      {
+        int v1 = (int)*ptr1;
+        v1 = (v1 * residual) >> 8;
+        *ptr1 = (unsigned char)v1;
+      }
     }
 
   top = newtop - 1;
index 15a553d50e4c83cb6fd1b32e27081692b9b79cd1..3fc5c2c1d09ec0805b5679da93acd5a594f79257 100644 (file)
@@ -13,7 +13,7 @@ The \fIxflame\fP program draws animated flames across the bottom of the
 screen.  The flames occasionally flare up.  If a bitmap is specified,
 that image will float above the flames, burning.
 .SH OPTIONS
-.I phosphor
+.I xflame
 accepts the following options:
 .TP 8
 .B \-window
diff --git a/hacks/xrayswarm.c b/hacks/xrayswarm.c
new file mode 100644 (file)
index 0000000..b1ec759
--- /dev/null
@@ -0,0 +1,1120 @@
+/*
+ * Copyright (c) 2000 by Chris Leger (xrayjones@users.sourceforge.net)
+ *
+ * xrayswarm - a shameless ripoff of the 'swarm' screensaver on SGI
+ *   boxes.
+ *
+ * Version 1.0 - initial release.  doesn't read any special command-line
+ *   options, and only supports the variable 'delay' via Xresources.
+ *   (the delay resouces is most useful on systems w/o gettimeofday, in
+ *   which case automagical level-of-detail for FPS maintainance can't
+ *   be used.)
+ *
+ *   The code isn't commented, but isn't too ugly. It should be pretty
+ *   easy to understand, with the exception of the colormap stuff.
+ *
+ */
+/*
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from the X Consortium.
+*/
+
+#include <math.h>
+#include <sys/time.h>
+#include "screenhack.h"
+#include "config.h"
+
+
+/**********************************************************************
+ *                                                                    
+ * window crap 
+ *
+ **********************************************************************/
+
+char *progclass="xrayswarm";
+
+char *defaults [] ={
+       ".background:           black",
+       "*delay:                0",
+       0
+};
+
+XrmOptionDescRec options [] = {
+       {"-delay",".delay",XrmoptionSepArg,0},
+       {0,0,0,0}
+};
+
+static char colors[768];
+
+static Display *dpy;
+static Window win;
+static GC fgc[256];
+static GC cgc;
+static int xsize, ysize;
+static int xc, yc;
+static unsigned long delay;
+static float maxx, maxy;
+
+/**********************************************************************
+ *                                                                    
+ * bug structs & variables
+ *
+ **********************************************************************/
+#define MAX_TRAIL_LEN 60
+#define MAX_BUGS 100
+#define MAX_TARGETS 10
+#define sq(x) ((x)*(x))
+
+#define MAX_FPS 150
+#define MIN_FPS 16
+#define DESIRED_DT 0.2
+
+typedef struct _sbug {
+  float pos[3];
+  int hist[MAX_TRAIL_LEN][2];
+  float vel[2];
+  struct _sbug *closest;
+} bug;
+
+#define GRAY_TRAILS 0
+#define GRAY_SCHIZO 1
+#define COLOR_TRAILS 2
+#define RANDOM_TRAILS 3
+#define RANDOM_SCHIZO 4
+#define COLOR_SCHIZO 5
+#define NUM_SCHEMES 6 /* too many schizos; don't use last 2 */  
+
+static float dt = 0.3;
+static float targetVel = 0.03;
+static float targetAcc = 0.02;
+static float maxVel = 0.05;
+static float maxAcc = 0.03;
+static float noise = 0.01;
+static float minVelMultiplier = 0.5;
+
+static int nbugs = -1;
+static int ntargets = -1;
+static int trailLen = -1;
+
+/* vars dependent on those above */
+static float dtInv;
+static float halfDtSq;
+static float targetVelSq;
+static float maxVelSq;
+static float minVelSq;
+static float minVel;
+
+static bug bugs[MAX_BUGS];
+static bug targets[MAX_TARGETS];
+static int head = 0;
+static int tail = 0;
+static int colorScheme = -1;
+static float changeProb = 0.08;
+
+static int grayIndex[MAX_TRAIL_LEN];
+static int redIndex[MAX_TRAIL_LEN];
+static int blueIndex[MAX_TRAIL_LEN];
+static int graySIndex[MAX_TRAIL_LEN];
+static int redSIndex[MAX_TRAIL_LEN];
+static int blueSIndex[MAX_TRAIL_LEN];
+static int randomIndex[MAX_TRAIL_LEN];
+static int numColors;
+static int numRandomColors;
+
+typedef struct {
+  float dt;
+  float targetVel;
+  float targetAcc;
+  float maxVel;
+  float maxAcc;
+  float noise;
+
+  int nbugs;
+  int ntargets;
+  int trailLen;
+  int colorScheme;
+  int changeProb;
+} bugParams;
+
+bugParams good1 = {
+  0.3,  /* dt */
+  0.03,  /* targetVel */
+  0.02,  /* targetAcc */
+  0.05,  /* maxVel */
+  0.03,  /* maxAcc */
+  0.01,  /* noise */
+  -1,    /* nbugs */
+  -1,     /* ntargets */
+  60,    /* trailLen */
+  2,     /* colorScheme */
+  0.15  /* changeProb */
+};
+
+bugParams *goodParams[] = { 
+&good1
+};
+
+int numParamSets = 1;
+
+void initCMap(void) {
+  int i, n;
+  int temp;
+
+  n = 0;
+
+  /* color 0 is black */
+  colors[n++] = 0;
+  colors[n++] = 0;
+  colors[n++] = 0;
+
+  /* color 1 is red */
+  colors[n++] = 255;
+  colors[n++] = 0;
+  colors[n++] = 0;
+
+  /* color 2 is green */
+  colors[n++] = 255;
+  colors[n++] = 0;
+  colors[n++] = 0;
+
+  /* color 3 is blue */
+  colors[n++] = 255;
+  colors[n++] = 0;
+  colors[n++] = 0;
+
+  /* start greyscale colors at 4; 16 levels */
+  for (i = 0; i < 16; i++) {
+    temp = i*16;
+    if (temp > 255) temp = 255;
+    colors[n++] = 255 - temp;
+    colors[n++] = 255 - temp;
+    colors[n++] = 255 - temp;
+  }
+
+  /* start red fade at 20; 16 levels */
+  for (i = 0; i < 16; i++) {
+    temp = i*16;
+    if (temp > 255) temp = 255;
+    colors[n++] = 255 - temp;
+    colors[n++] = 255 - pow(i/16.0+0.001, 0.3)*255;
+    colors[n++] = 65 - temp/4;
+  }
+
+  /* start blue fade at 36; 16 levels */
+  for (i = 0; i < 16; i++) {
+    temp = i*16;
+    if (temp > 255) temp = 255;
+    colors[n++] = 32 - temp/8;
+    colors[n++] = 180 - pow(i/16.0+0.001, 0.3)*180;
+    colors[n++] = 255 - temp;
+  }
+
+  /* random colors start at 52 */
+  numRandomColors = MAX_TRAIL_LEN;
+
+  colors[n++] = random()&255;
+  colors[n++] = random()&255;
+  colors[n++] = colors[n-2]/2 + colors[n-3]/2;
+
+  for (i = 0; i < numRandomColors; i++) {
+    colors[n++] = (colors[n-3] + (random()&31) - 16)&255;
+    colors[n++] = (colors[n-3] + (random()&31) - 16)&255;
+    colors[n++] = colors[n-2]/(float)(i+2) + colors[n-3]/(float)(i+2);
+  }
+  
+  numColors = n/3 + 1;
+}
+
+static int initGraphics(void) {
+  XGCValues xgcv;
+  XWindowAttributes xgwa;
+  XSetWindowAttributes xswa;
+  Colormap cmap;
+  XColor color;
+  int n, i;
+  
+  initCMap();
+
+  XGetWindowAttributes(dpy,win,&xgwa);
+  cmap=xgwa.colormap;
+  xswa.backing_store=Always;
+  XChangeWindowAttributes(dpy,win,CWBackingStore,&xswa);
+  xgcv.function=GXcopy;
+
+  delay = get_integer_resource("delay","Integer");
+  
+  xgcv.foreground=get_pixel_resource ("background", "Background", dpy, cmap);
+  fgc[0]=XCreateGC(dpy, win, GCForeground|GCFunction,&xgcv);
+  
+  n=0;
+  if (mono_p) {
+    xgcv.foreground=get_pixel_resource ("foreground", "Foreground", dpy, cmap);
+    fgc[1]=XCreateGC(dpy,win,GCForeground|GCFunction,&xgcv);
+    for (i=0;i<numColors;i+=2) fgc[i]=fgc[0];
+    for (i=1;i<numColors;i+=2) fgc[i]=fgc[1];
+  } else {
+    for (i = 0; i < numColors; i++) {
+      color.red=colors[n++]<<8;
+      color.green=colors[n++]<<8;
+      color.blue=colors[n++]<<8;
+      color.flags=DoRed|DoGreen|DoBlue;
+      XAllocColor(dpy,cmap,&color);
+      xgcv.foreground=color.pixel;
+      fgc[i] = XCreateGC(dpy, win, GCForeground | GCFunction,&xgcv);
+    }
+  }
+  cgc = XCreateGC(dpy,win,GCForeground|GCFunction,&xgcv);
+  XSetGraphicsExposures(dpy,cgc,False);
+
+  xsize = xgwa.width;
+  ysize = xgwa.height;
+  xc = xsize >> 1;
+  yc = ysize >> 1;
+
+  maxx = 1.0;
+  maxy = ysize/(float)xsize;
+
+  if (colorScheme < 0) colorScheme = random()%NUM_SCHEMES;
+
+  return True;
+}
+
+static void initBugs(void) {
+  register bug *b;
+  int i;
+
+  head = tail = 0;
+
+  bzero((char *)bugs, MAX_BUGS*sizeof(bug));
+  bzero((char *)targets, MAX_TARGETS*sizeof(bug));
+
+  if (ntargets < 0) ntargets = (0.25+frand(0.75)*frand(1))*MAX_TARGETS;
+  if (ntargets < 1) ntargets = 1;
+
+  if (nbugs < 0) nbugs = (0.25+frand(0.75)*frand(1))*MAX_BUGS;
+  if (nbugs <= ntargets) nbugs = ntargets+1;
+
+  if (trailLen < 0) {
+    trailLen = (1.0 - frand(0.6)*frand(1))*MAX_TRAIL_LEN;
+  }
+
+  if (nbugs > MAX_BUGS) nbugs = MAX_BUGS;
+  if (ntargets > MAX_TARGETS) ntargets = MAX_TARGETS;
+  if (trailLen > MAX_TRAIL_LEN) trailLen = MAX_TRAIL_LEN;
+
+  b = bugs;
+  for (i = 0; i < nbugs; i++, b++) {
+    b->pos[0] = frand(maxx);
+    b->pos[1] = frand(maxy);
+    b->vel[0] = frand(maxVel/2);
+    b->vel[1] = frand(maxVel/2);
+
+    b->hist[head][0] = b->pos[0]*xsize;
+    b->hist[head][1] = b->pos[1]*xsize;
+    b->closest = &targets[random()%ntargets];
+  }
+
+  b = targets;
+  for (i = 0; i < ntargets; i++, b++) {
+    b->pos[0] = frand(maxx);
+    b->pos[1] = frand(maxy);
+
+    b->vel[0] = frand(targetVel/2);
+    b->vel[1] = frand(targetVel/2);
+
+    b->hist[head][0] = b->pos[0]*xsize;
+    b->hist[head][1] = b->pos[1]*xsize;
+  }
+}
+
+static void pickNewTargets(void) {
+  register int i;
+  register bug *b;
+
+  b = bugs;
+  for (i = 0; i < nbugs; i++, b++) {
+    b->closest = &targets[random()%ntargets];
+  }
+}
+
+#if 0
+static void addBugs(int numToAdd) {
+  register bug *b;
+  int i;
+
+  if (numToAdd + nbugs > MAX_BUGS) numToAdd = MAX_BUGS-nbugs;
+  else if (numToAdd < 0) numToAdd = 0;
+
+  for (i = 0; i < numToAdd; i++) {
+    b = &bugs[random()%nbugs];
+    bcopy((char *)b, (char *)&bugs[nbugs+i], sizeof(bug));
+    b->closest = &targets[random()%ntargets];
+  }
+
+  nbugs += numToAdd;
+}
+
+static void addTargets(int numToAdd) {
+  register bug *b;
+  int i;
+
+  if (numToAdd + ntargets > MAX_TARGETS) numToAdd = MAX_TARGETS-ntargets;
+  else if (numToAdd < 0) numToAdd = 0;
+
+  for (i = 0; i < numToAdd; i++) {
+    b = &targets[random()%ntargets];
+    bcopy((char *)b, (char *)&targets[ntargets+i], sizeof(bug));
+    b->closest = &targets[random()%ntargets];
+  }
+
+  ntargets += numToAdd;
+}
+#endif
+
+static void computeConstants(void) {
+  halfDtSq = dt*dt*0.5;
+  dtInv = 1.0/dt;
+  targetVelSq = targetVel*targetVel;
+  maxVelSq = maxVel*maxVel;
+  minVel = maxVel*minVelMultiplier;
+  minVelSq = minVel*minVel;
+}
+
+void computeColorIndices(void) {
+  int i;
+  int schizoLength;
+
+  /* note: colors are used in *reverse* order! */
+
+  /* grayscale */
+  for (i = 0; i < trailLen; i++) {
+    grayIndex[trailLen-1-i] = 4 + i*16.0/trailLen + 0.5;
+    if (grayIndex[trailLen-1-i] > 19) grayIndex[trailLen-1-i] = 19;
+  }
+
+  /* red */
+  for (i = 0; i < trailLen; i++) {
+    redIndex[trailLen-1-i] = 20 + i*16.0/trailLen + 0.5;
+    if (redIndex[trailLen-1-i] > 35) redIndex[trailLen-1-i] = 35;
+  }
+
+  /* blue */
+  for (i = 0; i < trailLen; i++) {
+    blueIndex[trailLen-1-i] = 36 + i*16.0/trailLen + 0.5;
+    if (blueIndex[trailLen-1-i] > 51) blueIndex[trailLen-1-i] = 51;
+  }
+
+  /* gray schizo - same as gray*/
+  for (i = 0; i < trailLen; i++) {
+    graySIndex[trailLen-1-i] = 4 + i*16.0/trailLen + 0.5;
+    if (graySIndex[trailLen-1-i] > 19) graySIndex[trailLen-1-i] = 19;
+  }
+
+  schizoLength = trailLen/4;
+  if (schizoLength < 3) schizoLength = 3;
+  /* red schizo */
+  for (i = 0; i < trailLen; i++) {
+    /*    redSIndex[trailLen-1-i] = 
+         20 + 16.0*(i%schizoLength)/(schizoLength-1.0) + 0.5;*/
+    redSIndex[trailLen-1-i] = 20 + i*16.0/trailLen + 0.5;
+    if (redSIndex[trailLen-1-i] > 35) redSIndex[trailLen-1-i] = 35;
+  }
+
+  schizoLength = trailLen/2;
+  if (schizoLength < 3) schizoLength = 3;
+  /* blue schizo is next */
+  for (i = 0; i < trailLen; i++) {
+    blueSIndex[trailLen-1-i] = 
+      36 + 16.0*(i%schizoLength)/(schizoLength-1.0) + 0.5;
+    if (blueSIndex[trailLen-1-i] > 51) blueSIndex[trailLen-1-i] = 51;
+  }
+
+  /* random is next */
+  for (i = 0; i < trailLen; i++) {
+    randomIndex[i] = 52 + random()%(numRandomColors);
+  }
+}
+
+#if 0
+static void setParams(bugParams *p) {
+  dt = p->dt;
+  targetVel = p->targetVel;
+  targetAcc = p->targetAcc;
+  maxVel = p->maxVel;
+  maxAcc = p->maxAcc;
+  noise = p->noise;
+
+  nbugs = p->nbugs;
+  ntargets = p->ntargets;
+  trailLen = p->trailLen;
+  colorScheme = p->colorScheme;
+  changeProb = p->changeProb;
+  computeConstants();
+  computeColorIndices();
+}
+#endif
+
+static void drawBugs(int *tColorIdx, int tci0, int tnc,
+                    int *colorIdx, int ci0, int nc) {
+  register bug *b;
+  register int i, j;
+  int temp;
+
+  if (((head+1)%trailLen) == tail) {
+    /* first, erase last segment of bugs if necessary */
+    temp = (tail+1) % trailLen;
+    
+    b = bugs;
+    for (i = 0; i < nbugs; i++, b++) {
+      XDrawLine(dpy, win, fgc[0],
+               b->hist[tail][0], b->hist[tail][1],
+               b->hist[temp][0], b->hist[temp][1]);
+    }
+  
+    b = targets;
+    for (i = 0; i < ntargets; i++, b++) {
+      XDrawLine(dpy, win, fgc[0],
+               b->hist[tail][0], b->hist[tail][1],
+               b->hist[temp][0], b->hist[temp][1]);
+    }
+    tail = (tail+1)%trailLen;
+  }
+  
+  for (j = tail; j != head; j = temp) {
+    temp = (j+1)%trailLen;
+
+    b = bugs;
+    for (i = 0; i < nbugs; i++, b++) {
+      XDrawLine(dpy, win, fgc[colorIdx[ci0]],
+               b->hist[j][0], b->hist[j][1],
+               b->hist[temp][0], b->hist[temp][1]);
+    }
+    
+    b = targets;
+    for (i = 0; i < ntargets; i++, b++) {
+      XDrawLine(dpy, win, fgc[tColorIdx[tci0]],
+               b->hist[j][0], b->hist[j][1],
+               b->hist[temp][0], b->hist[temp][1]);
+    }
+    ci0 = (ci0+1)%nc;  
+    tci0 = (tci0+1)%tnc;  
+  }
+}
+
+static void clearBugs(void) {
+  register bug *b;
+  register int i, j;
+  int temp;
+
+  tail = tail-1;
+  if (tail < 0) tail = trailLen-1;
+
+  if (((head+1)%trailLen) == tail) {
+    /* first, erase last segment of bugs if necessary */
+    temp = (tail+1) % trailLen;
+    
+    b = bugs;
+    for (i = 0; i < nbugs; i++, b++) {
+      XDrawLine(dpy, win, fgc[0],
+               b->hist[tail][0], b->hist[tail][1],
+               b->hist[temp][0], b->hist[temp][1]);
+    }
+  
+    b = targets;
+    for (i = 0; i < ntargets; i++, b++) {
+      XDrawLine(dpy, win, fgc[0],
+               b->hist[tail][0], b->hist[tail][1],
+               b->hist[temp][0], b->hist[temp][1]);
+    }
+    tail = (tail+1)%trailLen;
+  }
+  
+  for (j = tail; j != head; j = temp) {
+    temp = (j+1)%trailLen;
+
+    b = bugs;
+    for (i = 0; i < nbugs; i++, b++) {
+      XDrawLine(dpy, win, fgc[0],
+               b->hist[j][0], b->hist[j][1],
+               b->hist[temp][0], b->hist[temp][1]);
+    }
+    
+    b = targets;
+    for (i = 0; i < ntargets; i++, b++) {
+      XDrawLine(dpy, win, fgc[0],
+               b->hist[j][0], b->hist[j][1],
+               b->hist[temp][0], b->hist[temp][1]);
+    }
+  }
+}
+
+void updateState(void) {
+  register int i;
+  register bug *b;
+  register float ax, ay, temp;
+  float theta;
+  static int checkIndex = 0;
+  bug *b2;
+  int j;
+
+  head = (head+1)%trailLen;
+  
+  for (j = 0; j < 5; j++) {
+    /* update closets bug for the bug indicated by checkIndex */
+    checkIndex = (checkIndex+1)%nbugs;
+    b = &bugs[checkIndex];
+
+    ax = b->closest->pos[0] - b->pos[0];
+    ay = b->closest->pos[1] - b->pos[1];
+    temp = ax*ax + ay*ay;
+    for (i = 0; i < ntargets; i++) {
+      b2 = &targets[i];
+      if (b2 == b->closest) continue;
+      ax = b2->pos[0] - b->pos[0];
+      ay = b2->pos[1] - b->pos[1];
+      theta = ax*ax + ay*ay;
+      if (theta < temp*2) {
+       b->closest = b2;
+       temp = theta;
+      }
+    }
+  }
+  
+  /* update target state */
+
+  b = targets;
+  for (i = 0; i < ntargets; i++, b++) {
+    theta = frand(6.28);
+    ax = targetAcc*cos(theta);
+    ay = targetAcc*sin(theta);
+
+    b->vel[0] += ax*dt;
+    b->vel[1] += ay*dt;
+
+    /* check velocity */
+    temp = sq(b->vel[0]) + sq(b->vel[1]);
+    if (temp > targetVelSq) {
+      temp = targetVel/sqrt(temp);
+      /* save old vel for acc computation */
+      ax = b->vel[0];
+      ay = b->vel[1];
+
+      /* compute new velocity */
+      b->vel[0] *= temp;
+      b->vel[1] *= temp;
+      
+      /* update acceleration */
+      ax = (b->vel[0]-ax)*dtInv;
+      ay = (b->vel[1]-ay)*dtInv;
+    }
+
+    /* update position */
+    b->pos[0] += b->vel[0]*dt + ax*halfDtSq;
+    b->pos[1] += b->vel[1]*dt + ay*halfDtSq;
+
+    /* check limits on targets */
+    if (b->pos[0] < 0) {
+      /* bounce */
+      b->pos[0] = -b->pos[0];
+      b->vel[0] = -b->vel[0];
+    } else if (b->pos[0] >= maxx) {
+      /* bounce */
+      b->pos[0] = 2*maxx-b->pos[0];
+      b->vel[0] = -b->vel[0];
+    }
+    if (b->pos[1] < 0) {
+      /* bounce */
+      b->pos[1] = -b->pos[1];
+      b->vel[1] = -b->vel[1];
+    } else if (b->pos[1] >= maxy) {
+      /* bounce */
+      b->pos[1] = 2*maxy-b->pos[1];
+      b->vel[1] = -b->vel[1];
+    }
+
+    b->hist[head][0] = b->pos[0]*xsize;
+    b->hist[head][1] = b->pos[1]*xsize;
+  }
+
+  /* update bug state */
+  b = bugs;
+  for (i = 0; i < nbugs; i++, b++) {
+    theta = atan2(b->closest->pos[1] - b->pos[1] + frand(noise),
+                 b->closest->pos[0] - b->pos[0] + frand(noise));
+    ax = maxAcc*cos(theta);
+    ay = maxAcc*sin(theta);
+
+    b->vel[0] += ax*dt;
+    b->vel[1] += ay*dt;
+
+    /* check velocity */
+    temp = sq(b->vel[0]) + sq(b->vel[1]);
+    if (temp > maxVelSq) {
+      temp = maxVel/sqrt(temp);
+
+      /* save old vel for acc computation */
+      ax = b->vel[0];
+      ay = b->vel[1];
+
+      /* compute new velocity */
+      b->vel[0] *= temp;
+      b->vel[1] *= temp;
+      
+      /* update acceleration */
+      ax = (b->vel[0]-ax)*dtInv;
+      ay = (b->vel[1]-ay)*dtInv;
+    } else if (temp < minVelSq) {
+      temp = minVel/sqrt(temp);
+
+      /* save old vel for acc computation */
+      ax = b->vel[0];
+      ay = b->vel[1];
+
+      /* compute new velocity */
+      b->vel[0] *= temp;
+      b->vel[1] *= temp;
+      
+      /* update acceleration */
+      ax = (b->vel[0]-ax)*dtInv;
+      ay = (b->vel[1]-ay)*dtInv;
+    }
+
+    /* update position */
+    b->pos[0] += b->vel[0]*dt + ax*halfDtSq;
+    b->pos[1] += b->vel[1]*dt + ay*halfDtSq;
+
+    /* check limits on targets */
+    if (b->pos[0] < 0) {
+      /* bounce */
+      b->pos[0] = -b->pos[0];
+      b->vel[0] = -b->vel[0];
+    } else if (b->pos[0] >= maxx) {
+      /* bounce */
+      b->pos[0] = 2*maxx-b->pos[0];
+      b->vel[0] = -b->vel[0];
+    }
+    if (b->pos[1] < 0) {
+      /* bounce */
+      b->pos[1] = -b->pos[1];
+      b->vel[1] = -b->vel[1];
+    } else if (b->pos[1] >= maxy) {
+      /* bounce */
+      b->pos[1] = 2*maxy-b->pos[1];
+      b->vel[1] = -b->vel[1];
+    }
+
+    b->hist[head][0] = b->pos[0]*xsize;
+    b->hist[head][1] = b->pos[1]*xsize;
+  }
+}
+
+void mutateBug(int which) {
+  int i, j;
+
+  if (which == 0) {
+    /* turn bug into target */
+    if (ntargets < MAX_TARGETS-1 && nbugs > 1) {
+      i = random() % nbugs;
+      bcopy((char *)&bugs[i], (char *)&targets[ntargets], sizeof(bug));
+      bcopy((char *)&bugs[nbugs-1], (char *)&bugs[i], sizeof(bug));
+      targets[ntargets].pos[0] = frand(maxx);
+      targets[ntargets].pos[1] = frand(maxy);
+      nbugs--;
+      ntargets++;
+
+      for (i = 0; i < nbugs; i += ntargets) {
+       bugs[i].closest = &targets[ntargets-1];
+      }
+    }
+  } else {
+    /* turn target into bug */
+    if (ntargets > 1 && nbugs < MAX_BUGS-1) {
+      /* pick a target */
+      i = random() % ntargets;
+
+      /* copy state into a new bug */
+      bcopy((char *)&targets[i], (char *)&bugs[nbugs], sizeof(bug));
+      ntargets--;
+
+      /* pick a target for the new bug */
+      bugs[nbugs].closest = &targets[random()%ntargets];
+
+      for (j = 0; j < nbugs; j++) {
+       if (bugs[j].closest == &targets[ntargets]) {
+         bugs[j].closest = &targets[i];
+       } else if (bugs[j].closest == &targets[i]) {
+         bugs[j].closest = &targets[random()%ntargets];
+       }
+      }
+      nbugs++;
+      
+      /* copy the last ntarget into the one we just deleted */
+      bcopy((char *)&targets[ntargets], &targets[i], sizeof(bug));
+    }
+  }
+}
+
+void mutateParam(float *param) {
+  *param *= 0.75+frand(0.5);
+}
+
+void randomSmallChange(void) {
+  int whichCase = 0;
+  static int callDepth = 0;
+
+  whichCase = random()%11;
+
+  if (++callDepth > 10) {
+    callDepth--;
+    return;
+  }
+  
+  switch(whichCase) {
+  case 0:
+    /* acceleration */
+    mutateParam(&maxAcc);
+    break;
+
+  case 1:
+    /* target acceleration */
+    mutateParam(&targetAcc);
+    break;
+
+  case 2:
+    /* velocity */
+    mutateParam(&maxVel);
+    break;
+
+  case 3: 
+    /* target velocity */
+    mutateParam(&targetVel);
+    break;
+
+  case 4:
+    /* noise */
+    mutateParam(&noise);
+    break;
+
+  case 5:
+    /* minVelMultiplier */
+    mutateParam(&minVelMultiplier);
+    break;
+    
+  case 6:
+  case 7:
+    /* target to bug */
+    if (ntargets < 2) break;
+    mutateBug(1);
+    break;
+
+  case 8:
+    /* bug to target */
+    if (nbugs < 2) break;
+    mutateBug(0);
+    if (nbugs < 2) break;
+    mutateBug(0);
+    break;
+
+  case 9:
+    /* color scheme */
+    colorScheme = random()%NUM_SCHEMES;
+    if (colorScheme == RANDOM_SCHIZO || colorScheme == COLOR_SCHIZO) {
+      /* don't use these quite as much */
+      colorScheme = random()%NUM_SCHEMES;
+    }
+    break;
+
+  default:
+    randomSmallChange();
+    randomSmallChange();
+    randomSmallChange();
+    randomSmallChange();
+  }
+
+  if (minVelMultiplier < 0.3) minVelMultiplier = 0.3;
+  else if (minVelMultiplier > 0.9) minVelMultiplier = 0.9;
+  if (noise < 0.01) noise = 0.01;
+  if (maxVel < 0.02) maxVel = 0.02;
+  if (targetVel < 0.02) targetVel = 0.02;
+  if (targetAcc > targetVel*0.7) targetAcc = targetVel*0.7;
+  if (maxAcc > maxVel*0.7) maxAcc = maxVel*0.7;
+  if (targetAcc > targetVel*0.7) targetAcc = targetVel*0.7;
+  if (maxAcc < 0.01) maxAcc = 0.01;
+  if (targetAcc < 0.005) targetAcc = 0.005;
+
+  computeConstants();
+  callDepth--;
+}
+
+void randomBigChange(void) {
+  static int whichCase = 0;
+  static int callDepth = 0;
+  int temp;
+
+  whichCase = random()%4;
+  
+  if (++callDepth > 3) {
+    callDepth--;
+    return;
+  }
+
+  switch(whichCase) {
+  case 0:
+    /* trail length */
+    temp = (random()%(MAX_TRAIL_LEN-25)) + 25;
+    clearBugs();
+    trailLen = temp;
+    computeColorIndices();
+    initBugs();
+    break;
+
+  case 1:  
+    /* Whee! */
+    randomSmallChange();
+    randomSmallChange();
+    randomSmallChange();
+    randomSmallChange();
+    randomSmallChange();
+    randomSmallChange();
+    randomSmallChange();
+    randomSmallChange();
+    break;
+
+  case 2:
+    clearBugs();
+    initBugs();
+    break;
+    
+  case 3:
+    pickNewTargets();
+    break;
+    
+  default:
+    temp = random()%ntargets;
+    targets[temp].pos[0] += frand(maxx/4)-maxx/8;
+    targets[temp].pos[1] += frand(maxy/4)-maxy/8;
+    /* updateState() will fix bounds */
+    break;
+  }
+
+  callDepth--;
+}
+
+void updateColorIndex(int **tColorIdx, int *tci0, int *tnc,
+                     int **colorIdx, int *ci0, int *nc) {
+  switch(colorScheme) {
+  case COLOR_TRAILS:
+    *tColorIdx = redIndex;
+    *tci0 = 0;
+    *tnc = trailLen;
+    *colorIdx = blueIndex;
+    *ci0 = 0;
+    *nc = trailLen;
+    break;
+
+  case GRAY_SCHIZO:
+    *tColorIdx = graySIndex;
+    *tci0 = head;
+    *tnc = trailLen;
+    *colorIdx = graySIndex;
+    *ci0 = head;
+    *nc = trailLen;
+    break;
+
+  case COLOR_SCHIZO:
+    *tColorIdx = redSIndex;
+    *tci0 = head;
+    *tnc = trailLen;
+    *colorIdx = blueSIndex;
+    *ci0 = head;
+    *nc = trailLen;
+    break;
+
+  case GRAY_TRAILS:
+    *tColorIdx = grayIndex;
+    *tci0 = 0;
+    *tnc = trailLen;
+    *colorIdx = grayIndex;
+    *ci0 = 0;
+    *nc = trailLen;
+    break;
+
+  case RANDOM_TRAILS:
+    *tColorIdx = redIndex;
+    *tci0 = 0;
+    *tnc = trailLen;
+    *colorIdx = randomIndex;
+    *ci0 = 0;
+    *nc = trailLen;
+    break;
+
+  case RANDOM_SCHIZO:
+    *tColorIdx = redIndex;
+    *tci0 = head;
+    *tnc = trailLen;
+    *colorIdx = randomIndex;
+    *ci0 = head;
+    *nc = trailLen;
+    break;
+  }
+}
+
+#if HAVE_GETTIMEOFDAY
+static struct timeval startupTime;
+static void initTime(void) {
+#if GETTIMEOFDAY_TWO_ARGS
+  gettimeofday(&startupTime, NULL);
+#else
+  gettimeofday(&startupTime);
+#endif
+}
+
+static double getTime(void) {
+  struct timeval t;
+  float f;
+#if GETTIMEOFDAY_TWO_ARGS
+  gettimeofday(&t, NULL);
+#else
+  gettimeofday(&t);
+#endif
+  t.tv_sec -= startupTime.tv_sec;
+  f = ((double)t.tv_sec) + t.tv_usec*1e-6;
+  return f;
+}
+#endif
+
+void screenhack(Display *d, Window w) {
+  int nframes, i;
+  float fps;
+  float timePerFrame, elapsed;
+  int *targetColorIndex, *colorIndex;
+  int targetStartColor, targetNumColors;
+  int startColor, numColors;
+  double start, end;
+  int cnt;
+
+  dpy = d;
+  win = w;
+
+  if (!initGraphics()) return;
+
+  computeConstants();
+  initBugs();
+  initTime();
+  computeColorIndices();
+
+  if (changeProb > 0) {
+    for (i = random()%5+5; i >= 0; i--) {
+      randomSmallChange();
+    }
+  }
+
+  nframes = 0;
+#if HAVE_GETTIMEOFDAY
+  start = getTime();
+#endif
+
+  while (1) {
+    if (delay > 0) {
+      cnt = 2;
+      dt = DESIRED_DT/2;
+    } else {
+      cnt = 1;
+      dt = DESIRED_DT;
+    }
+
+    for (; cnt > 0; cnt--) {
+      updateState();
+      updateColorIndex(&targetColorIndex, &targetStartColor, &targetNumColors,
+                      &colorIndex, &startColor, &numColors);
+      drawBugs(targetColorIndex, targetStartColor, targetNumColors,
+              colorIndex, startColor, numColors);
+      XSync(dpy, False);
+      screenhack_handle_events (dpy);
+    }
+#if HAVE_GETTIMEOFDAY
+    end = getTime();
+    nframes++;
+
+    if (end > start+0.5) {
+      if (frand(1.0) < changeProb) randomSmallChange();
+      if (frand(1.0) < changeProb*0.3) randomBigChange();
+      elapsed = end-start;
+       
+      timePerFrame = elapsed/nframes - delay*1e-6;
+      fps = nframes/elapsed;
+      /*
+      printf("elapsed: %.3f\n", elapsed);
+      printf("fps: %.1f  secs per frame: %.3f  delay: %f\n", 
+            fps, timePerFrame, delay);
+      */
+
+      if (fps > MAX_FPS) {
+#if 0    
+       if (trailLen >= MAX_TRAIL_LEN) {
+         addBugs(nbugs);
+         addTargets(ntargets);
+       } else {
+         /* make dt smaller, but use longer tail */
+         clearBugs();
+         dt = 0.1*trailLen/MAX_TRAIL_LEN;
+         trailLen = MAX_TRAIL_LEN;
+         computeColorIndices();
+         initBugs();
+       }
+#endif
+       delay = (1.0/MAX_FPS - (timePerFrame + delay*1e-6))*1e6;
+       
+      } else if (dt*fps < MIN_FPS*DESIRED_DT) {
+       /* need to speed things up somehow */
+       if (0 && nbugs > 10) {
+         /*printf("reducing bugs to improve speed.\n");*/
+         clearBugs();
+         nbugs *= fps/MIN_FPS;
+         if (ntargets >= nbugs/2) mutateBug(1);
+       } else if (0 && dt < 0.3) {
+         /*printf("increasing dt to improve speed.\n");*/
+         dt *= MIN_FPS/fps;
+         computeConstants();
+       } else if (trailLen > 10) {
+         /*printf("reducing trail length to improve speed.\n");*/
+         clearBugs();
+         trailLen = trailLen * (fps/MIN_FPS);
+         if (trailLen < 10) trailLen = 10;
+         computeColorIndices();
+         initBugs();
+       }
+      }
+
+      start = getTime();
+      nframes = 0;
+    }
+#else
+    if (frand(1) < changeProb*2/100.0) randomSmallChange();
+    if (frand(1) < changeProb*0.3/100.0) randomBigChange();
+#endif
+
+    if (delay > 0) usleep(delay);
+  }
+}
index 5119f319dd6c6b0a4b34f7c52e1da557bf5cb2cd..fd839f4f0932df3d665abcb6390a8096dd5a4b1e 100644 (file)
--- a/setup.com
+++ b/setup.com
@@ -38,6 +38,7 @@ $ greynetic   :== $'mydir'greynetic
 $ halo         :== $'mydir'halo
 $ helix                :== $'mydir'helix
 $ hopalong     :== $'mydir'hopalong
+$ hyperball    :== $'mydir'hyperball
 $ hypercube    :== $'mydir'hypercube
 $ ifs          :== $'mydir'ifs
 $ imsmap       :== $'mydir'imsmap
@@ -93,6 +94,7 @@ $ xflame      :== $'mydir'xflame
 $ xjack                :== $'mydir'xjack
 $ xlyap                :== $'mydir'xlyap
 $ xmatrix      :== $'mydir'xmatrix
+$ xrayswarm    :== $'mydir'xrayswarm
 $ xroger       :== $'mydir'xroger
 $ xspirograph  :== $'mydir'xspirograph
 $ xsublim      :== $'mydir'xsublim
index 858c4d59397832caa8948db583adb4dcbdc19e76..efee7f7b36c195cf6597c0c44124ac1a1a146d91 100644 (file)
@@ -1,4 +1,4 @@
-# utils/Makefile.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
+# utils/Makefile.in --- xscreensaver, Copyright (c) 1997-2000 Jamie Zawinski.
 # the `../configure' script generates `utils/Makefile' from this file.
 
 
index 9fc0b781eacdc53af22fb36349858bcd5a9d572f..38b0c669e9b0a2249a717f20409652b4d3225d9c 100644 (file)
@@ -318,13 +318,19 @@ grab_video_frame(Screen *screen, Visual *visual, Drawable dest)
     {
       int i;
       VLServer server = vlOpenVideo (NULL);
+
+      if (!server) return False;
+
       for (i = 0; i < 5; i++)  /* if we get all black images, retry up to
                                   five times. */
        {
          VLDevList dl;
          int j;
-         vlGetDeviceList(server, &dl);
-         vlCloseVideo(server);
+
+          j = vlGetDeviceList(server, &dl);
+          vlCloseVideo(server);
+          if (j < 0) return False;
+
          for (j = 0; j < dl.numDevices; j++)
            {
              VLDevice *d = &dl.devices[j];
index ef0ef62f3e48a6e37992dfe5ce23b634572999bf..0d243a4a3757347077c57511ca0b87e5c443d389 100644 (file)
@@ -1,2 +1,2 @@
 static const char screensaver_id[] =
-       "@(#)xscreensaver 3.25 (18-Jul-2000), by Jamie Zawinski (jwz@jwz.org)";
+       "@(#)xscreensaver 3.26 (10-Nov-2000), by Jamie Zawinski (jwz@jwz.org)";
index 57b73151c53f6a4cd7a7c3611c08f389520bb573..4e88bea5a36a378ade0b23bff3635f181c50e4f4 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999
+/* xscreensaver, Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
  *  by Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
@@ -36,8 +36,6 @@ static Visual *pick_best_visual (Screen *, Bool, Bool);
 static Visual *pick_mono_visual (Screen *);
 static Visual *pick_best_visual_of_class (Screen *, int);
 static Visual *pick_best_gl_visual (Screen *);
-static Visual *id_to_visual (Screen *, int);
-static Visual *id_to_visual (Screen *screen, int id);
 
 
 #define DEFAULT_VISUAL -1
@@ -338,7 +336,7 @@ pick_best_gl_visual (Screen *screen)
 }
 
 
-static Visual *
+Visual *
 id_to_visual (Screen *screen, int id)
 {
   Display *dpy = DisplayOfScreen (screen);
index dd45708ea0643b89adb20d67fbfd6da86554b970..f7e8a7a58a2430f710aa8ec67aa9f3319adc15dd 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1993-1999 by Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1993-2000 by Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -23,6 +23,7 @@ extern Visual *find_similar_visual (Screen *, Visual *old);
 extern void describe_visual (FILE *f, Screen *, Visual *, Bool private_cmap_p);
 extern Visual *get_overlay_visual (Screen *, unsigned long *pixel_return);
 extern Bool has_writable_cells (Screen *screen, Visual *visual);
+extern Visual *id_to_visual (Screen *screen, int id);
 
 Visual *get_gl_visual (Screen *screen);
 
index e746d0f702e595eda0fc1b54974febb839b8ea0f..8ff900d57ade90f58c253d56e12bbc6e04c4b190 100644 (file)
@@ -1,7 +1,7 @@
 Begin3
 Title:          xscreensaver
-Version:        3.25
-Entered-date:   19JUL00
+Version:        3.26
+Entered-date:   10NOV00
 Description:    A modular screen saver and locker for the X Window System.
                 Highly customizable: allows the use of any program that
                 can draw on the root window as a display mode.
@@ -10,16 +10,16 @@ Keywords:       screen saver, screen lock, lock, xlock, X11
 Author:         jwz@jwz.org (Jamie Zawinski)
 Maintained-by:  jwz@jwz.org (Jamie Zawinski)
 Primary-site:   http://www.jwz.org/xscreensaver/
-                1284K xscreensaver-3.25.tar.gz
-                41K  xscreensaver.README
+                1328K xscreensaver-3.26.tar.gz
+                42K  xscreensaver.README
                 1K   xscreensaver.lsm
 Alternate-site: sunsite.unc.edu /pub/Linux/X11/screensavers/
-                1284K xscreensaver-3.25.tar.gz
-                41K  xscreensaver.README
+                1328K xscreensaver-3.26.tar.gz
+                42K  xscreensaver.README
                 1K   xscreensaver.lsm
 Alternate-site: ftp.x.org /contrib/applications/
-                1284K xscreensaver-3.25.tar.gz
-                41K  xscreensaver.README
+                1328K xscreensaver-3.26.tar.gz
+                42K  xscreensaver.README
                 1K   xscreensaver.lsm
 Platforms:      Linux, Irix, SunOS, Solaris, HPUX, AIX, FreeBSD, NetBSD,
                 BSDI, SCO, OSF1, Ultrix, VMS.
index d4cfb709f18cb714d1670cd9cda0e0bac437e770..828bb137af083f4705b37ad593711ba318021615 100644 (file)
@@ -1,5 +1,5 @@
 %define        name    xscreensaver
-%define        version 3.25
+%define        version 3.26
 %define        release 1
 %define        serial  1
 %define        prefix  /usr/X11R6
@@ -93,20 +93,22 @@ make  install_prefix=$RPM_BUILD_ROOT \
       AD_DIR=%{prefix}/lib/X11/app-defaults \
       install-strip
 
-# Make a pair of lists, of the GL and non-GL hacks.
+# Make a pair of lists, of the GL and non-GL executable.
 # Do this by parsing the output of a dummy run of "make install"
-# in the hacks/ and hacks/glx/ directories.
+# in the driver/, hacks/ and hacks/glx/ directories.
 #
 list_files() {
-  make -s install_prefix=$RPM_BUILD_ROOT INSTALL=true install   |
-    sed -n -e 's@.* /\([^ ]*\)$@/\1@p'                          |
-    sed    -e "s@^$RPM_BUILD_ROOT@@"                            \
-           -e "s@/bin/..@@"                                     |
+  make -s install_prefix=$RPM_BUILD_ROOT INSTALL=true $1  |
+    sed -n -e 's@.* /\([^ ]*\)$@/\1@p'                    |
+    sed    -e "s@^$RPM_BUILD_ROOT@@"                      \
+           -e "s@/bin/\.\./@/@"                           |
     sort
 }
 
-( cd hacks ; list_files > $RPM_BUILD_DIR/xscreensaver-%{version}/hacks-non-gl )
-( cd hacks/glx ; list_files > $RPM_BUILD_DIR/xscreensaver-%{version}/hacks-gl )
+( cd hacks ; list_files install ; cd ../driver; list_files install-program ) \
+   > $RPM_BUILD_DIR/xscreensaver-%{version}/exes-non-gl
+( cd hacks/glx ; list_files install ) \
+   > $RPM_BUILD_DIR/xscreensaver-%{version}/exes-gl
 
 
 
@@ -130,21 +132,20 @@ chmod -R a+r,u+w,og-w $RPM_BUILD_ROOT
 if [ -d $RPM_BUILD_ROOT    ]; then rm -r $RPM_BUILD_ROOT    ; fi
 if [ -d $RPM_BUILD_ROOT-gl ]; then rm -r $RPM_BUILD_ROOT-gl ; fi
 
-%files -f hacks-non-gl
+%files -f exes-non-gl
 %defattr(-,root,root)
 
 # Files for the "xscreensaver" package:
 #
 %doc                README README.debugging
-                    %{prefix}/bin/*
 %dir                %{prefix}/lib/xscreensaver
 %config             %{prefix}/lib/X11/app-defaults/*
                     %{prefix}/man/man1/xscreensaver*
                     /etc/pam.d/*
 %config(missingok)  /usr/bin/*.kss
-%config(missingok)  "/usr/share/control-center/Desktop/screensaver-properties.desktop"
-%config(missingok)  "/usr/share/gnome/apps/Settings/Desktop/screensaver-properties.desktop"
+%config(missingok)  /usr/share/control-center/Desktop/screensaver-properties.desktop
+%config(missingok)  /usr/share/gnome/apps/Settings/Desktop/screensaver-properties.desktop
 
 # Files for the "xscreensaver-gl" package:
 #
-%{?USE_GL:%files -f hacks-gl gl}
+%{?USE_GL:%files -f exes-gl gl}