ftp://ftp.uniovi.es/pub/X11R6/graphics/misc/lock/xscreensaver-1.22.tar.gz
authorZygo Blaxell <zblaxell@hungrycats.org>
Mon, 2 Mar 2009 05:42:18 +0000 (00:42 -0500)
committerZygo Blaxell <zblaxell@hungrycats.org>
Mon, 2 Mar 2009 05:42:18 +0000 (00:42 -0500)
-rw-r--r-- 1 zblaxell zblaxell 125136 Jul 10  1994 xscreensaver-1.22.tar.gz
22d23c52eeb73529c798c184039202d0834f40e8  xscreensaver-1.22.tar.gz

20 files changed:
Imakefile
README
config.h
driver/XScreenSaver.ad
driver/demo.c
driver/dialogs.xd
driver/subprocs.c
driver/visual.c
driver/windows.c
driver/xscreensaver-command.c
driver/xscreensaver.c
driver/xscreensaver.man
hacks/Imakefile
hacks/attraction.c
hacks/flame.man
hacks/imsmap.c
hacks/qix.c
hacks/screenhack.h
utils/fade.c
utils/version.h

index fd1901deb4f9c1eef34ac86ee326932c495b1a0a..0377de1fc7ffa3548ea328090558dc06df4872c1 100644 (file)
--- a/Imakefile
+++ b/Imakefile
@@ -1,5 +1,5 @@
 /*
- * Imakefile file for xscreensaver, Copyright (c) 1991-1993 Jamie Zawinski.
+ * Imakefile file for xscreensaver, Copyright (c) 1991-1994 Jamie Zawinski.
  *
  * You should not need to edit this file; edit config.h instead.
  *
@@ -11,8 +11,8 @@
             TAR = gnutar
        COMPRESS = compress
    COMPRESS_EXT = Z
-#      COMPRESS = gzip --verbose --best
-#  COMPRESS_EXT = gz
+/**/#      COMPRESS = gzip --verbose --best
+/**/#  COMPRESS_EXT = gz
 
 all:: utils/Makefile driver/Makefile hacks/Makefile
        cd utils  ; $(MAKE) $@ CC="$(CC)" CCOPTIONS="$(CCOPTIONS)" CDEBUGFLAGS="$(CDEBUGFLAGS)"
@@ -33,7 +33,7 @@ driver/Makefile: driver/Imakefile config.h
 hacks/Makefile: hacks/Imakefile config.h
        cd hacks  ; $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)/hacks
 
-# This really makes me sick...
+/* This really makes me sick... */
 tar: utils/Makefile driver/Makefile hacks/Makefile
        @NAME=`sed -n                                                       \
   's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/xscreensaver-\1/p' utils/version.h` ;  \
diff --git a/README b/README
index 17a50260950a7adc0772f27f489a502891539256..e7302b8fe416282c6bf432cad5c9fa6077dc0a08 100644 (file)
--- a/README
+++ b/README
@@ -75,9 +75,18 @@ You can get all of these from the contrib directory on ftp.x.org.  If you
 know of (or write) any other interesting programs that can be used as
 screensavers, please let me know!
 
+This program should be updated to take advantage of the new R6 `screensaver'
+server extension instead of XIdle.  I didn't have time to do this before the
+deadline for the R6 contrib tape, but by the time you read this, maybe it's
+done - check a later release.
+
+The latest version of xscreensaver is on LUCID.COM and FTP.X.ORG.
+
        -- Jamie Zawinski <jwz@lucid.com>
 
 \f
+Changes since 1.21:    Minor tweaks for X11R6.
+                       Fixes for non-default visuals.
 Changes since 1.20:    Fixed bug in color blitspin; added default image.
                        Added diagnostics to noseguy.  Fixed off-by-one
                        error in flame.  Added some missing casts.
index 691c98c63ac2cdad41a8d99ec0014f96566d529d..d275fc11edfb1a473f5db649ea2981d849e0e954 100644 (file)
--- a/config.h
+++ b/config.h
@@ -1,14 +1,19 @@
 /*
- * Config file for xscreensaver, Copyright (c) 1991-1993 Jamie Zawinski.
+ * Config file for xscreensaver, Copyright (c) 1991-1994 Jamie Zawinski.
  * This file is included by the various Imakefiles.
  */
 
 /*  Uncomment the following line if you have the XIdle extension installed.
- *  XIdle comes on the X11r5 contrib tape, in .../contrib/extensions/xidle/.
+ *  XIdle comes on the X11r5 contrib tape, in .../contrib/extensions/xidle/
+ *  (and maybe it will be on the r6 tape as well but I'm not sure where.)
  *  Installing it is the morally superior thing to do, but xscreensaver will
  *  work without it.
+ *
+ *  Actually it's likely that the R6 `screensaver' server extension will turn
+ *  out to be the better thing to use, but I haven't had time to add support
+ *  for it yet.  (See README to find the latest version of this program.)
  */
