V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ; \
echo -n "Updating version number in $$S to \"$$V\"... " ; \
T=/tmp/xs.$$$$ ; \
- sed "s/^\(Version:[^0-9]*\)\(.*\)/\1$$V/" \
+ sed "s/^\(%define.version[^0-9]*\)\(.*\)/\1$$V/" \
< $$S > $$T ; \
if cmp -s $$S $$T ; then \
echo "unchanged." ; \
rm $$T
rpm::
- @ \
- VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/\1/p' utils/version.h` ; \
- DIR=/usr/src/redhat ; \
- cp -p xscreensaver-$$VERS.tar.gz $$DIR/SOURCES/ ; \
- rpm -ba xscreensaver.spec ; \
- rm -f $$DIR/xscreensaver-$$VERS.tar.gz ; \
- rm -rf $$DIR/BUILD/xscreensaver-$$VERS ; \
- mv $$DIR/RPMS/i386/xscreensaver-$$VERS-*.rpm . ; \
- mv $$DIR/SRPMS/xscreensaver-$$VERS-*.rpm . ; \
- echo '' ; \
- ls -lFG xscreensaver-$$VERS-*.rpm
+ @ \
+ VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/\1/p' utils/version.h` ; \
+ DIR=/usr/src/redhat ; \
+ cp -p xscreensaver-$$VERS.tar.gz $$DIR/SOURCES/ ; \
+ rpm --define "USE_GL yes" -ba xscreensaver.spec ; \
+ rm -f $$DIR/xscreensaver-$$VERS.tar.gz ; \
+ rm -rf $$DIR/BUILD/xscreensaver-$$VERS ; \
+ mv $$DIR/SRPMS/xscreensaver*-$$VERS-*.rpm . ; \
+ mv $$DIR/RPMS/i386/xscreensaver*-$$VERS-*.rpm . ; \
+ echo '' ; \
+ ls -lFG xscreensaver*-$$VERS-*.rpm
test-tar::
@ \
============
-Changes since 3.19: * Added new hack `ripples' and `sierpinski3d'.
+Changes since 3.20: * Tweaked the xscreensaver-demo UI (Gtk only.)
+ * Fixed a few visual selection bugs. I think the proper
+ GL visual should be used with nVidia systems now.
+ * Made the Makefiles obey $install_prefix.
+ * Made the `xscreensaver.spec' file able to generate both
+ GL and non-GL packages simultaniously.
+Changes since 3.19: * Added new hacks `ripples' and `sierpinski3d'.
* Made `xscreensaver-command -exit' be silent when no
screen saver was running (instead of complaining.)
* Made `webcollage' and `vidwhacker' use `xloadimage'
have_gl=no
ac_have_mesa_gl=no
with_gl_req=unspecified
+gl_halfassed=no
# Check whether --with-gl or --without-gl was given.
if test "${with_gl+set}" = set; then
withval="$with_gl"
/*)
echo $ac_n "checking for GL headers""... $ac_c" 1>&6
-echo "configure:6905: checking for GL headers" >&5
+echo "configure:6906: checking for GL headers" >&5
d=$with_gl/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for GL libs""... $ac_c" 1>&6
-echo "configure:6915: checking for GL libs" >&5
+echo "configure:6916: checking for GL libs" >&5
d=$with_gl/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6
-echo "configure:6951: checking for GL/gl.h" >&5
+echo "configure:6952: 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 6956 "configure"
+#line 6957 "configure"
#include "confdefs.h"
#include <GL/gl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6
-echo "configure:6992: checking for GL/glx.h" >&5
+echo "configure:6993: 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 6997 "configure"
+#line 6998 "configure"
#include "confdefs.h"
#include <GL/glx.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7003: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
# to link against.
#
echo $ac_n "checking whether GL is really MesaGL""... $ac_c" 1>&6
-echo "configure:7034: checking whether GL is really MesaGL" >&5
+echo "configure:7035: checking whether GL is really MesaGL" >&5
if eval "test \"`echo '$''{'ac_cv_have_mesa_gl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 7046 "configure"
+#line 7047 "configure"
#include "confdefs.h"
#include <GL/glx.h>
EOF
#
if test "$ac_have_mesa_gl" = yes; then
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:7075: checking for pthread_create in -lpthread" >&5
+echo "configure:7076: checking for pthread_create in -lpthread" >&5
ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7083 "configure"
+#line 7084 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
pthread_create()
; return 0; }
EOF
-if { (eval echo configure:7094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
echo $ac_n "checking for glXCreateContext in -lMesaGL""... $ac_c" 1>&6
-echo "configure:7141: checking for glXCreateContext in -lMesaGL" >&5
+echo "configure:7142: 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
ac_save_LIBS="$LIBS"
LIBS="-lMesaGL -lMesaGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7149 "configure"
+#line 7150 "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
glXCreateContext()
; return 0; }
EOF
-if { (eval echo configure:7160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
echo $ac_n "checking for glXCreateContext in -lGL""... $ac_c" 1>&6
-echo "configure:7206: checking for glXCreateContext in -lGL" >&5
+echo "configure:7207: 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
ac_save_LIBS="$LIBS"
LIBS="-lGL -lGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7214 "configure"
+#line 7215 "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
glXCreateContext()
; return 0; }
EOF
-if { (eval echo configure:7225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7226: \"$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
# we have headers, but no libs -- bail.
have_gl=no
ac_have_mesa_gl=no
+ gl_halfassed=yes
else
# linking works -- we can build the GL hacks.
cat >> confdefs.h <<\EOF
if test "$ac_have_mesa_gl" = yes; then
echo $ac_n "checking MesaGL version number""... $ac_c" 1>&6
-echo "configure:7282: checking MesaGL version number" >&5
+echo "configure:7284: 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 7287 "configure"
+#line 7289 "configure"
#include "confdefs.h"
#include <GL/gl.h>
configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
echo $ac_n "checking for glBindTexture in -l$gl_lib_1""... $ac_c" 1>&6
-echo "configure:7353: checking for glBindTexture in -l$gl_lib_1" >&5
+echo "configure:7355: checking for glBindTexture in -l$gl_lib_1" >&5
ac_lib_var=`echo $gl_lib_1'_'glBindTexture | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7361 "configure"
+#line 7363 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
glBindTexture()
; return 0; }
EOF
-if { (eval echo configure:7372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7374: \"$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
# 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:7406: checking whether drastic GL measures must be taken" >&5
+echo "configure:7408: checking whether drastic GL measures must be taken" >&5
case "$host" in
*-sgi*)
echo "$ac_t""yes -- hello, SGI." 1>&6
have_gle=no
with_gle_req=unspecified
+gle_halfassed=no
# Check whether --with-gle or --without-gle was given.
if test "${with_gle+set}" = set; then
withval="$with_gle"
/*)
echo $ac_n "checking for GLE headers""... $ac_c" 1>&6
-echo "configure:7458: checking for GLE headers" >&5
+echo "configure:7461: checking for GLE headers" >&5
d=$with_gle/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for GLE libs""... $ac_c" 1>&6
-echo "configure:7468: checking for GLE libs" >&5
+echo "configure:7471: checking for GLE libs" >&5
d=$with_gle/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
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:7504: checking for GL/gutil.h" >&5
+echo "configure:7507: 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 7509 "configure"
+#line 7512 "configure"
#include "confdefs.h"
#include <GL/gutil.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7514: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "GL/tube.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for GL/tube.h""... $ac_c" 1>&6
-echo "configure:7545: checking for GL/tube.h" >&5
+echo "configure:7548: 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 7550 "configure"
+#line 7553 "configure"
#include "confdefs.h"
#include <GL/tube.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7555: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7558: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$ac_save_CPPFLAGS"
fi
-# /usr/local/lib/GL/libgle.a
-# /usr/local/lib/GL/libmatrix.a
-
if test "$have_gle" = yes ; then
have_gle=no
+ gle_halfassed=yes
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
echo $ac_n "checking for gleCreateGC in -lgle""... $ac_c" 1>&6
-echo "configure:7602: checking for gleCreateGC in -lgle" >&5
+echo "configure:7603: 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
ac_save_LIBS="$LIBS"
LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7610 "configure"
+#line 7611 "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
gleCreateGC()
; return 0; }
EOF
-if { (eval echo configure:7621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- have_gle=yes; GLE_LIBS="-lgle"
+ have_gle=yes; gle_halfassed=no, GLE_LIBS="-lgle"
else
echo "$ac_t""no" 1>&6
fi
fi
if test "$have_gle" = yes ; then
have_gle=no
+ gle_halfassed=yes
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
echo $ac_n "checking for uview_direction_d in -lmatrix""... $ac_c" 1>&6
-echo "configure:7666: checking for uview_direction_d in -lmatrix" >&5
+echo "configure:7668: 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
ac_save_LIBS="$LIBS"
LIBS="-lmatrix $GL_LIBS -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7674 "configure"
+#line 7676 "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
uview_direction_d()
; return 0; }
EOF
-if { (eval echo configure:7685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- have_gle=yes; GLE_LIBS="$GLE_LIBS -lmatrix"
+ have_gle=yes; gle_halfassed=no,
+ GLE_LIBS="$GLE_LIBS -lmatrix"
else
echo "$ac_t""no" 1>&6
fi
/*)
echo $ac_n "checking for XPM headers""... $ac_c" 1>&6
-echo "configure:7750: checking for XPM headers" >&5
+echo "configure:7753: checking for XPM headers" >&5
d=$with_xpm/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for XPM libs""... $ac_c" 1>&6
-echo "configure:7760: checking for XPM libs" >&5
+echo "configure:7763: checking for XPM libs" >&5
d=$with_xpm/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6
-echo "configure:7793: checking for X11/xpm.h" >&5
+echo "configure:7796: 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 7798 "configure"
+#line 7801 "configure"
#include "confdefs.h"
#include <X11/xpm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
/*)
echo $ac_n "checking for XSHM headers""... $ac_c" 1>&6
-echo "configure:7869: checking for XSHM headers" >&5
+echo "configure:7872: checking for XSHM headers" >&5
d=$with_xshm/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for XSHM libs""... $ac_c" 1>&6
-echo "configure:7879: checking for XSHM libs" >&5
+echo "configure:7882: checking for XSHM libs" >&5
d=$with_xshm/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/XShm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/XShm.h""... $ac_c" 1>&6
-echo "configure:7914: checking for X11/extensions/XShm.h" >&5
+echo "configure:7917: 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 7919 "configure"
+#line 7922 "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:7924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
-echo "configure:7958: checking for sys/ipc.h" >&5
+echo "configure:7961: 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 7963 "configure"
+#line 7966 "configure"
#include "confdefs.h"
#include <sys/ipc.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6
-echo "configure:8003: checking for sys/shm.h" >&5
+echo "configure:8006: 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 8008 "configure"
+#line 8011 "configure"
#include "confdefs.h"
#include <sys/shm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
#
case "$host" in
*-aix*)
- have_xshm=no
-
+ if `uname -v` -eq 3 ; then
+ have_xshm=no
+
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LDFLAGS="$LDFLAGS"
# ac_save_LIBS="$LIBS"
LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
echo $ac_n "checking for XShmQueryExtension in -lXextSam""... $ac_c" 1>&6
-echo "configure:8064: checking for XShmQueryExtension in -lXextSam" >&5
+echo "configure:8068: checking for XShmQueryExtension in -lXextSam" >&5
ac_lib_var=`echo XextSam'_'XShmQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXextSam -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 8072 "configure"
+#line 8076 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
XShmQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:8083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
LDFLAGS="$ac_save_LDFLAGS"
# LIBS="$ac_save_LIBS"
+ fi
;;
esac
/*)
echo $ac_n "checking for DOUBLE-BUFFER headers""... $ac_c" 1>&6
-echo "configure:8149: checking for DOUBLE-BUFFER headers" >&5
+echo "configure:8154: checking for DOUBLE-BUFFER headers" >&5
d=$with_xdbe/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for DOUBLE-BUFFER libs""... $ac_c" 1>&6
-echo "configure:8159: checking for DOUBLE-BUFFER libs" >&5
+echo "configure:8164: checking for DOUBLE-BUFFER libs" >&5
d=$with_xdbe/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
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:8193: checking for X11/extensions/Xdbe.h" >&5
+echo "configure:8198: 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 8198 "configure"
+#line 8203 "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:8203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
/*)
echo $ac_n "checking for XReadDisplay headers""... $ac_c" 1>&6
-echo "configure:8266: checking for XReadDisplay headers" >&5
+echo "configure:8271: checking for XReadDisplay headers" >&5
d=$with_readdisplay/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for XReadDisplay libs""... $ac_c" 1>&6
-echo "configure:8276: checking for XReadDisplay libs" >&5
+echo "configure:8281: checking for XReadDisplay libs" >&5
d=$with_readdisplay/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6
-echo "configure:8309: checking for X11/extensions/readdisplay.h" >&5
+echo "configure:8314: 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 8314 "configure"
+#line 8319 "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:8319: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
/*)
echo $ac_n "checking for Iris Video headers""... $ac_c" 1>&6
-echo "configure:8374: checking for Iris Video headers" >&5
+echo "configure:8379: checking for Iris Video headers" >&5
d=$with_sgivideo/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for Iris Video libs""... $ac_c" 1>&6
-echo "configure:8384: checking for Iris Video libs" >&5
+echo "configure:8389: checking for Iris Video libs" >&5
d=$with_sgivideo/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "dmedia/vl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dmedia/vl.h""... $ac_c" 1>&6
-echo "configure:8417: checking for dmedia/vl.h" >&5
+echo "configure:8422: 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 8422 "configure"
+#line 8427 "configure"
#include "confdefs.h"
#include <dmedia/vl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
if test "$have_sgivideo" = yes; then
have_sgivideo=no
echo $ac_n "checking for vlOpenVideo in -lvl""... $ac_c" 1>&6
-echo "configure:8452: checking for vlOpenVideo in -lvl" >&5
+echo "configure:8457: checking for vlOpenVideo in -lvl" >&5
ac_lib_var=`echo vl'_'vlOpenVideo | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lvl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 8460 "configure"
+#line 8465 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
vlOpenVideo()
; return 0; }
EOF
-if { (eval echo configure:8471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
case "$with_zippy_req" in
/*)
echo $ac_n "checking for $with_zippy_req""... $ac_c" 1>&6
-echo "configure:8542: checking for $with_zippy_req" >&5
+echo "configure:8547: checking for $with_zippy_req" >&5
if test -x "$with_zippy_req" ; then
echo "$ac_t""yes" 1>&6
else
# Extract the first word of "$with_zippy_req", so it can be a program name with args.
set dummy $with_zippy_req; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8556: checking for $ac_word" >&5
+echo "configure:8561: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_zip2'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8606: checking for $ac_word" >&5
+echo "configure:8611: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_emacs_exe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8640: checking for $ac_word" >&5
+echo "configure:8645: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_xemacs_exe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$emacs_exe" ; then
echo $ac_n "checking for emacs yow""... $ac_c" 1>&6
-echo "configure:8675: checking for emacs yow" >&5
+echo "configure:8680: checking for emacs yow" >&5
#
# get emacs to tell us where the libexec directory is.
#
if test -z "$ac_cv_zippy_program" ; then
echo $ac_n "checking for xemacs yow""... $ac_c" 1>&6
-echo "configure:8697: checking for xemacs yow" >&5
+echo "configure:8702: checking for xemacs yow" >&5
if test -n "$xemacs_exe" ; then
#
# get xemacs to tell us where the libexec directory is.
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8756: checking for $ac_word" >&5
+echo "configure:8761: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_fortune'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8792: checking for $ac_word" >&5
+echo "configure:8797: 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
fi
fi
-
if test "$have_gl" = no ; then
if test "$with_gl_req" = yes ; then
warnL 'Use of GL was requested, but it was not found.'
noteL 'The OpenGL 3D library was not found.'
fi
+ if test "$gl_halfassed" = yes ; then
+ echo ''
+ warn2 'More specifically, we found the headers, but not the'
+ warn2 'libraries; so either GL is half-installed on this'
+ warn2 "system, or something else went wrong. The \`config.log'"
+ warn2 'file might contain some clues.'
+ fi
+
echo ''
warn2 'Those demos which use 3D will not be built or installed.'
warn2 'You might want to consider installing OpenGL and'
if test "$have_gl" = yes -a "$have_gle" = no ; then
if test "$with_gle_req" = yes ; then
- warnL 'Use of GLE was requested, but it was not found.'
+ noteL 'Use of the GLE (GL Extrusion) library was requested, but'
+ warn2 'it was not found (though the OpenGL library was found, and'
+ warn2 'is being used.)'
elif test "$with_gle_req" = no ; then
- noteL 'The GLE (GL Extrusion) library is not being used.'
+ noteL 'The OpenGL Library is being used, but the GLE (GL Extrusion)'
+ warn2 'library is not.'
else
- noteL 'The GLE (GL Extrusion) library was not found.'
+ noteL 'The OpenGL Library was found, but the GLE (GL Extrusion)'
+ warn2 'was not.'
+ fi
+
+ if test "$gle_halfassed" = yes ; then
+ echo ''
+ warn2 'More specifically, we found the headers, but not the'
+ warn2 'libraries; so either GLE is half-installed on this'
+ warn2 "system, or something else went wrong. The \`config.log'"
+ warn2 'file might contain some clues.'
fi
echo ''
- warn2 'Some of the OpenGL (3D) demos will not be built or installed.'
- warn2 'You might want to consider installing GLE and re-running'
- warn2 'configure. (Remember to delete the config.cache file first.)'
- warn2 'You can find the GLE library at <http://www.linas.org/gle/>.'
- warn2 'For general OpenGL info, see <http://www.opengl.org/>.'
+ warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)'
+ warn2 'will not be built or installed. You might want to consider'
+ warn2 'installing GLE and re-running configure. (Remember to delete'
+ warn2 'the config.cache file first.) You can find the GLE library'
+ warn2 'at <http://www.linas.org/gle/>. For general OpenGL info,'
+ warn2 'see <http://www.opengl.org/>.'
fi
have_gl=no
ac_have_mesa_gl=no
with_gl_req=unspecified
+gl_halfassed=no
AC_ARG_WITH(gl,[
Graphics options:
# we have headers, but no libs -- bail.
have_gl=no
ac_have_mesa_gl=no
+ gl_halfassed=yes
else
# linking works -- we can build the GL hacks.
AC_DEFINE(HAVE_GL)
have_gle=no
with_gle_req=unspecified
+gle_halfassed=no
AC_ARG_WITH(gle,
[ --with-gle Build those demos which depend on GLE
(the OpenGL "extrusion" library.)],
AC_CHECK_X_HEADER(GL/tube.h, have_gle=yes, have_gle=no)
fi
-# /usr/local/lib/GL/libgle.a
-# /usr/local/lib/GL/libmatrix.a
-
if test "$have_gle" = yes ; then
have_gle=no
+ gle_halfassed=yes
AC_CHECK_X_LIB(gle, gleCreateGC,
- [have_gle=yes; GLE_LIBS="-lgle"],
+ [have_gle=yes; gle_halfassed=no, GLE_LIBS="-lgle"],
[], $GL_LIBS -lX11 -lXext -lm)
fi
if test "$have_gle" = yes ; then
have_gle=no
+ gle_halfassed=yes
AC_CHECK_X_LIB(matrix, uview_direction_d,
- [have_gle=yes; GLE_LIBS="$GLE_LIBS -lmatrix"],
+ [have_gle=yes; gle_halfassed=no,
+ GLE_LIBS="$GLE_LIBS -lmatrix"],
[], $GL_LIBS -lX11 -lXext -lm)
fi
#
case "$host" in
*-aix*)
- have_xshm=no
- AC_CHECK_X_LIB(XextSam, XShmQueryExtension,
- [have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"],
- [true], -lX11 -lXext -lm)
+ if [ `uname -v` -eq 3 ]; then
+ have_xshm=no
+ AC_CHECK_X_LIB(XextSam, XShmQueryExtension,
+ [have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"],
+ [true], -lX11 -lXext -lm)
+ fi
;;
esac
fi
fi
-
if test "$have_gl" = no ; then
if test "$with_gl_req" = yes ; then
warnL 'Use of GL was requested, but it was not found.'
noteL 'The OpenGL 3D library was not found.'
fi
+ if test "$gl_halfassed" = yes ; then
+ echo ''
+ warn2 'More specifically, we found the headers, but not the'
+ warn2 'libraries; so either GL is half-installed on this'
+ warn2 "system, or something else went wrong. The \`config.log'"
+ warn2 'file might contain some clues.'
+ fi
+
echo ''
warn2 'Those demos which use 3D will not be built or installed.'
warn2 'You might want to consider installing OpenGL and'
if test "$have_gl" = yes -a "$have_gle" = no ; then
if test "$with_gle_req" = yes ; then
- warnL 'Use of GLE was requested, but it was not found.'
+ noteL 'Use of the GLE (GL Extrusion) library was requested, but'
+ warn2 'it was not found (though the OpenGL library was found, and'
+ warn2 'is being used.)'
elif test "$with_gle_req" = no ; then
- noteL 'The GLE (GL Extrusion) library is not being used.'
+ noteL 'The OpenGL Library is being used, but the GLE (GL Extrusion)'
+ warn2 'library is not.'
else
- noteL 'The GLE (GL Extrusion) library was not found.'
+ noteL 'The OpenGL Library was found, but the GLE (GL Extrusion)'
+ warn2 'was not.'
+ fi
+
+ if test "$gle_halfassed" = yes ; then
+ echo ''
+ warn2 'More specifically, we found the headers, but not the'
+ warn2 'libraries; so either GLE is half-installed on this'
+ warn2 "system, or something else went wrong. The \`config.log'"
+ warn2 'file might contain some clues.'
fi
echo ''
- warn2 'Some of the OpenGL (3D) demos will not be built or installed.'
- warn2 'You might want to consider installing GLE and re-running'
- warn2 'configure. (Remember to delete the config.cache file first.)'
- warn2 'You can find the GLE library at <http://www.linas.org/gle/>.'
- warn2 'For general OpenGL info, see <http://www.opengl.org/>.'
+ warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)'
+ warn2 'will not be built or installed. You might want to consider'
+ warn2 'installing GLE and re-running configure. (Remember to delete'
+ warn2 'the config.cache file first.) You can find the GLE library'
+ warn2 'at <http://www.linas.org/gle/>. For general OpenGL info,'
+ warn2 'see <http://www.opengl.org/>.'
fi
-# driver/Makefile.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
+# driver/Makefile.in --- xscreensaver, Copyright (c) 1997-1999 Jamie Zawinski.
# the `../configure' script generates `driver/Makefile' from this file.
@SET_MAKE@
install
install-program: $(EXES)
- @if [ ! -d $(bindir) ]; then $(INSTALL_DIRS) $(bindir) ; fi
+ @if [ ! -d $(install_prefix)$(bindir) ]; then \
+ $(INSTALL_DIRS) $(install_prefix)$(bindir) ; \
+ fi
@inst="$(INSTALL_PROGRAM)" ; \
if [ @NEED_SETUID@ = yes ]; then \
me=`PATH="$$PATH:/usr/ucb" whoami` ; \
$$e " means that locking might not work. (Try it and see.)" ;\
$$e " ####################################################################";\
$$e "" ;\
- fi ; \
- fi ; \
- echo $$inst xscreensaver $(bindir)/xscreensaver ; \
- $$inst xscreensaver $(bindir)/xscreensaver
- $(INSTALL_PROGRAM) xscreensaver-command $(bindir)/xscreensaver-command
- $(INSTALL_PROGRAM) xscreensaver-demo $(bindir)/xscreensaver-demo
+ fi ; \
+ fi ; \
+ echo $$inst xscreensaver $(install_prefix)$(bindir)/xscreensaver ; \
+ $$inst xscreensaver $(install_prefix)$(bindir)/xscreensaver
+ $(INSTALL_PROGRAM) xscreensaver-command \
+ $(install_prefix)$(bindir)/xscreensaver-command
+ $(INSTALL_PROGRAM) xscreensaver-demo \
+ $(install_prefix)$(bindir)/xscreensaver-demo
install-ad: XScreenSaver.ad
- @if [ ! -d $(AD_DIR) ]; then $(INSTALL_DIRS) $(AD_DIR) ; fi
- @-echo $(INSTALL_DATA) XScreenSaver.ad $(AD_DIR)/XScreenSaver ; \
- if $(INSTALL_DATA) XScreenSaver.ad $(AD_DIR)/XScreenSaver ; then \
+ @if [ ! -d $(install_prefix)$(AD_DIR) ]; then \
+ $(INSTALL_DIRS) $(install_prefix)$(AD_DIR) ; \
+ fi
+ @-echo $(INSTALL_DATA) XScreenSaver.ad \
+ $(install_prefix)$(AD_DIR)/XScreenSaver ; \
+ if $(INSTALL_DATA) XScreenSaver.ad \
+ $(install_prefix)$(AD_DIR)/XScreenSaver ; then \
true ; \
else \
e=echo ; \
- if [ -f $(AD_DIR)/XScreenSaver ]; then \
+ if [ -f $(install_prefix)$(AD_DIR)/XScreenSaver ]; then \
$$e "" ;\
$$e " ####################################################################";\
- $$e " Warning: unable to install $(AD_DIR)/XScreenSaver" ;\
+ $$e " Warning: unable to install $(install_prefix)$(AD_DIR)/XScreenSaver" ;\
$$e " That file exists, and is unwritable. It is probably from" ;\
$$e " an older version of xscreensaver, and could cause things" ;\
$$e " to malfunction. Please delete it!" ;\
else \
$$e "" ;\
$$e " ####################################################################";\
- $$e " Warning: unable to install $(AD_DIR)/XScreenSaver" ;\
+ $$e " Warning: unable to install $(install_prefix)$(AD_DIR)/XScreenSaver" ;\
$$e " The directory is unwritable. This is probably ok;" ;\
$$e " xscreensaver should work without that file." ;\
$$e " ####################################################################";\
install-man: $(MEN)
@men="$(MEN)" ; \
- if [ ! -d $(man1dir) ]; then $(INSTALL_DIRS) $(man1dir) ; fi ; \
+ if [ ! -d $(install_prefix)$(man1dir) ]; then \
+ $(INSTALL_DIRS) $(install_prefix)$(man1dir) ; \
+ fi ; \
for man in $$men; do \
instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
instname=`echo $$instname | sed 's/-old//'` ; \
- echo $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
- $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
+ echo $(INSTALL_DATA) $(srcdir)/$$man \
+ $(install_prefix)$(man1dir)/$$instname ; \
+ $(INSTALL_DATA) $(srcdir)/$$man \
+ $(install_prefix)$(man1dir)/$$instname ; \
done
uninstall-program:
@for program in $(EXES); do \
- echo rm -f $(bindir)/$$program ; \
- rm -f $(bindir)/$$program ; \
+ echo rm -f $(install_prefix)$(bindir)/$$program ; \
+ rm -f $(install_prefix)$(bindir)/$$program ; \
done
uninstall-ad:
- rm -f $(AD_DIR)/XScreenSaver
+ rm -f $(install_prefix)$(AD_DIR)/XScreenSaver
uninstall-man:
@men="$(MEN)" ; \
for man in $$men; do \
instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
- echo rm -f $(man1dir)/$$instname ; \
- rm -f $(man1dir)/$$instname ; \
+ echo rm -f $(install_prefix)$(man1dir)/$$instname ; \
+ rm -f $(install_prefix)$(man1dir)/$$instname ; \
done
install-pam:
@src="$(srcdir)/xscreensaver.pam" ; \
dest=`sed -n 's/.*PAM_SERVICE_NAME[ ]*"\([^"]*\)".*$$/\1/p' \
< ../config.h` ; \
- dir="$(PAM_DIR)" ; \
+ dir="$(install_prefix)$(PAM_DIR)" ; \
conf="$(PAM_CONF)" ; \
\
if [ -d $$dir ] ; then \
install-kde:
@src="$(srcdir)/xscreensaver.kss" ; \
if [ "$$KDEDIR" != "" ]; then \
- dir="$$KDEDIR/bin" ; \
+ dir="$(install_prefix)$$KDEDIR/bin" ; \
dest="$$dir/xscreensaver.kss" ; \
echo $(INSTALL_PROGRAM) $$src $$dest ; \
if $(INSTALL_PROGRAM) $$src $$dest ; then \
$$e "" ;\
$$e " ####################################################################";\
$$e " Warning: unable to install $$dest" ;\
- if [ ! -d $$KDEDIR ]; then \
- $$e " $$KDEDIR (\$$KDEDIR) does not exist." ;\
- elif [ ! -d $$KDEDIR/bin ]; then \
- $$e " $$KDEDIR/bin (\$$KDEDIR/bin) does not exist." ;\
+ if [ ! -d $(install_prefix)$$KDEDIR ]; then \
+ $$e " $(install_prefix)$$KDEDIR (\$$KDEDIR) does not exist." ;\
+ elif [ ! -d $(install_prefix)$$KDEDIR/bin ]; then \
+ $$e " $(install_prefix)$$KDEDIR/bin (\$$KDEDIR/bin) does not exist.";\
elif [ -f $$dest ]; then \
$$e " That file exists, and is unwritable." ;\
else \
uninstall-kde:
@if [ "$$KDEDIR" != "" ]; then \
- dest="$$KDEDIR/bin/xscreensaver.kss" ; \
+ dest="$(install_prefix)$$KDEDIR/bin/xscreensaver.kss" ; \
echo rm -f $$dest ; \
rm -f $$dest ; \
fi
! a screen saver and locker for the X window system
! by Jamie Zawinski
!
-! version 3.20
-! 12-Nov-99
+! version 3.21
+! 18-Nov-99
!
! See "man xscreensaver" for more info. The latest version is always
! available at http://www.jwz.org/xscreensaver/
! The "helpURL" will be substituted for up to two occurrences of "%s".
*loadURL: netscape -remote 'openURL(%s)' || netscape '%s'
+! This is what the "Manual" button in xscreensaver-demo runs (/bin/sh syntax.)
+*manualCommand: xterm +sb -fg black -bg gray75 -T '%s manual' \
+ -e /bin/sh -c 'man "%s" || read'
+! Gnome folks might prefer this:
+!*manualCommand: gnome-help-browser 'man:%s'
+
! The format used for printing the date and time in the password dialog box
! (see the strftime(3) manual page for details.)
"Qix (transparent)" qix -root -count 4 -solid -transparent \n\
"Qix (linear)" qix -root -count 5 -solid -transparent \
-linear -segments 250 -size 100 \n\
+- mono: "Qix (xor)" qix -root -linear -count 5 -size 200 \
+ -spread 30 -segments 75 -solid -xor \n\
+ \
"Attraction (balls)" attraction -root -mode balls \n\
"Attraction (lines)" attraction -root -mode lines -points 3 \
-segments 200 \n\
+- "Attraction (poly)" attraction -root -mode polygons \n\
"Attraction (splines)" attraction -root -mode splines -segments \
300 \n\
"Attraction (orbital)" attraction -root -mode lines -radius 300 \
-orbit -vmult 0.5 \n\
+ \
pyro -root \n\
+ rocks -root \n\
helix -root \n\
pedal -root \n\
rorschach -root -offset 7 \n\
ccurve -root \n\
blaster -root \n\
bumps -root \n\
+ color: bubbles -root \n\
default-n: webcollage -root \n\
default-n: "WebCollage (whacked)" \
webcollage -root -filter \
'vidwhacker -stdin -stdout' \n\
- default-n: vidwhacker -root \n\
\
-- mono: "Rocks (mono)" rocks -root \n\
- color: "Rocks (color)" rocks -root -fg darksalmon \n\
-- mono: "Qix (xor)" qix -root -linear -count 5 -size 200 \
- -spread 30 -segments 75 -solid -xor \n\
- color: "Attraction (poly)" attraction -root -mode polygons \n\
-- color: "Attraction (filled)" attraction -root -mode filled-splines \
- -segments 0 \n\
-- Color: "Attraction (glow)" attraction -root -glow -points 10 \n\
- color: bubbles -root \n\
- \
@GL_KLUDGE@ GL: gears -root \n\
@GL_KLUDGE@ GL: superquadrics -root \n\
@GL_KLUDGE@ GL: morph3d -root \n\
-texture_quality -light -fog \n\
@GLE_KLUDGE@GL: extrusion -root \n\
@GL_KLUDGE@ GL: sierpinski3d -root \n\
-
+ \
+- xdaliclock -root -builtin3 -cycle \n\
+- default-n: xearth -nofork -nostars -ncolors 50 \
+ -night 3 -wait 0 -timewarp 400.0 -pos \
+ sunrel/38/-30 \n\
+- ssystem -fullscreen :32 \n\
+- xmountains -b -M -Z 0 -r 1 \n\
+- "XMountains (top)" xmountains -b -M -Z 0 -r 1 -m \n\
+- xaos -root -autopilot -incoloring -1 \
+ -nogui -outcoloring -1 \n\
+- xfishtank -d \n
+
-! Some other programs that you might want to track down (these work as
-! XScreenSaver helpers, but are not distributed with it):
-!
-! xdaliclock -root -builtin2 \n\
-! xswarm -r 2>&- \n\
-! xwave -root \n\
-! xbouncebits ... \n\
-! ico -r -faces -sleep 1 -obj ico \n\
-! xsplinefun \n\
-! xmountains -b -M \n\
-! color: xfishtank -c black -d -r 2 \n\
-!
-! xtacy is ok, but it only works on the default visual. We can satisfy
-! that constraint like so:
-!
-! default: "Xtacy (funky)" xtacy -root -delay 100 -funky -number 3 \n\
-! default: "Xtacy (grav)" xtacy -root -delay 100 -gravity \n\
-! default: "Xtacy (mixer)" xtacy -root -delay 100 -mixer \n\
-! default: "Xtacy (taffy)" xtacy -root -delay 100 -taffy -pal 4 \n\
-!
! To display a randomized slideshow of images, you can do something like this:
!
! default-n: "Slideshow" xv -root -rmode 5 -random -viewonly \
! (meaning, "-visual default -install") but you probably won't ever need
! to use that.
!
-! XEarth is nice, too:
-!
-! default-n: xearth -nostars -wait 0 -timewarp 400 -pos sunrel/38/-30
-!
!
! Some of the GL demos that SGI ships work with XScreenSaver; most don't.
! XScreenSaver includes a program (not built or installed by default)
!
! You can also use the "ant" demo, but first you need to wrap a shell script
! around it that cds to its home directory, so that it can find its files;
-! and also pass it the -S argument, to prevent it from forking.
-!
-!
-! Also, since these actually end up mapping their own windows instead of
-! drawing on the XScreenSaver-provided root, when they are being run from
-! demo-mode, you can't pop up the demo-mode dialog just by clicking the
-! mouse: you must first type ESC to make the SGI programs exit. This sucks.
-! Things should work properly when they are being run by xscreensaver in
-! non-demo-mode, however.
-!
+! and also pass it the -S argument, to prevent it from forking. What a mess!
! Basically, the SGI demo writers went out of their way to make my life hell.
*hacks.xdaliclock.name: XDaliClock
*hacks.xdaliclock.documentation: \
XDaliClock draws a large digital clock, the numbers of which change by \
-``melting'' into their new shapes. Written by Jamie Zawinski.
+``melting'' into their new shapes. Written by Jamie Zawinski. This \
+is not included with the XScreenSaver package, but if you don't have \
+it already, you can find it at <http://www.jwz.org/xdaliclock/>.
*hacks.xearth.documentation: \
XEarth draws an image of the Earth, as seen from your favorite vantage \
point in space, correctly shaded for the current position of the Sun. \
-Written by Kirk Johnson.
+Written by Kirk Johnson. This is not included with the XScreenSaver \
+package, but if you don't have it already, you can find it at \
+<http://www.cs.colorado.edu/~tuna/xearth/>.
*hacks.ssystem.name: SSystem
*hacks.ssystem.documentation: \
SSystem is a GL Solar System simulator. It simulates flybys of Sun, \
the nine planets and a few major satellites, with four camera modes. \
-Written by Raul Alonso.
+Written by Raul Alonso. This is not included with the XScreenSaver \
+package, but if you don't have it already, you can find it at \
+<http://www1.las.es/~amil/ssystem/>.
*hacks.xmountains.documentation: \
XMountains generates realistic-looking fractal terrains of snow-capped \
mountains near water, with either a top view or a side view. \
-Written by Stephen Booth.
+Written by Stephen Booth. This is not included with the XScreenSaver \
+package, but if you don't have it already, you can find it at \
+<http://www.epcc.ed.ac.uk/~spb/xmountains/>.
+
+*hacks.xaos.name: XaoS
+*hacks.xaos.documentation: \
+XaoS generates fast fly-through animations of the Mandelbrot and other \
+fractal sets. Written by Thomas Marsh and Jan Hubicka. This is not \
+included with the XScreenSaver package, but if you don't have it \
+already, you can find it at <http://limax.paru.cas.cz/~hubicka/XaoS/>.
+
+*hacks.xfishtank.name: XFishTank
+*hacks.xfishtank.documentation: \
+Fish! This is not included with the XScreenSaver package, but if you \
+don't have it already, you can find it at \
+<http://metalab.unc.edu/pub/Linux/X11/demos/>.
"*prefsCommand: xscreensaver-demo -prefs",
"*helpURL: http://www.jwz.org/xscreensaver/man.html",
"*loadURL: netscape -remote 'openURL(%s)' || netscape '%s'",
+"*manualCommand: xterm +sb -fg black -bg gray75 -T '%s manual' \
+ -e /bin/sh -c 'man \"%s\" || read'",
"*dateFormat: %d-%b-%y (%a); %I:%M %p",
"*installColormap: True",
"*programs: \
\"Qix (transparent)\" qix -root -count 4 -solid -transparent \\n\
\"Qix (linear)\" qix -root -count 5 -solid -transparent \
-linear -segments 250 -size 100 \\n\
+- mono: \"Qix (xor)\" qix -root -linear -count 5 -size 200 \
+ -spread 30 -segments 75 -solid -xor \\n\
+ \
\"Attraction (balls)\" attraction -root -mode balls \\n\
\"Attraction (lines)\" attraction -root -mode lines -points 3 \
-segments 200 \\n\
+- \"Attraction (poly)\" attraction -root -mode polygons \\n\
\"Attraction (splines)\" attraction -root -mode splines -segments \
300 \\n\
\"Attraction (orbital)\" attraction -root -mode lines -radius 300 \
-orbit -vmult 0.5 \\n\
+ \
pyro -root \\n\
+ rocks -root \\n\
helix -root \\n\
pedal -root \\n\
rorschach -root -offset 7 \\n\
ccurve -root \\n\
blaster -root \\n\
bumps -root \\n\
+ color: bubbles -root \\n\
default-n: webcollage -root \\n\
default-n: \"WebCollage (whacked)\" \
webcollage -root -filter \
'vidwhacker -stdin -stdout' \\n\
- default-n: vidwhacker -root \\n\
\
-- mono: \"Rocks (mono)\" rocks -root \\n\
- color: \"Rocks (color)\" rocks -root -fg darksalmon \\n\
-- mono: \"Qix (xor)\" qix -root -linear -count 5 -size 200 \
- -spread 30 -segments 75 -solid -xor \\n\
- color: \"Attraction (poly)\" attraction -root -mode polygons \\n\
-- color: \"Attraction (filled)\" attraction -root -mode filled-splines \
- -segments 0 \\n\
-- Color: \"Attraction (glow)\" attraction -root -glow -points 10 \\n\
- color: bubbles -root \\n\
- \
GL: gears -root \\n\
GL: superquadrics -root \\n\
GL: morph3d -root \\n\
-texture_quality -light -fog \\n\
GL: extrusion -root \\n\
GL: sierpinski3d -root \\n\
- ",
+ \
+- xdaliclock -root -builtin3 -cycle \\n\
+- default-n: xearth -nofork -nostars -ncolors 50 \
+ -night 3 -wait 0 -timewarp 400.0 -pos \
+ sunrel/38/-30 \\n\
+- ssystem -fullscreen :32 \\n\
+- xmountains -b -M -Z 0 -r 1 \\n\
+- \"XMountains (top)\" xmountains -b -M -Z 0 -r 1 -m \\n\
+- xaos -root -autopilot -incoloring -1 \
+ -nogui -outcoloring -1 \\n\
+- xfishtank -d \\n",
"XScreenSaver.pointerPollTime: 5",
"XScreenSaver.initialDelay: 0",
"XScreenSaver.windowCreationTimeout: 30",
"*hacks.xdaliclock.name: XDaliClock",
"*hacks.xdaliclock.documentation: \
XDaliClock draws a large digital clock, the numbers of which change by \
-``melting'' into their new shapes. Written by Jamie Zawinski.",
+``melting'' into their new shapes. Written by Jamie Zawinski. This \
+is not included with the XScreenSaver package, but if you don't have \
+it already, you can find it at <http://www.jwz.org/xdaliclock/>.",
"*hacks.xearth.documentation: \
XEarth draws an image of the Earth, as seen from your favorite vantage \
point in space, correctly shaded for the current position of the Sun. \
-Written by Kirk Johnson.",
+Written by Kirk Johnson. This is not included with the XScreenSaver \
+package, but if you don't have it already, you can find it at \
+<http://www.cs.colorado.edu/~tuna/xearth/>.",
"*hacks.ssystem.name: SSystem",
"*hacks.ssystem.documentation: \
SSystem is a GL Solar System simulator. It simulates flybys of Sun, \
the nine planets and a few major satellites, with four camera modes. \
-Written by Raul Alonso.",
+Written by Raul Alonso. This is not included with the XScreenSaver \
+package, but if you don't have it already, you can find it at \
+<http://www1.las.es/~amil/ssystem/>.",
"*hacks.xmountains.documentation: \
XMountains generates realistic-looking fractal terrains of snow-capped \
mountains near water, with either a top view or a side view. \
-Written by Stephen Booth.",
+Written by Stephen Booth. This is not included with the XScreenSaver \
+package, but if you don't have it already, you can find it at \
+<http://www.epcc.ed.ac.uk/~spb/xmountains/>.",
+"*hacks.xaos.name: XaoS",
+"*hacks.xaos.documentation: \
+XaoS generates fast fly-through animations of the Mandelbrot and other \
+fractal sets. Written by Thomas Marsh and Jan Hubicka. This is not \
+included with the XScreenSaver package, but if you don't have it \
+already, you can find it at <http://limax.paru.cas.cz/~hubicka/XaoS/>.",
+"*hacks.xfishtank.name: XFishTank",
+"*hacks.xfishtank.documentation: \
+Fish! This is not included with the XScreenSaver package, but if you \
+don't have it already, you can find it at \
+<http://metalab.unc.edu/pub/Linux/X11/demos/>.",
gpointer user_data);
void
-apply_this_cb (GtkButton *button,
+apply_manual_cb (GtkButton *button,
gpointer user_data);
void
-cancel_this_cb (GtkButton *button,
+prefs_ok_cb (GtkButton *button,
gpointer user_data);
void
-prefs_ok_cb (GtkButton *button,
+prefs_cancel_cb (GtkButton *button,
gpointer user_data);
void
-prefs_cancel_cb (GtkButton *button,
+manual_cb (GtkButton *button,
gpointer user_data);
GList *visual_combo_items = NULL;
GtkWidget *combo_entry1;
GtkWidget *demo_hline;
- GtkWidget *demo_cancel_hbox;
+ GtkWidget *demo_manual_hbox;
GtkWidget *demo;
- GtkWidget *apply;
- GtkWidget *cancel;
+ GtkWidget *manual;
GtkWidget *demo_tab;
GtkWidget *prefs_hbox;
GtkWidget *prefs_frame;
gtk_widget_show (demo_hline);
gtk_box_pack_start (GTK_BOX (opts_vbox), demo_hline, FALSE, FALSE, 5);
- demo_cancel_hbox = gtk_hbutton_box_new ();
- gtk_widget_set_name (demo_cancel_hbox, "demo_cancel_hbox");
- gtk_widget_ref (demo_cancel_hbox);
- gtk_object_set_data_full (GTK_OBJECT (xscreensaver_demo), "demo_cancel_hbox", demo_cancel_hbox,
+ demo_manual_hbox = gtk_hbutton_box_new ();
+ gtk_widget_set_name (demo_manual_hbox, "demo_manual_hbox");
+ gtk_widget_ref (demo_manual_hbox);
+ gtk_object_set_data_full (GTK_OBJECT (xscreensaver_demo), "demo_manual_hbox", demo_manual_hbox,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (demo_cancel_hbox);
- gtk_box_pack_start (GTK_BOX (opts_vbox), demo_cancel_hbox, FALSE, TRUE, 0);
+ gtk_widget_show (demo_manual_hbox);
+ gtk_box_pack_start (GTK_BOX (opts_vbox), demo_manual_hbox, FALSE, TRUE, 0);
demo = gtk_button_new_with_label ("Demo");
gtk_widget_set_name (demo, "demo");
gtk_object_set_data_full (GTK_OBJECT (xscreensaver_demo), "demo", demo,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (demo);
- gtk_container_add (GTK_CONTAINER (demo_cancel_hbox), demo);
+ gtk_container_add (GTK_CONTAINER (demo_manual_hbox), demo);
GTK_WIDGET_SET_FLAGS (demo, GTK_CAN_DEFAULT);
- gtk_tooltips_set_tip (tooltips, demo, "Make any changes to this demo's parameters permanent, and run it in full-screen mode (click the mouse to return.)", NULL);
+ gtk_tooltips_set_tip (tooltips, demo, "Run this one in full-screen mode (click the mouse to return.)", NULL);
- apply = gtk_button_new_with_label ("Apply");
- gtk_widget_set_name (apply, "apply");
- gtk_widget_ref (apply);
- gtk_object_set_data_full (GTK_OBJECT (xscreensaver_demo), "apply", apply,
+ manual = gtk_button_new_with_label ("Documentation...");
+ gtk_widget_set_name (manual, "manual");
+ gtk_widget_ref (manual);
+ gtk_object_set_data_full (GTK_OBJECT (xscreensaver_demo), "manual", manual,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (apply);
- gtk_container_add (GTK_CONTAINER (demo_cancel_hbox), apply);
- GTK_WIDGET_SET_FLAGS (apply, GTK_CAN_DEFAULT);
- gtk_tooltips_set_tip (tooltips, apply, "Make any changes to this demo's parameters permanent.", NULL);
-
- cancel = gtk_button_new_with_label ("Cancel");
- gtk_widget_set_name (cancel, "cancel");
- gtk_widget_ref (cancel);
- gtk_object_set_data_full (GTK_OBJECT (xscreensaver_demo), "cancel", cancel,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (cancel);
- gtk_container_add (GTK_CONTAINER (demo_cancel_hbox), cancel);
- GTK_WIDGET_SET_FLAGS (cancel, GTK_CAN_DEFAULT);
- gtk_tooltips_set_tip (tooltips, cancel, "Discard any changes you have made to this demo's parameters.", NULL);
+ gtk_widget_show (manual);
+ gtk_container_add (GTK_CONTAINER (demo_manual_hbox), manual);
+ GTK_WIDGET_SET_FLAGS (manual, GTK_CAN_DEFAULT);
+ gtk_tooltips_set_tip (tooltips, manual, "Click here to read the manual for this display mode, if it has one.", NULL);
demo_tab = gtk_label_new ("Graphics Demos");
gtk_widget_set_name (demo_tab, "demo_tab");
gtk_signal_connect (GTK_OBJECT (demo), "clicked",
GTK_SIGNAL_FUNC (run_this_cb),
NULL);
- gtk_signal_connect (GTK_OBJECT (apply), "clicked",
- GTK_SIGNAL_FUNC (apply_this_cb),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cancel), "clicked",
- GTK_SIGNAL_FUNC (cancel_this_cb),
+ gtk_signal_connect (GTK_OBJECT (manual), "clicked",
+ GTK_SIGNAL_FUNC (manual_cb),
NULL);
gtk_signal_connect (GTK_OBJECT (prefs_ok), "clicked",
GTK_SIGNAL_FUNC (prefs_ok_cb),
static void *global_prefs_pair; /* I hate C so much... */
-
-
char *blurb (void) { return progname; }
-static void run_hack (int which);
-
static char *short_version = 0;
Atom XA_VROOT;
Atom XA_ACTIVATE, XA_BLANK, XA_LOCK, XA_RESTART, XA_EXIT;
-
static void populate_demo_window (GtkWidget *toplevel,
int which, prefs_pair *pair);
static void populate_prefs_page (GtkWidget *top, prefs_pair *pair);
+static int apply_changes_and_save (GtkWidget *widget);
\f
static void
-run_hack (int which)
+run_cmd (GtkWidget *widget, Atom command, int arg)
{
+ char *err = 0;
int status;
- if (which < 0) return;
- status = xscreensaver_command (gdk_display, XA_DEMO, which + 1, False);
+
+ apply_changes_and_save (widget);
+ status = xscreensaver_command (gdk_display, command, arg, False, &err);
if (status < 0)
{
char buf [255];
- sprintf (buf,
- "Error:\n\n"
- "The DEMO %d command failed (%d).\n", which + 1, status);
-#if 0
- warning_dialog (GTK_WIDGET (menuitem), buf, 1);
-#endif
+ if (err)
+ sprintf (buf, "Error:\n\n%s", err);
+ else
+ strcpy (buf, "Unknown error!");
+ warning_dialog (widget, buf, 100);
+ }
+ if (err) free (err);
+}
+
+
+static void
+run_hack (GtkWidget *widget, int which, Bool report_errors_p)
+{
+ if (which < 0) return;
+ apply_changes_and_save (widget);
+ if (report_errors_p)
+ run_cmd (widget, XA_ACTIVATE, 0);
+ else
+ {
+ char *s = 0;
+ xscreensaver_command (gdk_display, XA_DEMO, which + 1, False, &s);
+ if (s) free (s);
}
}
void
exit_menu_cb (GtkMenuItem *menuitem, gpointer user_data)
{
+ apply_changes_and_save (GTK_WIDGET (menuitem));
gtk_main_quit ();
}
static void
wm_close_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
{
- exit_menu_cb (NULL, NULL);
+ apply_changes_and_save (widget);
+ gtk_main_quit ();
}
void
activate_menu_cb (GtkMenuItem *menuitem, gpointer user_data)
{
- int status = xscreensaver_command (gdk_display, XA_ACTIVATE, 0, False);
- if (status < 0)
- {
- char buf [255];
- sprintf (buf,
- "Error:\n\n"
- "The ACTIVATE command failed (%d).\n", status);
- warning_dialog (GTK_WIDGET (menuitem), buf, 100);
- }
+ run_cmd (GTK_WIDGET (menuitem), XA_ACTIVATE, 0);
}
void
lock_menu_cb (GtkMenuItem *menuitem, gpointer user_data)
{
- int status = xscreensaver_command (gdk_display, XA_LOCK, 0, False);
- if (status < 0)
- {
- char buf [255];
- sprintf (buf,
- "Error:\n\n"
- "The LOCK command failed (%d).\n", status);
- warning_dialog (GTK_WIDGET (menuitem), buf, 100);
- }
+ run_cmd (GTK_WIDGET (menuitem), XA_LOCK, 0);
}
void
kill_menu_cb (GtkMenuItem *menuitem, gpointer user_data)
{
- int status = xscreensaver_command (gdk_display, XA_EXIT, 0, False);
- if (status < 0)
- {
- char buf [255];
- sprintf (buf,
- "Error:\n\n"
- "The EXIT command failed (%d).\n", status);
- warning_dialog (GTK_WIDGET (menuitem), buf, 100);
- }
+ run_cmd (GTK_WIDGET (menuitem), XA_EXIT, 0);
}
restart_menu_cb (GtkMenuItem *menuitem, gpointer user_data)
{
#if 0
- int status = xscreensaver_command (gdk_display, XA_RESTART, 0, False);
- if (status < 0)
- {
- char buf [255];
- sprintf (buf,
- "Error:\n\n"
- "The RESTART command failed (%d).\n", status);
- warning_dialog (GTK_WIDGET (menuitem), buf, 100);
- }
+ run_cmd (GTK_WIDGET (menuitem), XA_RESTART, 0);
#else
- xscreensaver_command (gdk_display, XA_EXIT, 0, False);
+ apply_changes_and_save (GTK_WIDGET (menuitem));
+ xscreensaver_command (gdk_display, XA_EXIT, 0, False, NULL);
sleep (1);
system ("xscreensaver -nosplash &");
#endif
}
+static int _selected_hack_number = -1;
+
static int
selected_hack_number (GtkWidget *toplevel)
{
+#if 0
GtkViewport *vp = GTK_VIEWPORT (name_to_widget (toplevel, "viewport"));
GtkList *list_widget = GTK_LIST (GTK_BIN(vp)->child);
GList *slist = list_widget->selection;
? gtk_list_child_position (list_widget, GTK_WIDGET (selected))
: -1);
return which;
+#else
+ return _selected_hack_number;
+#endif
}
-void
-apply_this_cb (GtkButton *button, gpointer user_data)
+static int
+demo_write_init_file (GtkWidget *widget, saver_preferences *p)
+{
+ if (!write_init_file (p, short_version, False))
+ return 0;
+ else
+ {
+ const char *f = init_file_name();
+ if (!f || !*f)
+ warning_dialog (widget,
+ "Error:\n\nCouldn't determine init file name!\n",
+ 100);
+ else
+ {
+ char *b = (char *) malloc (strlen(f) + 1024);
+ sprintf (b, "Error:\n\nCouldn't write %s\n", f);
+ warning_dialog (widget, b, 100);
+ free (b);
+ }
+ return -1;
+ }
+}
+
+
+static int
+apply_changes_and_save (GtkWidget *widget)
{
/* prefs_pair *pair = (prefs_pair *) client_data; */
prefs_pair *pair = global_prefs_pair; /* I hate C so much... */
-
saver_preferences *p = pair->a;
GtkList *list_widget =
- GTK_LIST (name_to_widget (GTK_WIDGET (button), "list"));
- int which = selected_hack_number (GTK_WIDGET (button));
+ GTK_LIST (name_to_widget (widget, "list"));
+ int which = selected_hack_number (widget);
- GtkEntry *cmd = GTK_ENTRY (name_to_widget (GTK_WIDGET (button), "cmd_text"));
+ GtkEntry *cmd = GTK_ENTRY (name_to_widget (widget, "cmd_text"));
GtkToggleButton *enabled =
- GTK_TOGGLE_BUTTON (name_to_widget (GTK_WIDGET (button), "enabled"));
- GtkCombo *vis = GTK_COMBO (name_to_widget (GTK_WIDGET (button),
- "visual_combo"));
+ GTK_TOGGLE_BUTTON (name_to_widget (widget, "enabled"));
+ GtkCombo *vis = GTK_COMBO (name_to_widget (widget, "visual_combo"));
Bool enabled_p = gtk_toggle_button_get_active (enabled);
const char *visual = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (vis)->entry));
char c;
unsigned long id;
- if (which < 0) return;
+ if (which < 0) return -1;
/* Sanity-check and canonicalize whatever the user typed into the combo box.
*/
- if (!strcasecmp (visual, "any")) visual = "";
- if (!strcasecmp (visual, "default")) visual = "Default";
+ if (!strcasecmp (visual, "")) visual = "";
+ else if (!strcasecmp (visual, "any")) visual = "";
+ else if (!strcasecmp (visual, "default")) visual = "Default";
else if (!strcasecmp (visual, "default-n")) visual = "Default-N";
else if (!strcasecmp (visual, "default-i")) visual = "Default-I";
else if (!strcasecmp (visual, "best")) visual = "Best";
gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (vis)->entry), "Any");
}
- p->screenhacks[which]->enabled_p = enabled_p;
- if (p->screenhacks[which]->visual)
- free (p->screenhacks[which]->visual);
- if (p->screenhacks[which]->command)
- free (p->screenhacks[which]->command);
- p->screenhacks[which]->visual = strdup (visual);
- p->screenhacks[which]->command = strdup (command);
-
ensure_selected_item_visible (GTK_WIDGET (list_widget));
- write_init_file (p, short_version);
-}
+ if (!p->screenhacks[which]->visual)
+ p->screenhacks[which]->visual = strdup ("");
+ if (!p->screenhacks[which]->command)
+ p->screenhacks[which]->command = strdup ("");
+ if (p->screenhacks[which]->enabled_p != enabled_p ||
+ !!strcasecmp (p->screenhacks[which]->visual, visual) ||
+ !!strcasecmp (p->screenhacks[which]->command, command))
+ {
+ /* Something was changed -- store results into the struct,
+ and write the file.
+ */
+ free (p->screenhacks[which]->visual);
+ free (p->screenhacks[which]->command);
+ p->screenhacks[which]->visual = strdup (visual);
+ p->screenhacks[which]->command = strdup (command);
+ p->screenhacks[which]->enabled_p = enabled_p;
+
+ return demo_write_init_file (widget, p);
+ }
+
+ /* No changes made */
+ return 0;
+}
void
run_this_cb (GtkButton *button, gpointer user_data)
{
int which = selected_hack_number (GTK_WIDGET (button));
if (which < 0) return;
- apply_this_cb (button, user_data);
- run_hack (which);
+ if (0 == apply_changes_and_save (GTK_WIDGET (button)))
+ run_hack (GTK_WIDGET (button), which, True);
}
void
-cancel_this_cb (GtkButton *button, gpointer user_data)
+manual_cb (GtkButton *button, gpointer user_data)
{
/* prefs_pair *pair = (prefs_pair *) client_data; */
prefs_pair *pair = global_prefs_pair; /* I hate C so much... */
+ saver_preferences *p = pair->a;
GtkList *list_widget =
GTK_LIST (name_to_widget (GTK_WIDGET (button), "list"));
int which = selected_hack_number (GTK_WIDGET (button));
+ char *name, *name2, *cmd, *s;
if (which < 0) return;
+ apply_changes_and_save (GTK_WIDGET (button));
ensure_selected_item_visible (GTK_WIDGET (list_widget));
- populate_demo_window (GTK_WIDGET (button), which, pair);
+
+ name = strdup (p->screenhacks[which]->command);
+ name2 = name;
+ while (isspace (*name2)) name2++;
+ s = name2;
+ while (*s && !isspace (*s)) s++;
+ *s = 0;
+ s = strrchr (name2, '/');
+ if (s) name = s+1;
+
+ cmd = get_string_resource ("manualCommand", "ManualCommand");
+ if (cmd)
+ {
+ char *cmd2 = (char *) malloc (strlen (cmd) + strlen (name2) + 100);
+ strcpy (cmd2, "( ");
+ sprintf (cmd2 + strlen (cmd2),
+ cmd,
+ name2, name2, name2, name2);
+ strcat (cmd2, " ) &");
+ system (cmd2);
+ free (cmd2);
+ }
+ else
+ {
+ warning_dialog (GTK_WIDGET (button),
+ "Error:\n\nno `manualCommand' resource set.",
+ 100);
+ }
+
+ free (name);
}
if (which >= p->screenhacks_count)
which = 0;
+ apply_changes_and_save (GTK_WIDGET (button));
gtk_list_select_item (GTK_LIST (list_widget), which);
ensure_selected_item_visible (GTK_WIDGET (list_widget));
populate_demo_window (GTK_WIDGET (button), which, pair);
- run_hack (which);
+ run_hack (GTK_WIDGET (button), which, False);
}
if (which < 0)
which = p->screenhacks_count - 1;
+ apply_changes_and_save (GTK_WIDGET (button));
gtk_list_select_item (GTK_LIST (list_widget), which);
ensure_selected_item_visible (GTK_WIDGET (list_widget));
populate_demo_window (GTK_WIDGET (button), which, pair);
- run_hack (which);
+ run_hack (GTK_WIDGET (button), which, False);
}
saver_preferences *p = pair->a;
saver_preferences *p2 = pair->b;
+ Bool changed = False;
# define SECONDS(field, name) \
hack_time_text (gtk_entry_get_text (\
*(field) = value; \
} while(0)
+# define CHECKBOX(field, name) \
+ field = gtk_toggle_button_get_active (\
+ GTK_TOGGLE_BUTTON (name_to_widget (GTK_WIDGET(button), (name))))
+
MINUTES (&p2->timeout, "timeout_text");
MINUTES (&p2->cycle, "cycle_text");
SECONDS (&p2->fade_seconds, "fade_text");
INTEGER (&p2->fade_ticks, "ticks_text");
MINUTES (&p2->lock_timeout, "lock_text");
SECONDS (&p2->passwd_timeout, "pass_text");
-
-#undef SECONDS
-#undef MINUTES
-#undef INTEGER
-
- p->timeout = p2->timeout;
- p->cycle = p2->cycle;
- p->lock_timeout = p2->lock_timeout;
- p->passwd_timeout = p2->passwd_timeout;
- p->fade_seconds = p2->fade_seconds;
- p->fade_ticks = p2->fade_ticks;
- p->verbose_p = p2->verbose_p;
- p->install_cmap_p = p2->install_cmap_p;
- p->fade_p = p2->fade_p;
- p->unfade_p = p2->unfade_p;
- p->lock_p = p2->lock_p;
+ CHECKBOX (p2->verbose_p, "verbose_button");
+ CHECKBOX (p2->install_cmap_p, "install_button");
+ CHECKBOX (p2->fade_p, "fade_button");
+ CHECKBOX (p2->unfade_p, "unfade_button");
+ CHECKBOX (p2->lock_p, "lock_button");
+
+# undef SECONDS
+# undef MINUTES
+# undef INTEGER
+# undef CHECKBOX
+
+# define COPY(field) \
+ if (p->field != p2->field) changed = True; \
+ p->field = p2->field
+
+ COPY(timeout);
+ COPY(cycle);
+ COPY(lock_timeout);
+ COPY(passwd_timeout);
+ COPY(fade_seconds);
+ COPY(fade_ticks);
+ COPY(verbose_p);
+ COPY(install_cmap_p);
+ COPY(fade_p);
+ COPY(unfade_p);
+ COPY(lock_p);
+# undef COPY
populate_prefs_page (GTK_WIDGET (button), pair);
- write_init_file (p, short_version);
+ if (changed)
+ demo_write_init_file (GTK_WIDGET (button), p);
}
int which = gtk_list_child_position (list, GTK_WIDGET (button));
if (which >= 0)
- run_hack (which);
+ run_hack (GTK_WIDGET (button), which, True);
}
return FALSE;
prefs_pair *pair = global_prefs_pair; /* I hate C so much... */
int which = gtk_list_child_position (list, GTK_WIDGET (child));
+ apply_changes_and_save (GTK_WIDGET (list));
populate_demo_window (GTK_WIDGET (list), which, pair);
}
/* prefs_pair *pair = (prefs_pair *) client_data; */
prefs_pair *pair = global_prefs_pair; /* I hate C so much... */
+ apply_changes_and_save (GTK_WIDGET (list));
populate_demo_window (GTK_WIDGET (list), -1, pair);
}
return;
list = GTK_LIST (name_to_widget (toplevel, "list"));
+ apply_changes_and_save (toplevel);
gtk_list_select_item (list, which);
ensure_selected_item_visible (GTK_WIDGET (list));
populate_demo_window (toplevel, which, pair);
{
const char *names[] = { "cmd_label", "cmd_text", "enabled",
"visual", "visual_combo",
- "demo", "apply", "cancel" };
+ "demo", "manual" };
int i;
for (i = 0; i < countof(names); i++)
{
gtk_toggle_button_set_active (enabled, (hack ? hack->enabled_p : False));
gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (vis)->entry),
(hack
- ? (hack->visual && hack->visual
+ ? (hack->visual && *hack->visual
? hack->visual
: "Any")
: ""));
if (pretty_name) free (pretty_name);
if (doc_string) free (doc_string);
+
+ _selected_hack_number = which;
}
#endif /* HAVE_ATHENA */
if (save)
- write_init_file (p, short_version);
+ write_init_file (p, short_version, p->verbose_p);
XSync (dpy, False);
usleep (500000); /* give the disk time to settle down */
static void
restart_cb CB_ARGS(WIDGET button, POINTER client_data, POINTER ignored)
{
- xscreensaver_command (widget_display (button), XA_RESTART, 0, False);
+ xscreensaver_command (widget_display (button), XA_RESTART, 0, False, NULL);
}
p->unfade_p = p2->unfade_p;
p->lock_p = p2->lock_p;
- write_init_file (p, short_version);
+ write_init_file (p, short_version, p->verbose_p);
}
run_hack (Display *dpy, int n)
{
if (n <= 0) abort();
- xscreensaver_command (dpy, XA_DEMO, n, False);
+ xscreensaver_command (dpy, XA_DEMO, n, False, NULL);
}
free(v);
}
-void
-write_init_file (saver_preferences *p, const char *version_string)
+int
+write_init_file (saver_preferences *p, const char *version_string,
+ Bool verbose_p)
{
+ int status = -1;
const char *name = init_file_name();
const char *tmp_name = init_file_tmp_name();
char *n2 = chase_symlinks (name);
if (n2) name = n2;
- if (p->verbose_p)
+ if (verbose_p)
fprintf (stderr, "%s: writing \"%s\".\n", blurb(), name);
unlink (tmp_name);
/* Give the new .xscreensaver file the same permissions as the old one;
except ensure that it is readable and writable by owner, and not
- executable.
+ executable. Extra hack: if we're running as root, make the file
+ be world-readable (so that the daemon, running as "nobody", will
+ still be able to read it.)
*/
if (stat(name, &st) == 0)
{
mode_t mode = st.st_mode;
- mode |= S_IRUSR | S_IWUSR;
- mode &= ~(S_IXUSR | S_IXGRP | S_IXOTH);
+ mode |= S_IRUSR | S_IWUSR; /* read/write by user */
+ mode &= ~(S_IXUSR | S_IXGRP | S_IXOTH); /* executable by none */
+
+ if (getuid() == (uid_t) 0) /* read by group/other */
+ mode |= S_IRGRP | S_IROTH;
+
if (fchmod (fileno(out), mode) != 0)
{
char *buf = (char *) malloc(1024 + strlen(name));
/* Since the .xscreensaver file is used for IPC, let's try and make
sure that the bits actually land on the disk right away. */
sync ();
+
+ status = 0; /* wrote and renamed successfully! */
}
}
else
END:
if (n2) free (n2);
+ return status;
}
\f
extern void load_init_file (saver_preferences *p);
extern Bool init_file_changed_p (saver_preferences *p);
-extern void write_init_file (saver_preferences *p, const char *version_string);
+extern int write_init_file (saver_preferences *p, const char *version_string,
+ Bool verbose_p);
const char *init_file_name (void);
extern screenhack *parse_screenhack (const char *line);
static int
send_xscreensaver_command (Display *dpy, Atom command, long arg,
- Window *window_ret)
+ Window *window_ret, char **error_ret)
{
char *v = 0;
Window window = find_screensaver_window (dpy, &v);
XWindowAttributes xgwa;
+ char err[2048];
if (window_ret)
*window_ret = window;
if (!window)
{
+ sprintf (err, "no screensaver is running on display %s",
+ DisplayString (dpy));
+
+ if (error_ret)
+ {
+ *error_ret = strdup (err);
+ return -1;
+ }
+
if (command == XA_EXIT)
+ /* Don't print an error if xscreensaver is already dead. */
return 1;
- /* Don't print this if xscreensaver is already dead. */
- fprintf (stderr, "%s: no screensaver is running on display %s\n",
- progname, DisplayString (dpy));
+ fprintf (stderr, "%s: %s\n", progname, err);
return -1;
}
memset (&hint, 0, sizeof(hint));
if (!v || !*v)
{
- fprintf (stderr, "%s: version property not set on window 0x%x?\n",
- progname, (unsigned int) window);
+ sprintf (err, "version property not set on window 0x%x?",
+ (unsigned int) window);
+ if (error_ret)
+ *error_ret = strdup (err);
+ else
+ fprintf (stderr, "%s: %s\n", progname, err);
return -1;
}
XGetClassHint(dpy, window, &hint);
if (!hint.res_class)
{
- fprintf (stderr, "%s: class hints not set on window 0x%x?\n",
- progname, (unsigned int) window);
+ sprintf (err, "class hints not set on window 0x%x?",
+ (unsigned int) window);
+ if (error_ret)
+ *error_ret = strdup (err);
+ else
+ fprintf (stderr, "%s: %s\n", progname, err);
return -1;
}
if (data) free (data);
fprintf (stdout, "\n");
fflush (stdout);
- fprintf (stderr, "%s: bad status format on root window.\n",
- progname);
+ fprintf (stderr, "bad status format on root window.\n");
return -1;
}
if (data) free (data);
fprintf (stdout, "\n");
fflush (stdout);
- fprintf (stderr, "%s: no saver status on root window.\n",
- progname);
+ fprintf (stderr, "no saver status on root window.\n");
return -1;
}
}
event.xclient.data.l[2] = arg2;
if (! XSendEvent (dpy, window, False, 0L, &event))
{
- fprintf (stderr, "%s: XSendEvent(dpy, 0x%x ...) failed.\n",
- progname, (unsigned int) window);
+ sprintf (err, "XSendEvent(dpy, 0x%x ...) failed.\n",
+ (unsigned int) window);
+ if (error_ret)
+ *error_ret = strdup (err);
+ else
+ fprintf (stderr, "%s: %s\n", progname, err);
return -1;
}
}
static int
xscreensaver_command_response (Display *dpy, Window window,
- Bool verbose_p, Bool exiting_p)
+ Bool verbose_p, Bool exiting_p,
+ char **error_ret)
{
int fd = ConnectionNumber (dpy);
int timeout = 10;
int status;
fd_set fds;
struct timeval tv;
+ char err[2048];
while (1)
{
if (status < 0)
{
char buf[1024];
- sprintf (buf, "%s: waiting for reply", progname);
- perror (buf);
+ if (error_ret)
+ {
+ sprintf (buf, "error waiting for reply");
+ *error_ret = strdup (buf);
+ }
+ else
+ {
+ sprintf (buf, "%s: error waiting for reply", progname);
+ perror (buf);
+ }
return status;
}
else if (status == 0)
{
- fprintf (stderr, "%s: no response to command.\n", progname);
+ sprintf (err, "no response to command.");
+ if (error_ret)
+ *error_ret = strdup (err);
+ else
+ fprintf (stderr, "%s: %s\n", progname, err);
return -1;
}
else
if (exiting_p)
return 0;
- fprintf (stderr,
- "%s: xscreensaver window unexpectedly deleted.\n",
- progname);
+ sprintf (err, "xscreensaver window unexpectedly deleted.");
+
+ if (error_ret)
+ *error_ret = strdup (err);
+ else
+ fprintf (stderr, "%s: %s\n", progname, err);
+
return -1;
}
{
if (type != XA_STRING || format != 8)
{
- fprintf (stderr,
- "%s: unrecognized response property.\n",
- progname);
+ sprintf (err, "unrecognized response property.");
+
+ if (error_ret)
+ *error_ret = strdup (err);
+ else
+ fprintf (stderr, "%s: %s\n", progname, err);
+
if (msg) XFree (msg);
return -1;
}
else if (!msg || (msg[0] != '+' && msg[0] != '-'))
{
- fprintf (stderr,
- "%s: unrecognized response message.\n",
- progname);
+ sprintf (err, "unrecognized response message.");
+
+ if (error_ret)
+ *error_ret = strdup (err);
+ else
+ fprintf (stderr, "%s: %s\n", progname, err);
+
if (msg) XFree (msg);
return -1;
}
else
{
int ret = (msg[0] == '+' ? 0 : -1);
- if (verbose_p || ret != 0)
- fprintf ((ret < 0 ? stderr : stdout),
- "%s: %s\n",
- progname,
- msg+1);
+ sprintf (err, "%s: %s\n", progname, msg+1);
+
+ if (error_ret)
+ *error_ret = strdup (err);
+ else if (verbose_p || ret != 0)
+ fprintf ((ret < 0 ? stderr : stdout), "%s\n", err);
+
XFree (msg);
return ret;
}
int
-xscreensaver_command (Display *dpy, Atom command, long arg, Bool verbose_p)
+xscreensaver_command (Display *dpy, Atom command, long arg, Bool verbose_p,
+ char **error_ret)
{
Window w = 0;
- int status = send_xscreensaver_command (dpy, command, arg, &w);
+ int status = send_xscreensaver_command (dpy, command, arg, &w, error_ret);
if (status == 0)
status = xscreensaver_command_response (dpy, w, verbose_p,
- (command == XA_EXIT));
+ (command == XA_EXIT),
+ error_ret);
fflush (stdout);
fflush (stderr);
#define _XSCREENSAVER_REMOTE_H_
extern int xscreensaver_command (Display *dpy, Atom command, long arg,
- Bool verbose_p);
+ Bool verbose_p, char **error_ret);
extern void server_xscreensaver_version (Display *dpy,
char **version_ret,
static char *stderr_tail = 0;
static time_t stderr_last_read = 0;
+static int stderr_stdout_read_fd = -1;
+
static void make_stderr_overlay_window (saver_screen_info *);
+/* Recreates the stderr window or GCs: do this when the xscreensaver window
+ on a screen has been re-created.
+ */
void
reset_stderr (saver_screen_info *ssi)
{
ssi->stderr_cmap = 0;
}
+/* Erases any stderr text overlaying the screen (if possible) and resets
+ the stderr output cursor to the upper left. Do this when the xscreensaver
+ window is cleared.
+ */
void
clear_stderr (saver_screen_info *ssi)
{
}
+/* Draws the string on the screen's window.
+ */
static void
print_stderr_1 (saver_screen_info *ssi, char *string)
{
}
+/* Draws the string on each screen's window as error text.
+ */
static void
print_stderr (saver_info *si, char *string)
{
}
+/* Polls the stderr buffer every few seconds and if it finds any text,
+ writes it on all screens.
+ */
static void
stderr_popup_timer_fn (XtPointer closure, XtIntervalId *id)
{
}
+/* Called when data becomes available on the stderr pipe. Copies it into
+ stderr_buffer where stderr_popup_timer_fn() can find it later.
+ */
static void
stderr_callback (XtPointer closure, int *fd, XtIntervalId *id)
{
int size;
int read_this_time = 0;
+ if (!fd || *fd < 0 || *fd != stderr_stdout_read_fd)
+ abort();
+
if (stderr_tail == 0)
stderr_tail = stderr_buffer;
}
}
+/* If stderr capturing is desired, this replaces `stdout' and `stderr'
+ with a pipe, so that any output written to them will show up on the
+ screen as well as on the original value of those streams.
+ */
void
initialize_stderr (saver_info *si)
{
}
}
+ stderr_stdout_read_fd = in;
XtAppAddInput (si->app, in, (XtPointer) XtInputReadMask, stderr_callback,
(XtPointer) si);
}
+
+
+/* If there is anything in the stderr buffer, flush it to the real stderr.
+ This does no X operations. Call this when exiting to make sure any
+ last words actually show up.
+ */
+void
+shutdown_stderr (saver_info *si)
+{
+ if (!real_stderr || stderr_stdout_read_fd < 0)
+ return;
+
+ stderr_callback ((XtPointer) si, &stderr_stdout_read_fd, 0);
+
+ if (stderr_buffer &&
+ stderr_tail &&
+ stderr_buffer < stderr_tail)
+ {
+ *stderr_tail = 0;
+ fprintf (real_stderr, "%s", stderr_buffer);
+ fflush (real_stderr);
+ stderr_tail = stderr_buffer;
+ }
+}
}
while (isspace(*in)) in++; /* skip whitespace */
- if (first && *in == ':') /* token was a visual name; skip it. */
- {
- out = name;
- first = 0;
- goto AGAIN;
- }
*out = 0;
job->name = strdup(name);
saver_preferences *p = &si->prefs;
Bool selected;
- if (hack->visual && *hack->visual == ':')
+ if (hack->visual && *hack->visual)
selected = select_visual(ssi, hack->visual);
else
selected = select_visual(ssi, 0);
int BadWindow_ehandler (Display *dpy, XErrorEvent *error) { exit(1); }
const char *signal_name(int signal) { return "???"; }
void restore_real_vroot (saver_info *si) {}
+void store_saver_status (saver_info *si) {}
void saver_exit (saver_info *si, int status, const char *core) { exit(status);}
int move_mouse_grab (saver_info *si, Window to, Cursor cursor) { return 0; }
vrs = restore_real_vroot_1 (si);
emergency_kill_subproc (si);
+ shutdown_stderr (si);
- if (p->verbose_p) /* nobody cares about this */
- {
- if (vrs)
- fprintf (real_stderr, "%s: vroot restored, exiting.\n", blurb());
- else if (p->verbose_p)
- fprintf (real_stderr, "%s: no vroot to restore; exiting.\n", blurb());
- }
+ if (p->verbose_p && vrs)
+ fprintf (real_stderr, "%s: old vroot restored.\n", blurb());
fflush(real_stdout);
in this Software without prior written authorization from The Open Group.
*
* Author: Jim Fulton, MIT X Consortium
+ *
* GLX and Overlay support added by Jamie Zawinski <jwz@jwz.org>, 11-Nov-99
*
* To compile:
- * cc -DHAVE_GLX glxdpyinfo.c -o glxdpyinfo -lGL -lX11 -lXext -lm
+ * cc -DHAVE_GLX xdpyinfo.c -o xdpyinfo -lGL -lX11 -lXext -lm
*
* Other defines to consider:
* -DHAVE_XIE -DHAVE_XTEST -DHAVE_SYNC -DHAVE_XRECORD
so if we're issuing an activation command, wait a second. */
sleep (1);
- i = xscreensaver_command (dpy, *cmd, arg, True);
+ i = xscreensaver_command (dpy, *cmd, arg, True, NULL);
if (i < 0) exit (i);
else exit (0);
}
.if n .sp 1
.if t .sp .5
..
-.TH XScreenSaver 1 "12-Nov-99 (3.20)" "X Version 11"
+.TH XScreenSaver 1 "18-Nov-99 (3.21)" "X Version 11"
.SH NAME
xscreensaver-command - control a running xscreensaver process
.SH SYNOPSIS
.B \-watch
Prints a line each time the screensaver changes state: when the screen
blanks, locks, unblanks, or when the running hack is changed. This option
-never returns; it is intended for by shell scripts that want to react to
+never returns; it is intended for use by shell scripts that want to react to
the screensaver in some way. An example of its output would be:
.EX
BLANK Fri Nov 5 01:57:22 1999
.EE
Note that LOCK might come either with or without a preceeding BLANK
(depending on whether the lock-timeout is non-zero), so the above program
-is keeps track of both of them.
+keeps track of both of them.
.SH DIAGNOSTICS
If an error occurs while communicating with the \fIxscreensaver\fP daemon, or
if the daemon reports an error, a diagnostic message will be printed to
<widget>
<class>GtkHButtonBox</class>
- <name>demo_cancel_hbox</name>
+ <name>demo_manual_hbox</name>
<layout_style>GTK_BUTTONBOX_DEFAULT_STYLE</layout_style>
<spacing>30</spacing>
<child_min_width>85</child_min_width>
<widget>
<class>GtkButton</class>
<name>demo</name>
- <tooltip>Make any changes to this demo's parameters permanent, and run it in full-screen mode (click the mouse to return.)</tooltip>
+ <tooltip>Run this one in full-screen mode (click the mouse to return.)</tooltip>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<widget>
<class>GtkButton</class>
- <name>apply</name>
- <tooltip>Make any changes to this demo's parameters permanent.</tooltip>
+ <name>manual</name>
+ <tooltip>Click here to read the manual for this display mode, if it has one.</tooltip>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>apply_this_cb</handler>
- <last_modification_time>Mon, 08 Nov 1999 04:46:59 GMT</last_modification_time>
+ <handler>manual_cb</handler>
+ <last_modification_time>Wed, 17 Nov 1999 09:43:37 GMT</last_modification_time>
</signal>
- <label>Apply</label>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>cancel</name>
- <tooltip>Discard any changes you have made to this demo's parameters.</tooltip>
- <can_default>True</can_default>
- <can_focus>True</can_focus>
- <signal>
- <name>clicked</name>
- <handler>cancel_this_cb</handler>
- <last_modification_time>Mon, 08 Nov 1999 04:47:15 GMT</last_modification_time>
- </signal>
- <label>Cancel</label>
+ <label>Documentation...</label>
</widget>
</widget>
</widget>
.if n .sp 1
.if t .sp .5
..
-.TH XScreenSaver 1 "12-Nov-99 (3.20)" "X Version 11"
+.TH XScreenSaver 1 "18-Nov-99 (3.21)" "X Version 11"
.SH NAME
xscreensaver-demo - interactively control the background xscreensaver daemon
.SH SYNOPSIS
or type in a specific visual's hexadecimal ID.
.TP 4
.B Demo
-This button saves your changes and runs the demo in full-screen mode so
-that you can try it out. Click the mouse to dismiss it.
+This button runs the demo in full-screen mode so that you can try it out.
+Click the mouse to dismiss it.
.TP 4
-.B Apply
-This button saves your changes to your \fI~/.xscreensaver\fP file,
-where the
-.BR xscreensaver (1)
-can see them.
-.TP 4
-.B Cancel
-This button discards any unsaved changes you have made, and reverts the
-settings for the selected demo back to what they were before. Note that
-once you hit \fIDemo\fP or \fIApply\fP, that's it!
+.B Documentation
+Since each of the display modes is actually a separate program, they each
+may have their own manual. This opens a window viewing the man page of
+this program, if it has one.
.SH SCREENSAVER OPTIONS TAB
This tab lets you change various settings used by the xscreensaver daemon
itself, rather than its sub-programs.
memset(si, 0, sizeof(*si));
global_si_kludge = si; /* I hate C so much... */
- srandom ((int) time ((time_t *) 0));
+# undef ya_rand_init
+ ya_rand_init ((int) time ((time_t *) 0));
save_argv (argc, argv);
set_version_string (si, &argc, argv);
extern void initialize_stderr (saver_info *si);
extern void reset_stderr (saver_screen_info *ssi);
extern void clear_stderr (saver_screen_info *ssi);
+extern void shutdown_stderr (saver_info *si);
/* =======================================================================
.if n .sp 1
.if t .sp .5
..
-.TH XScreenSaver 1 "12-Nov-99 (3.20)" "X Version 11"
+.TH XScreenSaver 1 "18-Nov-99 (3.21)" "X Version 11"
.SH NAME
xscreensaver - graphics hack and screen locker, launched when the user is idle
.SH SYNOPSIS
-# hacks/Makefile.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
+# hacks/Makefile.in --- xscreensaver, Copyright (c) 1997-1999 Jamie Zawinski.
# the `../configure' script generates `hacks/Makefile' from this file.
@SET_MAKE@
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
install-program: $(EXES)
- @if [ ! -d $(HACKDIR) ]; then $(INSTALL_DIRS) $(HACKDIR) ; fi ; \
+ @if [ ! -d $(install_prefix)$(HACKDIR) ]; then \
+ $(INSTALL_DIRS) $(install_prefix)$(HACKDIR) ; \
+ fi ; \
for program in $(EXES); do \
- echo $(INSTALL_PROGRAM) $$program $(HACKDIR)/$$program ; \
- $(INSTALL_PROGRAM) $$program $(HACKDIR)/$$program ; \
+ echo $(INSTALL_PROGRAM) $$program \
+ $(install_prefix)$(HACKDIR)/$$program ; \
+ $(INSTALL_PROGRAM) $$program \
+ $(install_prefix)$(HACKDIR)/$$program ; \
done
install-scripts: $(SCRIPTS) munge-scripts
else \
p=$(srcdir)/$$program ; \
fi ; \
- echo $(INSTALL_PROGRAM) $$p $(HACKDIR)/$$program ; \
- $(INSTALL_PROGRAM) $$p $(HACKDIR)/$$program ; \
+ echo $(INSTALL_PROGRAM) $$p \
+ $(install_prefix)$(HACKDIR)/$$program ; \
+ $(INSTALL_PROGRAM) $$p \
+ $(install_prefix)$(HACKDIR)/$$program ; \
done
munge-scripts: $(SCRIPTS)
install-man: $(MEN)
@men="$(MEN)" ; \
- if [ ! -d $(man1dir) ]; then $(INSTALL_DIRS) $(man1dir) ; fi ; \
+ if [ ! -d $(install_prefix)$(man1dir) ]; then \
+ $(INSTALL_DIRS) $(install_prefix)$(man1dir) ; \
+ fi ; \
for man in $$men; do \
instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
- echo $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
- $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
+ echo $(INSTALL_DATA) $(srcdir)/$$man \
+ $(install_prefix)$(man1dir)/$$instname ; \
+ $(INSTALL_DATA) $(srcdir)/$$man \
+ $(install_prefix)$(man1dir)/$$instname ; \
done
uninstall-program:
@for program in $(EXES) $(SCRIPTS); do \
- echo rm -f $(HACKDIR)/$$program ; \
- rm -f $(HACKDIR)/$$program ; \
+ echo rm -f $(install_prefix)$(HACKDIR)/$$program ; \
+ rm -f $(install_prefix)$(HACKDIR)/$$program ; \
done
uninstall-man:
@men="$(MEN)" ; \
for man in $$men; do \
instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
- echo rm -f $(man1dir)/$$instname ; \
- rm -f $(man1dir)/$$instname ; \
+ echo rm -f $(install_prefix)$(man1dir)/$$instname ; \
+ rm -f $(install_prefix)$(man1dir)/$$instname ; \
done
clean:
fgc = XCreateGC (dpy, window, 0, &gcv);
- x2 = rand() % model_w;
- y2 = rand() % model_h;
+ x2 = random() % model_w;
+ y2 = random() % model_h;
delay_usecs = get_integer_resource ("delay", "Integer");
n_restart = get_integer_resource ("restart", "Integer");
int delay = get_integer_resource ("delay", "Integer");
int ncolors = get_integer_resource ("ncolors", "Integer");
Bool dbuf = get_boolean_resource ("doubleBuffer", "Boolean");
- XColor colors[255];
+ XColor *colors = 0;
XGCValues gcv;
GC erase_gc = 0;
int i;
transparent_p = get_boolean_resource("transparent", "Transparent");
+ colors = (XColor *) calloc (sizeof(*colors), ncolors);
+
if (get_boolean_resource("mono", "Boolean"))
{
MONO:
/* There are between minCircles and maxCircles in each figure.
*/
- n = minCircles + rand() % (maxCircles - minCircles);
+ n = minCircles + random() % (maxCircles - minCircles);
head = NULL;
while (n--)
-# hacks/glx/Makefile.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
+# hacks/glx/Makefile.in --- xscreensaver, Copyright (c) 1999 Jamie Zawinski.
# the `../../configure' script generates `hacks/glx/Makefile' from this file.
@SET_MAKE@
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
install-program: $(EXES)
- @exes="$(EXES)" ; \
- if [ ! -d $(HACKDIR) ]; then $(INSTALL_DIRS) $(HACKDIR) ; fi ; \
+ @if [ ! -d $(install_prefix)$(HACKDIR) ]; then \
+ $(INSTALL_DIRS) $(install_prefix)$(HACKDIR) ; \
+ fi ; \
+ exes="$(EXES)" ; \
for program in $$exes; do \
- echo $(INSTALL_PROGRAM) $$program $(HACKDIR)/$$program ; \
- $(INSTALL_PROGRAM) $$program $(HACKDIR)/$$program ; \
+ echo $(INSTALL_PROGRAM) $$program \
+ $(install_prefix)$(HACKDIR)/$$program ; \
+ $(INSTALL_PROGRAM) $$program \
+ $(install_prefix)$(HACKDIR)/$$program ; \
done
install-man: $(MEN)
@men="$(MEN)" ; \
- if [ ! -d $(man1dir) ]; then $(INSTALL_DIRS) $(man1dir) ; fi ; \
+ if [ ! -d $(install_prefix)$(man1dir) ]; then \
+ $(INSTALL_DIRS) $(install_prefix)$(man1dir) ; \
+ fi ; \
for man in $$men; do \
instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
- echo $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
- $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
+ echo $(INSTALL_DATA) $(srcdir)/$$man \
+ $(install_prefix)$(man1dir)/$$instname ; \
+ $(INSTALL_DATA) $(srcdir)/$$man \
+ $(install_prefix)$(man1dir)/$$instname ; \
done
uninstall-program:
- @for program in $(EXES); do \
- echo rm -f $(HACKDIR)/$$program ; \
- rm -f $(HACKDIR)/$$program ; \
+ @exes="$(EXES)" ; \
+ for program in $$exes; do \
+ echo rm -f $(install_prefix)$(HACKDIR)/$$program ; \
+ rm -f $(install_prefix)$(HACKDIR)/$$program ; \
done
uninstall-man:
@men="$(MEN)" ; \
for man in $$men; do \
instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
- echo rm -f $(man1dir)/$$instname ; \
- rm -f $(man1dir)/$$instname ; \
+ echo rm -f $(install_prefix)$(man1dir)/$$instname ; \
+ rm -f $(install_prefix)$(man1dir)/$$instname ; \
done
clean:
* Revision History:
* Tue Oct 19 22:24:47 PDT 1999 Initial creation by David Konerding
+ * <dek@cgl.ucsf.edu>
*
* Notes:
* This screensaver requires the GLE ("OpenGL Tubing and Extrusion Library")
{
/* size = (drand48()+size_range[0]) * size_range[1]/2.; */
/* glPointSize(size); */
- x = drand48()*width;
- y = drand48()*height;
+ x = random()*width;
+ y = random()*height;
glVertex2f(x,y);
}
glEnd();
quads[i].ty = 0.;
quads[i].tz = -10;
- quads[i].drx = drand48() * 5.;
- quads[i].dry = drand48() * 5.;
+ quads[i].drx = random() * 5.;
+ quads[i].dry = random() * 5.;
quads[i].drz = 0;
}
}
{
gasketstruct *gp = &gasket[MI_SCREEN(mi)];
- gp->xinc = 0.1*(1.0*rand()/RAND_MAX);
- gp->yinc = 0.1*(1.0*rand()/RAND_MAX);
- gp->zinc = 0.1*(1.0*rand()/RAND_MAX);
+ gp->xinc = 0.1*(1.0*random()/RAND_MAX);
+ gp->yinc = 0.1*(1.0*random()/RAND_MAX);
+ gp->zinc = 0.1*(1.0*random()/RAND_MAX);
gp->light_colour[0] = 6.0;
gp->light_colour[1] = 6.0;
gp->light_colour[2] = 6.0;
if (ncolors <= 2) ncolors = 0;
if (ncolors == 0) mono_p = True;
+ if (ncolors > 255) ncolors = 255; /* too many look bad */
fg_pixel = get_pixel_resource ("background", "Background", dpy, cmap);
bg_pixel = get_pixel_resource ("foreground", "Foreground", dpy, cmap);
if(!mono) {
c->pal = calloc(c->colors, sizeof(XColor));
- srand48(time(NULL));
-
gray = get_boolean_resource("gray", "Boolean");
if(!gray) {
H[0] = frand(360.0);
gcClear = XCreateGC(dpy, window, GCForeground, &gcv);
XClearWindow(dpy, window);
- srandom(time(NULL));
initPointArrays();
aCurr = aWork[nWork = 0];
aPrev = NULL;
typedef struct cell_s
{
- short x; /* 0 - */
- short y; /* 2 */
- unsigned char col; /* 4 */
- unsigned char isnext; /* 5 */
- unsigned char nextcol; /* 6 */
- /* 7 */
- struct cell_s *next; /* 8 - */
- struct cell_s *prev; /* 12 */
- FLOAT speed; /* 16 - */
- FLOAT growth; /* 20 24 */
- FLOAT nextspeed; /* 24 32 - */
- /* 28 40 */
+ unsigned char col; /* 0 */
+ unsigned char isnext; /* 1 */
+ unsigned char nextcol; /* 2 */
+ /* 3 */
+ struct cell_s *next; /* 4 */
+ struct cell_s *prev; /* 8 - */
+ FLOAT speed; /* 12 */
+ FLOAT growth; /* 16 20 - */
+ FLOAT nextspeed; /* 20 28 */
+ /* 24 36 - */
} cell;
static int arr_width;
static FLOAT maxdeathspeed;
static Bool originalcolors;
+#define cell_x(c) (((c) - arr) % arr_width)
+#define cell_y(c) (((c) - arr) / arr_width)
+
+
static int random_life_value (void)
{
return (int) ((RAND_FLOAT * (maxlifespan - minlifespan)) + minlifespan);
count = get_integer_resource ("count", "Integer");
if (count < 2) count = 2;
+
+ /* number of colors can't be greater than the half depth of the screen. */
if (count > (1L << (xgwa.depth-1)))
count = (1L << (xgwa.depth-1));
+ /* Actually, since cell->col is of type char, this has to be small. */
+ if (count >= (1L << ((sizeof(arr[0].col) * 8) - 1)))
+ count = (1L << ((sizeof(arr[0].col) * 8) - 1));
+
+
if (originalcolors && (count > 8))
{
count = 8;
int row = y * arr_width;
for (x = 0; x < arr_width; x++)
{
- arr[row+x].x = x;
- arr[row+x].y = y;
arr[row+x].speed = 0.0;
arr[row+x].growth = 0.0;
arr[row+x].col = 0;
c->next->prev = c->prev;
c->prev = 0;
c->speed = 0.0;
- drawblock (c->x, c->y, c->col);
+ drawblock (cell_x(c), cell_y(c), c->col);
}
if (coords)
for (i = 0; i < 4; i++)
{
- int x = a->x + coords[i].x;
- int y = a->y + coords[i].y;
+ int x = cell_x(a) + coords[i].x;
+ int y = cell_y(a) + coords[i].y;
if (x < 0) x = arr_width - 1;
else if (x >= arr_width) x = 0;
a->speed = a->nextspeed;
a->growth = 0.0;
a->col = a->nextcol;
- drawblock (a->x, a->y, a->col + count);
+ drawblock (cell_x(a), cell_y(a), a->col + count);
}
}
}
* Options
* -delay usleep every iteration
* -rate Add one drop every "rate" iterations
+ * -box Add big square splash every "box" iters (not very good)
* -water Ripples on a grabbed background image
* -foreground Interpolate ripples between these two colors
* -background
* -oily Psychedelic colours like man
* -stir Add a regular pattern of drops
* -fluidity Between 0 and 16. 16 = big drops
- * -light Hack to add lighting effect (2 for 16bbp, 6 for 32bpp)
+ * -light Hack to add lighting effect
*
* Code mainly hacked from xflame and decayscreen.
*/
/* Version history:
- * Speeded up graphics with dirty buffer. Returned to using putpixel for
- * greater portability
- * Added a variety of methods for splashing screen.
+ * 13 Oct 1999: Initial hack
+ * 30 Oct 1999: Speeded up graphics with dirty buffer. Returned to using
+ * putpixel for greater portability
+ * Added a variety of methods for splashing screen.
+ * 31 Oct 1999: Added in lighting hack
+ * 13 Nov 1999: Speed up tweaks
+ * Adjust "light" for different bits per colour (-water only)
+ *
*/
#define TABLE 256
static double cos_tab[TABLE];
-static double drop_dist[] =
+/* Distribution of drops: many little ones and a few big ones. */
+static double drop_dist[] =
{0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.6};
+static void (*draw_transparent)(short *src);
+
/* How hard to hit the water */
#define SPLASH 512
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define MAX(x, y) ((x) > (y) ? (x) : (y))
-#define DIRTY 2 /* 2 = dirty, 1 = restore original pixel, 0 = leave alone */
+#define DIRTY 3 /* dirty >= 2, 1 = restore original pixel, 0 = leave alone */
+
+/* From fortune(6) */
+/* -- really weird C code to count the number of bits in a word */
+#define BITCOUNT(x) (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255)
+#define BX_(x) ((x) - (((x)>>1)&0x77777777) \
+ - (((x)>>2)&0x33333333) \
+ - (((x)>>3)&0x11111111))
/* ------------------------------------------- */
if (*dirty > 0) {
int dx;
if (light > 0) {
- /* dx = ((v2 - v1) + (v4 - v3)) << light; */ /* light from left */
dx = ((v3 - v1) + (v4 - v2)) << light; /* light from top */
} else
dx = 0;
/* ------------------------------------------- */
-static unsigned long (*bright)(int dx, unsigned long color);
+/* Uses the horizontal gradient as an offset to create a warp effect */
+static void
+draw_transparent_vanilla(short *src)
+{
+ int across, down, pixel;
+ char *dirty = dirty_buffer;
+
+ pixel = 0;
+ for (down = 0; down < height - 2; down++, pixel += 2)
+ for (across = 0; across < width-2; across++, pixel++) {
+ int gradx, grady, gradx1, grady1;
+ int x0, x1, x2, y1, y2;
+
+ x0 = src[pixel];
+ x1 = src[pixel + 1];
+ x2 = src[pixel + 2];
+ y1 = src[pixel + width];
+ y2 = src[pixel + 2*width];
+
+ gradx = (x1 - x0);
+ grady = (y1 - x0);
+ gradx1= (x2 - x1);
+ grady1= (y2 - y1);
+ gradx1 = 1 + (gradx + gradx1) / 2;
+ grady1 = 1 + (grady + grady1) / 2;
+
+ if ((2*across+MIN(gradx,gradx1) < 0) ||
+ (2*across+MAX(gradx,gradx1) >= bigwidth)) {
+ gradx = 0;
+ gradx1= 1;
+ }
+ if ((2*down+MIN(grady,grady1) < 0) ||
+ (2*down+MAX(grady,grady1) >= bigheight)) {
+ grady = 0;
+ grady1 = 1;
+ }
+
+ if ((gradx == 0 && gradx1 == 1 && grady == 0 && grady1 == 1)) {
+ if (dirty[pixel] > 0)
+ dirty[pixel]--;
+ } else
+ dirty[pixel] = DIRTY;
+
+ if (dirty[pixel] > 0) {
+ XPutPixel(buffer_map, (across<<1), (down<<1),
+ XGetPixel(orig_map, (across<<1) + gradx, (down<<1) + grady));
+ XPutPixel(buffer_map, (across<<1)+1,(down<<1),
+ XGetPixel(orig_map, (across<<1) + gradx1,(down<<1) + grady));
+ XPutPixel(buffer_map, (across<<1), (down<<1)+1,
+ XGetPixel(orig_map, (across<<1) + gradx, (down<<1) + grady1));
+ XPutPixel(buffer_map, (across<<1)+1,(down<<1)+1,
+ XGetPixel(orig_map, (across<<1) + gradx1,(down<<1) + grady1));
+ }
+ }
+}
+
+
+/* ------------------------------------------- */
+
+
+/* This builds on the above warp effect by adding in a lighting effect: */
+/* brighten pixels by an amount corresponding to the vertical gradient */
static unsigned long rmask;
static unsigned long gmask;
static unsigned long bmask;
static int bshift;
-static void
+static void
set_mask(unsigned long color, unsigned long *mask, int *shift)
{
*shift = 0;
static unsigned long
-dobright(int dx, unsigned long color)
+bright(int dx, unsigned long color)
{
return (cadd(color, dx, rmask, rshift) |
cadd(color, dx, gmask, gshift) |
}
-static unsigned long
-nobright(int dx, unsigned long color)
-{
- return color;
-}
-
-
static void
-draw_transparent(short *src)
+draw_transparent_light(short *src)
{
int across, down, pixel;
char *dirty = dirty_buffer;
if (dirty[pixel] > 0) {
int dx;
- if (light > 0) {
- if (4-light >= 0)
- dx = (grady + (src[pixel+width+1]-x1)) >> (4-light); /* light from top */
- else
- dx = (grady + (src[pixel+width+1]-x1)) << (light-4); /* light from top */
- } else
- dx = 0;
- XPutPixel(buffer_map, (across<<1), (down<<1),
- bright(dx, XGetPixel(orig_map, (across<<1) + gradx, (down<<1) + grady)));
- XPutPixel(buffer_map, (across<<1)+1,(down<<1),
- bright(dx, XGetPixel(orig_map, (across<<1) + gradx1,(down<<1) + grady)));
- XPutPixel(buffer_map, (across<<1), (down<<1)+1,
- bright(dx, XGetPixel(orig_map, (across<<1) + gradx, (down<<1) + grady1)));
- XPutPixel(buffer_map, (across<<1)+1,(down<<1)+1,
- bright(dx, XGetPixel(orig_map, (across<<1) + gradx1,(down<<1) + grady1)));
+
+ /* light from top */
+ if (4-light >= 0)
+ dx = (grady + (src[pixel+width+1]-x1)) >> (4-light);
+ else
+ dx = (grady + (src[pixel+width+1]-x1)) << (light-4);
+
+ if (dx != 0) {
+ XPutPixel(buffer_map, (across<<1), (down<<1),
+ bright(dx, XGetPixel(orig_map, (across<<1) + gradx, (down<<1) + grady)));
+ XPutPixel(buffer_map, (across<<1)+1,(down<<1),
+ bright(dx, XGetPixel(orig_map, (across<<1) + gradx1,(down<<1) + grady)));
+ XPutPixel(buffer_map, (across<<1), (down<<1)+1,
+ bright(dx, XGetPixel(orig_map, (across<<1) + gradx, (down<<1) + grady1)));
+ XPutPixel(buffer_map, (across<<1)+1,(down<<1)+1,
+ bright(dx, XGetPixel(orig_map, (across<<1) + gradx1,(down<<1) + grady1)));
+ } else {
+ /* Could use XCopyArea, but XPutPixel is faster */
+ XPutPixel(buffer_map, (across<<1), (down<<1),
+ XGetPixel(orig_map, (across<<1) + gradx, (down<<1) + grady));
+ XPutPixel(buffer_map, (across<<1)+1,(down<<1),
+ XGetPixel(orig_map, (across<<1) + gradx1,(down<<1) + grady));
+ XPutPixel(buffer_map, (across<<1), (down<<1)+1,
+ XGetPixel(orig_map, (across<<1) + gradx, (down<<1) + grady1));
+ XPutPixel(buffer_map, (across<<1)+1,(down<<1)+1,
+ XGetPixel(orig_map, (across<<1) + gradx1,(down<<1) + grady1));
+ }
}
}
}
/* ------------------------------------------- */
-/*
+#if 0
+/* Doesn't go any faster and doesn't work at all colour depths */
static void
-draw_ripple16(short *src)
+draw_transparent16l(short *src)
{
- int across, down;
- unsigned short *dest;
+ int across, down, bigpix, pixel;
+ char *dirty = dirty_buffer;
+ unsigned short *buffer, *orig;
- dest = (unsigned short *) buffer_map->data;
+ buffer = (unsigned short *) buffer_map->data;
+ orig = (unsigned short *) orig_map->data;
- for (down = 0; down < height - 1; down++, src += 1, dest += bigwidth+2)
- for (across = 0; across < width - 1; across++, src++) {
- int v1, v2, v3, v4;
- v1 = (int)*src;
- v2 = (int)*(src + 1);
- v3 = (int)*(src + width);
- v4 = (int)*(src + width + 1);
- if (!(v1 == 0 && v2 == 0 && v3 == 0 && v4 == 0)) {
- *dest++ = map_color(v1);
- *dest = map_color((v1 + v2) >> 1);
- dest += bigwidth - 1;
- *dest++ = map_color((v1 + v3) >> 1);
- *dest = map_color((v1 + v4) >> 1);
- dest -= bigwidth - 1;
+ for (pixel = bigpix = down = 0;
+ down < height - 2;
+ down++, pixel += 2, bigpix += bigwidth+4)
+ for (across = 0; across < width-2; across++, pixel++, bigpix+=2) {
+ int gradx, grady, gradx1, grady1;
+ int x0, x1, x2, y1, y2;
+
+ x0 = src[pixel];
+ x1 = src[pixel + 1];
+ x2 = src[pixel + 2];
+ y1 = src[pixel + width];
+ y2 = src[pixel + 2*width];
+
+ gradx = (x1 - x0);
+ grady = (y1 - x0);
+ gradx1= (x2 - x1);
+ grady1= (y2 - y1);
+ gradx1 = 1 + (gradx + gradx1) / 2;
+ grady1 = 1 + (grady + grady1) / 2;
+
+ if ((2*across+MIN(gradx,gradx1) < 0) ||
+ (2*across+MAX(gradx,gradx1) >= bigwidth)) {
+ gradx = 0;
+ gradx1= 1;
+ }
+ if ((2*down+MIN(grady,grady1) < 0) ||
+ (2*down+MAX(grady,grady1) >= bigheight)) {
+ grady = 0;
+ grady1 = 1;
+ }
+
+ if ((gradx == 0 && gradx1 == 1 && grady == 0 && grady1 == 1)) {
+ if (dirty[pixel] > 0)
+ dirty[pixel]--;
} else
- dest += 2;
+ dirty[pixel] = DIRTY;
+
+ if (dirty[pixel] > 0) {
+ unsigned short *dest = buffer + bigpix;
+ unsigned short *image = orig + bigpix;
+ int dx;
+
+ /* light from top */
+ if (4-light >= 0)
+ dx = (grady + (src[pixel+width+1]-x1)) >> (4-light);
+ else
+ dx = (grady + (src[pixel+width+1]-x1)) << (light-4);
+
+ grady *= bigwidth;
+ grady1*= bigwidth;
+
+ if (dx != 0) {
+ *dest++ = dobright(dx, *(image + gradx + grady));
+ *dest = dobright(dx, *(image + gradx1 + grady));
+ dest += bigwidth - 1;
+ *dest++ = dobright(dx, *(image + gradx + grady1));
+ *dest = dobright(dx, *(image + gradx1 + grady1));
+ } else {
+ *dest++ = *(image + gradx + grady);
+ *dest = *(image + gradx1 + grady);
+ dest += bigwidth - 1;
+ *dest++ = *(image + gradx + grady1);
+ *dest = *(image + gradx1 + grady1);
+ }
+ }
}
}
-*/
+#endif
/* ------------------------------------------- */
gcflags = GCForeground | GCFunction;
if (use_subwindow_mode_p(xwa.screen, window)) /* see grabscreen.c */
gcflags |= GCSubwindowMode;
+
gc = XCreateGC(display, window, gcflags, &gcv);
grab_screen_image(xwa.screen, window);
XGCValues gcv;
gc = XCreateGC(display, window, 0, &gcv);
- if (!gc) {
- fprintf(stderr, "XCreateGC failed\n");
- exit(1);
- }
-
orig_map = 0;
}
+ if (!gc) {
+ fprintf(stderr, "XCreateGC failed\n");
+ exit(1);
+ }
+
buffer_map = 0;
#ifdef HAVE_XSHM_EXTENSION
#endif /* HAVE_XSHM_EXTENSION */
XPutImage(display, window, gc, buffer_map, 0, 0, 0, 0,
bigwidth, bigheight);
+
+ XSync(display,False);
+ screenhack_handle_events(display);
}
/* ------------------------------------------- */
+static void
+init_cos_tab(void)
+{
+ int i;
+ for (i = 0; i < TABLE; i++)
+ cos_tab[i] = cos(i * M_PI/2 / TABLE);
+}
+
+
/* Shape of drop to add */
static double
sinc(double x)
{
#if 1
+ /* cosine hump */
int i;
i = (int)(x * TABLE + 0.5);
if (i >= TABLE) i = (TABLE-1) - (i-(TABLE-1));
int newx, newy, dheight;
int radius = MIN(width, height) / 50;
/* Don't put drops too near the edge of the screen or they get stuck */
- int border = 6;
+ int border = 8;
switch (mode) {
default:
bufferB = (short *)calloc(width * height, sizeof(*bufferB));
temp = (short *)calloc(width * height, sizeof(*temp));
- dirty_buffer = (char *)malloc(width * height);
- memset(dirty_buffer, DIRTY, width * height);
+ dirty_buffer = (char *)calloc(width * height, sizeof(*dirty_buffer));
for (i = 0; i < ndrops; i++)
add_drop(ripple_blob, splash);
if (transparent) {
/* There's got to be a better way of doing this XCopyArea? */
- int across, down;
- for (down = 0; down < bigheight-4; down++)
- for (across = bigwidth-4; across < bigwidth; across++)
- XPutPixel(buffer_map, across, down,
- XGetPixel(orig_map, across, down));
- for (down = bigheight-4; down < bigheight; down++)
- for (across = 0; across < bigwidth; across++)
- XPutPixel(buffer_map, across, down,
- XGetPixel(orig_map, across, down));
+ memcpy(buffer_map->data, orig_map->data,
+ bigheight * buffer_map->bytes_per_line);
} else {
int across, down, color;
[ u(t+1)-2u(t)+u(t-1) ] / dt = a [ u(x+1)+u(x-1)+u(y+1)+u(y-1)-4u ] / h
- where dt = time step squared, h= dx*dy = mesh resolution squared.
+ where dt = time step squared, h = dx*dy = mesh resolution squared.
From where u(t+1) may be calculated as:
toggle = 0;
}
-#if 1
- /* Traditional, squarer ripples */
switch (count) {
case 0: case 1:
pixel = 1 * width + 1;
pixel = 1 * width + 1;
for (down = 1; down < height - 1; down++, pixel += 2 * 1)
for (across = 1; across < width - 1; across++, pixel++) {
- int damp =
- (temp[pixel - 1] + temp[pixel + 1] +
- temp[pixel - width] + temp[pixel + width] +
- temp[pixel - width - 1] + temp[pixel - width + 1] +
- temp[pixel + width - 1] + temp[pixel + width + 1] +
- temp[pixel]) / 9;
- dest[pixel] = damp - (damp >> fluidity);
+ if (temp[pixel] != 0) { /* Close enough for government work */
+ int damp =
+ (temp[pixel - 1] + temp[pixel + 1] +
+ temp[pixel - width] + temp[pixel + width] +
+ temp[pixel - width - 1] + temp[pixel - width + 1] +
+ temp[pixel + width - 1] + temp[pixel + width + 1] +
+ temp[pixel]) / 9;
+ dest[pixel] = damp - (damp >> fluidity);
+ } else
+ dest[pixel] = 0;
}
break;
case 2: case 3:
break;
}
if (++count > 3) count = 0;
-#else
- /* Rounder ripples, but with strange cross effect in center */
- pixel = 1 * width + 1;
- for (down = 1; down < height - 1; down++, pixel += 2 * 1)
- for (across = 1; across < width - 1; across++, pixel++) {
- int grad;
- grad =
- (src[pixel - 1] + src[pixel + 1] +
- src[pixel - width] + src[pixel + width] +
- src[pixel - width - 1] + src[pixel - width + 1] +
- src[pixel + width - 1] + src[pixel + width + 1]) / 2;
- dest[pixel] = grad/2 - dest[pixel];
- dest[pixel] -= (dest[pixel] >> fluidity);
- }
-#endif
if (transparent)
draw_transparent(dest);
int stir = get_boolean_resource("stir", "Boolean");
int fluidity = get_integer_resource("fluidity", "Integer");
transparent = get_boolean_resource("water", "Boolean");
+#ifdef HAVE_XSHM_EXTENSION
use_shm = get_boolean_resource("useSHM", "Boolean");
+#endif /* HAVE_XSHM_EXTENSION */
light = get_integer_resource("light", "Integer");
if (fluidity <= 1) fluidity = 1;
if (fluidity > 16) fluidity = 16; /* 16 = sizeof(short) */
if (light < 0) light = 0;
- { int i;
- for (i = 0; i < TABLE; i++)
- cos_tab[i] = cos(i * M_PI/2 / TABLE);
- }
-
+ init_cos_tab();
setup_X(disp, win);
ncolors = get_integer_resource ("colors", "Colors");
if (0 == ncolors) /* English spelling? */
ncolors = get_integer_resource ("colours", "Colors");
+
+ if (ncolors > sizeof(ctab)/sizeof(*ctab))
+ ncolors = sizeof(ctab)/sizeof(*ctab);
+
if (oily)
init_oily_colors();
else
init_linear_colors();
if (transparent && light > 0) {
- bright = dobright;
+ int maxbits;
+ draw_transparent = draw_transparent_light;
set_mask(visual->red_mask, &rmask, &rshift);
set_mask(visual->green_mask, &gmask, &gshift);
set_mask(visual->blue_mask, &bmask, &bshift);
- if (rmask == 0) bright = nobright;
+ if (rmask == 0) draw_transparent = draw_transparent_vanilla;
+
+ /* Adjust the shift value "light" when we don't have 8 bits per colour */
+ maxbits = MIN(MIN(BITCOUNT(rmask), BITCOUNT(gmask)), BITCOUNT(bmask));
+ light -= 8-maxbits;
+ if (light < 0) light = 0;
} else
- bright = nobright;
+ draw_transparent = draw_transparent_vanilla;
init_ripples(0, -SPLASH); /* Start off without any drops */
+ /* Main drawing loop */
while (1) {
if (rate > 0 && (iterations % rate) == 0)
add_drop(ripple_blob, -SPLASH);
ripple(fluidity);
DisplayImage();
- XSync(display,False);
- screenhack_handle_events(display);
if (delay)
usleep(delay);
if (visual_string && *visual_string)
{
- if (visual != desired_visual)
+ char *s;
+ for (s = visual_string; *s; s++)
+ if (isupper (*s)) *s = _tolower (*s);
+
+ if (!strcmp (visual_string, "default") ||
+ !strcmp (visual_string, "default") ||
+ !strcmp (visual_string, "best"))
+ /* don't warn about these, just silently DWIM. */
+ ;
+ else if (visual != desired_visual)
{
fprintf (stderr, "%s: ignoring `-visual %s' because of `%s'.\n",
progname, visual_string, why);
XtNcolormap, cmap,
XtNbackground, (Pixel) bg,
XtNborderColor, (Pixel) bd,
+ XtNinput, True, /* for WM_HINTS */
0);
XtDestroyWidget (toplevel);
toplevel = new;
}
else
{
- XtVaSetValues (toplevel, XtNmappedWhenManaged, False, 0);
+ XtVaSetValues (toplevel,
+ XtNmappedWhenManaged, False,
+ XtNinput, True, /* for WM_HINTS */
+ 0);
XtRealizeWidget (toplevel);
window = XtWindow (toplevel);
XIfEvent (dpy, &event, MapNotify_event_p, (XPointer) window);
XSync (dpy, False);
- srandom ((int) time ((time_t *) 0));
+
+ /* This is the one and only place that the random-number generator is
+ seeded in any screenhack. You do not need to seed the RNG again,
+ it is done for you before your code is invoked. */
+# undef ya_rand_init
+ ya_rand_init ((int) time ((time_t *) 0));
+
screenhack (dpy, window); /* doesn't return */
return 0;
}
use Fcntl ':flock'; # import LOCK_* constants
-my $version = q{ $Revision: 1.41 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
+my $version = q{ $Revision: 1.42 $ }; $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";
$paddr = sockaddr_in($port2, $iaddr);
+ my $head = "";
+ my $body = "";
+
@_ =
eval {
local $SIG{ALRM} = sub {
"\n");
my $http = <S>;
- my $head = "";
- my $body = "";
while (<S>) {
$head .= $_;
last if m@^[\r\n]@;
die if ($@ && $@ ne "alarm\n"); # propagate errors
if ($@) {
# timed out
+ $head = undef;
+ $body = undef;
return ();
} else {
# didn't
print STDERR "$progname: too many redirects " .
"($max_loop_count) from $orig_url\n";
}
+ $body = undef;
return ();
}
} elsif ( $http =~ m@HTTP/[0-9.]+ [4-9][0-9][0-9]@ ) {
# http errors -- return nothing.
+ $body = undef;
return ();
} else {
" \"$url\": rejecting.\n";
}
$rejected_urls{$url} = -1;
+ $body = undef;
+ $_ = undef;
return ();
}
" length $L in $url: rejecting.\n";
}
$rejected_urls{$url} = $L;
+ $body = undef;
+ $_ = undef;
return ();
} elsif ( $verbose > 2 ) {
print STDERR "$progname: keywords of length $L" .
}
}
+ $_ = undef;
+ $body = undef;
+
if ( $#urls == 0 ) {
if ( $verbose > 2 ) {
print STDERR "$progname: no images on $base\n";
my ( $base, $body ) = get_document ($random_redirector, undef, $timeout);
- return if (!$base || !$body);
+ if (!$base || !$body) {
+ $body = undef;
+ return;
+ }
my $img = pick_image_from_body ($base, $body);
+ $body = undef;
if ($img) {
return ($base, $img, "yahoo");
my ( $base, $body ) = get_document ($search_url, undef, $timeout);
if (defined ($timeout)) {
$timeout -= (time - $start);
- return () if ($timeout <= 0);
+ if ($timeout <= 0) {
+ $body = undef;
+ return ();
+ }
}
return () if (! $body);
print STDERR "$progname: found nothing on $base " .
"($length bytes, $href_count links).\n";
}
+ $body = undef;
+ $_ = undef;
return ();
}
}
+ $body = undef;
+ $_ = undef;
my ( $base2, $body2 ) = get_document ($subpage, $base, $timeout);
- return () if (!$base2 || !$body2);
+ if (!$base2 || !$body2) {
+ $body2 = undef;
+ return ();
+ }
my $img = pick_image_from_body ($base2, $body2);
+ $body2 = undef;
if ($img) {
return ($base2, $img,
}
kill ('TERM', $pid) if ($pid);
$timed_out = 1;
+ $body = undef;
};
if (($pid = open(PIPE, "| $cmd2 > $output"))) {
$timed_out = 0;
alarm $cvt_timeout;
print PIPE $body;
+ $body = undef;
close PIPE;
if ($verbose > 3) { print STDERR "$progname: awaiting $pid\n"; }
die if ($@ && $@ ne "alarm\n"); # propagate errors
if ($@) {
# timed out
+ $body = undef;
return ();
} else {
# didn't
alarm 0;
+ $body = undef;
return @_;
}
}
$cmd .= "pnmpaste - $x $y $image_ppm > $image_tmp1";
open (IMG, "| $cmd") || die ("running $cmd: $!\n");
print IMG $body;
+ $body = undef;
close (IMG);
if ($verbose > 1) {
print STDERR "$progname: subproc exited normally.\n";
my ($headers, $body) = get_document ($img, $base);
if ($body) {
handle_image ($base, $img, $body, $source);
+ $body = undef;
}
}
unlink $image_tmp1, $image_tmp2;
}
my ($iw, $ih) = image_to_pnm ($img, $body, $image_tmp1);
+ $body = undef;
return 0 unless ($iw && $ih);
my $ow = $iw; # used only for error messages
if (!$root_p && !$no_output_p) {
die "$copyright" .
- "$progname: the -root argument is manditory (for now.)\n";
+ "$progname: the -root argument is mandatory (for now.)\n";
}
if (!$no_output_p && !$ENV{DISPLAY}) {
#define countof(x) (sizeof((x))/sizeof(*(x)))
+#define MAX_COLORS (1L<<13)
+
extern ModeSpecOpt xlockmore_opts[];
extern const char *app_defaults;
mi.npixels = get_integer_resource ("ncolors", "Integer");
if (mi.npixels <= 0)
mi.npixels = 64;
- else if (mi.npixels > 256)
- mi.npixels = 256;
+ else if (mi.npixels > MAX_COLORS)
+ mi.npixels = MAX_COLORS;
mi.colors = (XColor *) calloc (mi.npixels, sizeof (*mi.colors));
signal(sig_Number,xsublim_Sig_Catch);
}
- /* Randomize */
- srandom((int)time((time_t*)0));
+ /* Randomize -- only need to do this here because this program
+ doesn't use the `screenhack.h' or `lockmore.h' APIs. */
+# undef ya_rand_init
+ ya_rand_init ((int) time ((time_t *) 0));
/* Handle all the X nonsense */
#if defined(__sgi)
static const char screensaver_id[] =
- "@(#)xscreensaver 3.20 (12-Nov-99), by Jamie Zawinski (jwz@jwz.org)";
+ "@(#)xscreensaver 3.21 (17-Nov-99), by Jamie Zawinski (jwz@jwz.org)";
if (visual)
result = visual;
else if (verbose_p)
- fprintf (stderr, "%s: no visual suitable for GL.\n", progname, v);
+ fprintf (stderr, "%s: no visual suitable for GL.\n", progname);
}
else if (vclass == SPECIFIC_VISUAL)
{
result = vi_out[0].visual;
}
- if (result)
+ if (!result)
/* No half-depth TrueColor? Ok, try for any TrueColor (the deepest.) */
result = pick_best_visual_of_class (screen, TrueColor);
#include <sys/time.h> /* for gettimeofday() */
#include "yarandom.h"
+# undef ya_rand_init
/* The following 'random' numbers are taken from CRC, 18th Edition, page 622.
# include "vms-gtod.h"
#endif
+extern unsigned int ya_random (void);
+extern void ya_rand_init (unsigned int);
+
#define random() ya_random()
-#define srandom(i) ya_rand_init(0)
#define RAND_MAX 0x7FFFFFFF
-extern unsigned int ya_random (void);
-extern void ya_rand_init (unsigned int);
+/*#define srandom(i) ya_rand_init(0)*/
+
+/* Define these away to keep people from using the wrong APIs in xscreensaver.
+ */
+#define rand __ERROR_use_random_not_rand_in_xscreensaver__
+#define drand48 __ERROR_use_random_not_drand48_in_xscreensaver__
+#define srandom __ERROR_do_not_call_srandom_in_xscreensaver__
+#define srand __ERROR_do_not_call_srand_in_xscreensaver__
+#define srand48 __ERROR_do_not_call_srand48_in_xscreensaver__
+#define ya_rand_init __ERROR_do_not_call_ya_rand_init_in_xscreensaver__
#if defined (__GNUC__) && (__GNUC__ >= 2)
Begin3
Title: xscreensaver
-Version: 3.20
-Entered-date: 12NOV99
+Version: 3.21
+Entered-date: 18NOV99
Description: A modular screen saver and locker for the X Window System.
Highly customizable: allows the use of any program that
can draw on the root window as a display mode.
Author: jwz@jwz.org (Jamie Zawinski)
Maintained-by: jwz@jwz.org (Jamie Zawinski)
Primary-site: http://www.jwz.org/xscreensaver/
- 1257K xscreensaver-3.20.tar.gz
- 38K xscreensaver.README
+ 1261K xscreensaver-3.21.tar.gz
+ 39K xscreensaver.README
1K xscreensaver.lsm
Alternate-site: sunsite.unc.edu /pub/Linux/X11/screensavers/
- 1257K xscreensaver-3.20.tar.gz
- 38K xscreensaver.README
+ 1261K xscreensaver-3.21.tar.gz
+ 39K xscreensaver.README
1K xscreensaver.lsm
Alternate-site: ftp.x.org /contrib/applications/
- 1257K xscreensaver-3.20.tar.gz
- 38K xscreensaver.README
+ 1261K xscreensaver-3.21.tar.gz
+ 39K xscreensaver.README
1K xscreensaver.lsm
Platforms: Linux, Irix, SunOS, Solaris, HPUX, AIX, FreeBSD, NetBSD,
BSDI, SCO, OSF1, Ultrix, VMS.
-Name: xscreensaver
-Summary: X screen saver and locker
-Vendor: Jamie Zawinski <jwz@jwz.org>
-Version: 3.20
-Release: 1
-URL: http://www.jwz.org/xscreensaver/
-Source: xscreensaver-%{version}.tar.gz
-Copyright: BSD
-Group: X11/Utilities
-Buildroot: /var/tmp/xscreensaver-root
+%define name xscreensaver
+%define version 3.21
+%define release 1
+%define serial 1
+%define prefix /usr/X11R6
+
+# By default, builds the basic, non-GL package.
+# To build both the basic and GL-add-on packages:
+# rpm --define "USE_GL yes" ...
+
+Summary: X screen saver and locker
+Name: %{name}
+Version: %{version}
+Release: %{release}
+Serial: %{serial}
+Group: Amusements/Graphics
+Copyright: BSD
+URL: http://www.jwz.org/xscreensaver
+Vendor: Jamie Zawinski <jwz@jwz.org>
+Source: %{name}-%{version}.tar.gz
+Buildroot: /var/tmp/%{name}-%{version}-root
%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.
More than 100 display modes are included in this package.
+%{?USE_GL:See also the xscreensaver-gl package, which}
+%{?USE_GL:includes optional OpenGL display modes.}
+
+%{?USE_GL:%package gl}
+%{?USE_GL:Group: Amusements/Graphics}
+%{?USE_GL:Requires: xscreensaver = %{version}}
+%{?USE_GL:Summary: A set of GL screensavers}
+%{?USE_GL:%description gl}
+%{?USE_GL:The xscreensaver-gl package contains even more screensavers for your}
+%{?USE_GL:mind-numbing, ambition-eroding, time-wasting, hypnotized viewing}
+%{?USE_GL:pleasure. These screensavers require OpenGL or Mesa support.}
+%{?USE_GL: }
+%{?USE_GL:Install the xscreensaver-gl package if you need more screensavers}
+%{?USE_GL:for use with the X Window System and you have OpenGL or Mesa}
+%{?USE_GL:installed.}
%prep
-
%setup -q
%build
+RPMOPTS=""
+
+# Is this really needed? If so, why?
+# %ifarch alpha
+# RPMOPTS="$RPMOPTS --without-xshm-ext"
+# %endif
+
+# On Solaris, build without PAM and with Shadow.
+# On other systems, build with PAM and without Shadow.
+#
+%ifos solaris
+ RPMOPTS="$RPMOPTS --without-pam"
+%else
+ RPMOPTS="$RPMOPTS --with-pam --without-shadow"
+%endif
+
+%{?USE_GL:RPMOPTS="$RPMOPTS --with-gl"}
+%{!?USE_GL:RPMOPTS="$RPMOPTS --without-gl"}
-./configure --prefix=/usr/X11R6 \
- --enable-subdir=/usr/X11R6/lib/xscreensaver
-make all
+CFLAGS="$RPM_OPT_FLAGS" \
+ ./configure --prefix=%{prefix} \
+ --enable-subdir=../lib/xscreensaver \
+ $RPMOPTS
+
+make
%install
-# This is the only directory that "make install" won't make as needed
+# This is a directory that "make install" won't make as needed
# (since Linux uses /etc/pam.d/* and Solaris uses /etc/pam.conf).
#
mkdir -p $RPM_BUILD_ROOT/etc/pam.d
-make prefix=$RPM_BUILD_ROOT/usr/X11R6 \
- AD_DIR=$RPM_BUILD_ROOT/usr/X11R6/lib/X11/app-defaults \
- HACKDIR=$RPM_BUILD_ROOT/usr/X11R6/lib/xscreensaver \
- PAM_DIR=$RPM_BUILD_ROOT/etc/pam.d \
- install-strip
+# This is another (since "make install" doesn't try to install
+# the xscreensaver.kss file unless $KDEDIR is set.)
+#
+if [ -z "$KDEDIR" ]; then export KDEDIR=/usr; fi
+mkdir -p $RPM_BUILD_ROOT$KDEDIR/bin
+
+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.
+# Do this by parsing the output of a dummy run of "make install"
+# in the 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/..@@" |
+ 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 )
+
+
# This line is redundant, except that it causes the "xscreensaver"
# executable to be installed unstripped (while all others are stripped.)
# You should install it this way so that jwz gets useful bug reports.
#
-install -m 4755 driver/xscreensaver $RPM_BUILD_ROOT/usr/X11R6/bin
+install -m 4755 driver/xscreensaver $RPM_BUILD_ROOT%{prefix}/bin
# Even if we weren't compiled with PAM support, make sure to include
# the PAM module file in the RPM anyway, just in case.
#
-( cd driver; make PAM_DIR=$RPM_BUILD_ROOT/etc/pam.d install-pam )
-
-# If we built multiple versions of xscreensaver-demo (because multiple
-# toolkits were available) then install them all.
-#
-( cd driver;
- exes=`echo xscreensaver-demo-*`
- count=`echo $exes | wc -w`
- if [ $count -gt 1 ]; then
- for exe in $exes; do
- install -c -s $exe $RPM_BUILD_ROOT/usr/X11R6/bin
- done
- cd $RPM_BUILD_ROOT/usr/X11R6/bin
- if [ -x xscreensaver-demo-Xaw ]; then target=Xaw; fi
- if [ -x xscreensaver-demo-Xaw3d ]; then target=Xaw3d; fi
- if [ -x xscreensaver-demo-Xm ]; then target=Xm; fi
- if [ -x xscreensaver-demo-Gtk ]; then target=Gtk; fi
- rm -f xscreensaver-demo
- ln -s xscreensaver-demo-$target xscreensaver-demo
- fi
- )
-
+( cd driver ;
+ make install_prefix=$RPM_BUILD_ROOT PAM_DIR=/etc/pam.d install-pam )
# This is for wmconfig, a tool that generates init files for window managers.
#
chmod -R a+r,u+w,og-w $RPM_BUILD_ROOT
%clean
-rm -rf $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
+%files -f hacks-non-gl
%defattr(-,root,root)
+# Files for the "xscreensaver" package:
+#
%doc README README.debugging
- /usr/X11R6/bin/*
- /usr/X11R6/lib/xscreensaver/*
-%config /usr/X11R6/lib/X11/app-defaults/*
- /usr/X11R6/man/man1/*
+ %{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) /etc/X11/wmconfig/*
%config(missingok) "/usr/share/apps/Amusements/Screen Savers/*"
+
+# Files for the "xscreensaver-gl" package:
+#
+%{?USE_GL:%files -f hacks-gl gl}