/*
- * 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.
*
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)"
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` ; \
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.
/*
- * 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.
*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
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];
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 {
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"
}
+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;
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; #### */
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);
-/* 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
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\
-/* 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
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\
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 ();
.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
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.
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.
#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
{
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;
}
.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.
}
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;
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 ();
}
#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__ */
#include <X11/Xlib.h>
#include <X11/Xos.h>
+extern int get_visual_class ();
extern void screenhack_usleep ();
#define usleep screenhack_usleep
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++)
static char *screensaver_id =
- "@(#)xscreensaver 1.21, by Jamie Zawinski (jwz@lucid.com)";
+ "@(#)xscreensaver 1.22, by Jamie Zawinski (jwz@lucid.com)";