-#define HAVE_XIDLE
+/* #define HAVE_XIDLE */
 
 /*  Uncomment the following line if you have the XPM library installed.
  *  Some of the demos can make use of this.
index 5ec4249ab5b4a3dcf2ff19409be7dc6b8074602c..221ffb62a071c99d2dc64bd977e37aeaea508327 100644 (file)
@@ -95,7 +95,7 @@
 *demoDialog.maxWidth:          600
 
 *label1.labelString:           XScreenSaver %s
-*label2.labelString: Copyright © 1991-1993 by Jamie Zawinski <jwz@lucid.com>
+*label2.labelString: Copyright © 1991-1994 by Jamie Zawinski <jwz@lucid.com>
 *demoList.visibleItemCount:    10
 *demoList.automaticSelection:  True
 *next.labelString:             Run Next
index 0603a03a3c3461b18786d48cd1508bb1dfec1e06..eed5c20748b9334257a9aba78ae50a3700a31c50 100644 (file)
@@ -185,7 +185,7 @@ pop_up_dialog_box (dialog, form, where)
      It's important that the screensaver dialogs not get decorated or
      otherwise reparented by the window manager, because they need to be
      children of the *real* root window, not the WM's virtual root, in
-     order for us to guarentee tha they are visible above the screensaver
+     order for us to guarentee that they are visible above the screensaver
      window itself.
    */
   Arg av [100];
index 6e563335e723161269f9bbca9f559a6a184111f1..3bbd713b2c3eeb4e1bf7d61962d2296dbfa50e08 100644 (file)
@@ -424,7 +424,7 @@ object 'label1' : XmLabel {
 object 'label2' : XmLabel {
        arguments {
        name = 'label2';
-       XmNlabelString= 'Copyright © 1991-1993 by Jamie Zawinski <jwz@lucid.com>';
+       XmNlabelString= 'Copyright © 1991-1994 by Jamie Zawinski <jwz@lucid.com>';
        };
 };
 object 'text_area' : XmScrolledList {
index d8cc3309e7e84ddd9c1dcffc9efadd9c2f85b53e..23eb0e44345bc4c979512285953fa33fbb49c61c 100644 (file)
@@ -80,12 +80,13 @@ extern int putenv (/* const char * */);     /* getenv() is in stdlib.h... */
 extern int kill (pid_t, int);          /* signal() is in sys/signal.h... */
 #endif
 
-# if defined(SVR4) || defined(SYSV)
-#  define random() rand()
-# else /* !totally-losing-SYSV */
-extern long random();                  /* rand() is in stdlib.h... */
-# endif /* !totally-losing-SYSV */
-
+# ifndef random
+#  if defined(SVR4) || defined(SYSV)
+#   define random() rand()
+#  else /* !totally-losing-SYSV */
+    extern long random();              /* rand() is in stdlib.h... */
+#  endif /* !totally-losing-SYSV */
+# endif /* random defined */
 
 #include "xscreensaver.h"
 
index b9d1897034cc1524f3239ba11c5c5b72c47f8bdc..74e77051d7e87860dcd10d565db6c285b4026d2f 100644 (file)
@@ -113,6 +113,24 @@ get_visual_depth (dpy, visual)
 }
 
 
+int
+get_visual_class (dpy, visual)
+     Display *dpy;
+     Visual *visual;
+{
+  XVisualInfo vi_in, *vi_out;
+  int out_count, c;
+  vi_in.screen = DefaultScreen (dpy);
+  vi_in.visualid = XVisualIDFromVisual (visual);
+  vi_out = XGetVisualInfo (dpy, VisualScreenMask|VisualIDMask,
+                          &vi_in, &out_count);
+  if (! vi_out) abort ();
+  c = vi_out [0].class;
+  XFree ((char *) vi_out);
+  return c;
+}
+
+
 Visual *
 get_visual_resource (dpy, name, class)
      Display *dpy;
index 690f1fd691f194077c95f4df472961c2421dcc81..fb459ace60c7bca9fa375a2495d9745c18866e51 100644 (file)
@@ -465,13 +465,17 @@ initialize_screensaver_window ()
        fade_p = unfade_p = 0;
     }
 
-  attrmask = CWOverrideRedirect | CWEventMask | CWBackingStore | CWColormap;
+  attrmask = (CWOverrideRedirect | CWEventMask | CWBackingStore | CWColormap |
+             CWBackPixel | CWBackingPixel | CWBorderPixel);
   attrs.override_redirect = True;
   attrs.event_mask = (KeyPressMask | KeyReleaseMask |
                      ButtonPressMask | ButtonReleaseMask |
                      PointerMotionMask);
   attrs.backing_store = NotUseful;
   attrs.colormap = cmap;
+  attrs.background_pixel = black_pixel;
+  attrs.backing_pixel = black_pixel;
+  attrs.border_pixel = black_pixel;
 
 /*  if (demo_mode_p || lock_p) width = width / 2;   #### */
 
@@ -565,7 +569,8 @@ raise_window (inhibit_fade, between_hacks_p)
       fade_colormap (dpy, current_map, cmap2, fade_seconds, fade_ticks, True);
       XClearWindow (dpy, screensaver_window);
       XMapRaised (dpy, screensaver_window);
-      /* Once the saver window is up, restore the colormap. */
+      /* Once the saver window is up, restore the colormap.
+        (The "black" pixels of the two colormaps are compatible.) */
       XInstallColormap (dpy, cmap);
       if (grabbed == GrabSuccess)
        XUngrabPointer (dpy, CurrentTime);
index e0e40e330e09cc7d3d2a07d1c4418558adcc7cc1..2a33799c63d88213b0af65ce70701534fb429bd0 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver-command, Copyright (c) 1991-1993 Jamie Zawinski <jwz@lucid.com>
+/* xscreensaver-command, Copyright (c) 1991-1994 Jamie Zawinski <jwz@lucid.com>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -26,7 +26,7 @@ static char *screensaver_version;
 static char *usage = "usage: %s -<switch>\n\
 \n\
   This program provides external control of a running xscreensaver process.\n\
-  Version %s, copyright (c) 1991-1993 Jamie Zawinski <jwz@lucid.com>.\n\
+  Version %s, copyright (c) 1991-1994 Jamie Zawinski <jwz@lucid.com>.\n\
 \n\
   -demo                Enter interactive demo mode.\n\
   -deactivate  Turns off the screensaver if it is on, as user input would.\n\
index eb0bd64e0b850ec264e40ee8385a5e7bf3f2c1a3..dbe34c85208502ca4150388d3221407b9066e14d 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1991-1993 Jamie Zawinski <jwz@lucid.com>
+/* xscreensaver, Copyright (c) 1991-1994 Jamie Zawinski <jwz@lucid.com>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -256,7 +256,7 @@ static void
 do_help ()
 {
   printf ("\
-xscreensaver %s, copyright (c) 1991-1993 by Jamie Zawinski <jwz@lucid.com>.\n\
+xscreensaver %s, copyright (c) 1991-1994 by Jamie Zawinski <jwz@lucid.com>.\n\
 The standard Xt command-line options are accepted; other options include:\n\
 \n\
     -timeout <minutes>         when the screensaver should activate\n\
@@ -580,7 +580,7 @@ initialize (argc, argv)
 
   if (verbose_p)
     printf ("\
-%s %s, copyright (c) 1991-1993 by Jamie Zawinski <jwz@lucid.com>.\n\
+%s %s, copyright (c) 1991-1994 by Jamie Zawinski <jwz@lucid.com>.\n\
  pid = %d.\n", progname, screensaver_version, getpid ());
   ensure_no_screensaver_running ();
 
index f8ce616043ca9694f9c0718632e6a2efb51c589e..8c0903fa5c415c359d6306476c23a96caa8bb123 100644 (file)
@@ -11,7 +11,7 @@
 .if n .sp 1
 .if t .sp .5
 ..
-.TH XScreenSaver 1 "30-oct-93" "X Version 11"
+.TH XScreenSaver 1 "12-May-94" "X Version 11"
 .SH NAME
 xscreensaver - run graphics hacks after the user has been idle for a while
 .SH SYNOPSIS
@@ -400,9 +400,12 @@ in code intended for use as a screensaver.  This prevents too much graphics
 activity from being buffered up.
 .PP
 The screensaver only runs on the default screen of the display.  If you have
-more than one screen, you must run multiple screensaver processes, one for
-each screen.  (I don't actually know whether this works, because I don't 
-have access to a multi-screen machine.  Comments welcome.)
+more than one screen, you can run multiple screensaver processes, one for
+each screen.  This interacts poorly with locking.  In an ideal world, the
+screensaver would save (and lock) both screens simultaniously, and any activity
+would restore both screens.  It would be nice if one could run different hacks
+on each screen simultaniously.  However, I don't have access to a multi-headed
+workstation, so it would be hard for me to implement something like this.
 .PP
 If you don't have Motif, you can't compile with support for locking or
 demo mode.
@@ -457,13 +460,13 @@ are sent to the screensaver window instead.  This could be solved by making
 xscreensaver forward all unrecognised ClientMessages to the real root window,
 but there may be other problems as well.
 .SH COPYRIGHT
-Copyright \(co 1992, 1993 by Jamie Zawinski.  Permission to use, copy, modify, 
-distribute, and sell this software and its documentation for any purpose is 
-hereby granted without fee, provided that the above copyright notice appear 
-in all copies and that both that copyright notice and this permission notice
-appear in supporting documentation.  No representations are made about the 
-suitability of this software for any purpose.  It is provided "as is" without
-express or implied warranty.
+Copyright \(co 1992, 1993, 1994 by Jamie Zawinski.  Permission to use, copy, 
+modify, distribute, and sell this software and its documentation for any
+purpose is hereby granted without fee, provided that the above copyright
+notice appear in all copies and that both that copyright notice and this
+permission notice appear in supporting documentation.  No representations are
+made about the suitability of this software for any purpose.  It is provided
+"as is" without express or implied warranty.
 .SH AUTHOR
 Jamie Zawinski <jwz@lucid.com>, 13-aug-92.
 Please let me know if you find any bugs or make any improvements.
index cf6b3e19fe7e3bd96a34502af62522e49b04fe78..30cd49c214707b3d35efdefcdce2927f7866db79 100644 (file)
@@ -9,7 +9,7 @@
 
 #ifdef HAVE_XPM
  /* Yeah, this means that all hacks link against libXpm even though only
-    one hack actually use it.  It doesn't matter: it's a library. */
+    one hack actually uses it.  It doesn't matter: it's a library. */
 # define XPMDEFS -DHAVE_XPM
 # define XPMLIB -lXpm
 #else
index d178b21402b054dca0c78465a01924809e952e95..1f93781df3673ac485d603044339651813930eda 100644 (file)
@@ -184,7 +184,7 @@ init_balls (dpy, window)
       {
        XColor color;
        color.pixel = default_fg_pixel;
-       if (!XQueryColor (dpy, cmap, &color)) abort ();
+       XQueryColor (dpy, cmap, &color);
        if (!XAllocColor (dpy, cmap, &color)) abort ();
        pixel_stack [i] = color.pixel;
       }
index f0f360e54d5cbb0e21f01df64d574878bb3d76bd..0135215a46b7bbb946d2cf31f6c0f6ee35b51ae0 100644 (file)
@@ -2,7 +2,7 @@
 .SH NAME
 flame - draw weird cosmic fractals
 .SH SYNOPSIS
-.B hopalong
+.B flame
 [\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-ncolors \fIinteger\fP] [\-iterations \fIinteger\fP] [\-points \fIinteger\fP] [\-delay \fImicroseconds\fP] [\-delay2 \fImicroseconds\fP]
 .SH DESCRIPTION
 The \fIflame\fP program generates colorful fractal displays.
index d8b1c088c51a2ac4ecdfcd0a9d7296fcfa676d79..716be3e4a164f1cc2ff737943f6745bc859cb8e3 100644 (file)
@@ -139,12 +139,10 @@ initwin (dsp, win)
        }
       else
        {
+         XQueryColor (dsp, cmap, &fg_color);
+         XQueryColor (dsp, cmap, &bg_color);
          fg_color.pixel = fg_pixel;
-         if (! XQueryColor (dsp, cmap, &fg_color))
-           abort ();
          bg_color.pixel = bg_pixel;
-         if (! XQueryColor (dsp, cmap, &bg_color))
-           abort ();
        }
       fg_color.flags = DoRed|DoGreen|DoBlue;
       bg_color.flags = DoRed|DoGreen|DoBlue;
index 7c70574aa8e226af95f6a098ce954d7b35f6cde6..d6146bb06c06ab2cbbf2bf811160601cf9c40ab2 100644 (file)
@@ -71,8 +71,7 @@ init_one_qix (dpy, window, nlines)
       if (!XAllocColor (dpy, cmap, &qix->lines[0].color))
        {
          qix->lines[0].color.pixel = default_fg_pixel;
-         if (!XQueryColor (dpy, cmap, &qix->lines[0].color))
-           abort ();
+         XQueryColor (dpy, cmap, &qix->lines[0].color);
          if (!XAllocColor (dpy, cmap, &qix->lines[0].color))
            abort ();
        }
index 12506b32667f13ee88608abebcd80c8b34bfdc9e..14e9a16cb0d1b1be5ff6c095eb5fa44b4b5df23f 100644 (file)
@@ -74,13 +74,21 @@ extern char *defaults [];
 
 #if __STDC__
 # if defined(SVR4) || defined(SYSV)
-extern int rand (void);
-extern void srand (unsigned int);
-#  define random() rand()
-#  define srandom(i) srand((unsigned int)(i))
+#  ifndef random
+    extern int rand (void);
+#   define random() rand()
+#  endif
+#  ifndef srandom
+    extern void srand (unsigned int);
+#   define srandom(i) srand((unsigned int)(i))
+#  endif
 # else /* !totally-losing-SYSV */
-extern long random (void);
-extern void srandom (int);
+#  ifndef random
+    extern long random (void);
+#  endif
+#  ifndef srandom
+    extern void srandom (int);
+#  endif
 # endif /* !totally-losing-SYSV */
 #endif /* __STDC__ */
 
index c6c77a0cfee8e8709de65c78dd07633a7c025004..170cd39e604fad7c6213e957255bc6375e7d46a3 100644 (file)
@@ -17,6 +17,7 @@
 #include <X11/Xlib.h>
 #include <X11/Xos.h>
 
+extern int get_visual_class ();
 extern void screenhack_usleep ();
 #define usleep screenhack_usleep
 
@@ -31,13 +32,23 @@ copy_colormap (dpy, cmap, into_cmap)
      Colormap cmap, into_cmap;
 {
   int i;
-  ncolors = CellsOfScreen (DefaultScreenOfDisplay (dpy));
+  Screen *screen = DefaultScreenOfDisplay (dpy);
+  Visual *visual = DefaultVisualOfScreen (screen);
+  Window window = RootWindowOfScreen (screen);
+  int vclass = get_visual_class (dpy, visual);
+
+  ncolors = CellsOfScreen (screen);
+
+  /* If this is a colormap on a mono visual, or one with insanely many
+     color cells, bug out. */
   if (ncolors <= 2 || ncolors > MAX_COLORS)
     return 0;
+  /* If this is a non-writable visual, bug out. */
+  if (vclass == StaticGray || vclass == StaticColor || vclass == TrueColor)
+    return 0;
+
   if (! into_cmap)
-    into_cmap = XCreateColormap (dpy, RootWindow (dpy, DefaultScreen (dpy)),
-                                DefaultVisual (dpy, DefaultScreen (dpy)),
-                                AllocAll);
+    into_cmap = XCreateColormap (dpy, window, visual, AllocAll);
   if (! cmap)
     cmap = DefaultColormap (dpy, DefaultScreen (dpy));
   for (i = 0; i < ncolors; i++)
index 9c7c324d394da516dfdedcdf98245230ccfaaff8..1e0404692e61333f9002fe53c128226d30f311d6 100644 (file)
@@ -1,2 +1,2 @@
 static char *screensaver_id =
-       "@(#)xscreensaver 1.21, by Jamie Zawinski (jwz@lucid.com)";
+       "@(#)xscreensaver 1.22, by Jamie Zawinski (jwz@lucid.com)";