#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 3)."
# Contents:  Imakefile MANIFEST Makefile.noImake PATCHLEVEL PromptBox.c
#   PromptBox.h README SigmaPiBeta Xsaver.sed action.h check_mark
#   commLine.h converter.c float.h getstring.h globals.h hft.c
#   resources.h scaling.c scaling.h setenv.c util.c wordwrap.c
#   wordwrap.h yinyang
# Wrapped by jik@pit-manager on Mon Jan 27 17:01:48 1992
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Imakefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Imakefile'\"
else
echo shar: Extracting \"'Imakefile'\" \(3138 characters\)
sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
X#
X# $Source: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/Imakefile,v $
X# $Author: jik $
X# $Header: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/Imakefile,v 1.29 91/11/29 11:06:45 jik Exp $
X#
X# This file is part of xscreensaver.  It contains the Imakefile
X# (obviously).
X#
X# Author: Jonathan Kamens, MIT Project Athena and
X#                          MIT Student Information Processing Board
X#
X# Copyright (c) 1989 by Jonathan Kamens.  This code may be distributed
X# freely as long as this notice is kept intact in its entirety and
X# every effort is made to send all corrections and improvements to the
X# code back to the author.  Also, do not try to make money off of it or
X# pretend that you wrote it.
X#
X
X#if defined(NeXTArchitecture)
XMACH_DEP_FLAGS		=	-DCOMPILE_SETENV
X#endif
X
X#if defined(IBMR2Architecture)
XMACH_DEP_FLAGS		=	-DCOMPILE_SETENV
XMACH_DEP_SRCS		=	converter.c hft.c
XMACH_DEP_OBJS		=	converter.o hft.o
X#endif
X
XAPPCLASS	=	XScreensaver
XBITMAPDIR       =       /usr/sipb/bitmaps.x11
XDEFINES		=	-DAPPCLASS=\"$(APPCLASS)\" \
X			-DXFILESEARCHPATH=\"/usr/sipb/lib/%T/%N:/afs/athena.mit.edu/contrib/sipb/lib/%T/%N:$(BITMAPDIR)/%N\" \
X			$(MACH_DEP_FLAGS)
XICONBITMAP	=	SigmaPiBeta
XFLOATBITMAP	=	yinyang
XICONPIXMAP	=	SigmaPiBeta
XTARGET		=	xscreensaver
XSYS_LIBRARIES   = 	$(XAWLIB) $(XTOOLLIB) $(XMULIB) $(XLIB) -lm
XLOCAL_LIBRARIES = 
XSRCS 		=	PromptBox.c float.c getstring.c main.c\
X			menuIcon.c password.c savescreen.c scaling.c\
X			setenv.c util.c wordwrap.c $(MACH_DEP_SRCS)
XOBJS		=	PromptBox.o float.o getstring.o main.o\
X			menuIcon.o password.o savescreen.o scaling.o\
X			setenv.o util.o wordwrap.o $(MACH_DEP_OBJS)
XCDEBUGFLAGS	=	-g
XHEADERS		=	PromptBox.h action.h commLine.h float.h\
X			getstring.h globals.h resources.h scaling.h\
X			wordwrap.h xsaver.h
XBITMAPS		=	SigmaPiBeta yinyang check_mark
XARCHIVE		=	README $(SRCS) $(BITMAPS) $(HEADERS)\
X			Imakefile Makefile.noImake PATCHLEVEL xsaver.man.s\
X			Xsaver.sed converter.c hft.c
X
X#if defined(VaxArchitecture) && HasGcc
X/* There is a bug in gcc 1.40 on the Vax that xscreensaver tickles */
XCC=cc
X#endif
X
XAllTarget($(TARGET) $(APPCLASS).ad $(TARGET).man)
XComplexProgramTarget($(TARGET))
XNormalLintTarget($(SRCS))
XInstallAppDefaults($(APPCLASS))
XInstallMultiple($(BITMAPS),$(BITMAPDIR))
X
X$(APPCLASS).ad: Xsaver.sed
X	sed -e 's|$$BITMAPDIR|$(BITMAPDIR)|g'\
X		-e 's|$$ICONPIXMAP|$(ICONPIXMAP)|g'\
X		-e 's|$$ICONBITMAP|$(ICONBITMAP)|g'\
X		-e 's|$$FLOATBITMAP|$(FLOATBITMAP)|g'\
X		Xsaver.sed > $@
X
X$(TARGET).man: xsaver.man.s
X	sed -e 's|$$TARGET|$(TARGET)|g'\
X		-e 's|$$APPCLASS|$(APPCLASS)|g'\
X		-e 's|$$APPDIR|$(XAPPLOADDIR)|g'\
X		-e 's|$$APPTARGET|$(APPCLASS)|g'\
X		-e 's|$$BITMAPDIR|$(BITMAPDIR)|g'\
X		-e 's|$$ICONPIXMAP|$(ICONPIXMAP)|g'\
X		-e 's|$$ICONBITMAP|$(ICONBITMAP)|g'\
X		-e 's|$$FLOATBITMAP|$(FLOATBITMAP)|g'\
X		xsaver.man.s > $@
X
Xshar: $(ARCHIVE)
X	makekit -oMANIFEST $(ARCHIVE)
X
Xtar: $(ARCHIVE)
X	tar cvf - $(ARCHIVE) | compress > xsaver.tar.Z
X
Xpatch: $(ARCHIVE)
X	makepatch $(ARCHIVE)
X	mv patch xsaver.patch`cat PATCHLEVEL`
X	shar xsaver.patch`cat PATCHLEVEL` > xsaver.patch`cat PATCHLEVEL`.shar
X
Xclean::
X	rm -f $(TARGET).man $(APPCLASS).ad $(OBJS)
END_OF_FILE
if test 3138 -ne `wc -c <'Imakefile'`; then
    echo shar: \"'Imakefile'\" unpacked with wrong size!
fi
# end of 'Imakefile'
fi
if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'MANIFEST'\"
else
echo shar: Extracting \"'MANIFEST'\" \(1137 characters\)
sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
X   File Name		Archive #	Description
X-----------------------------------------------------------
X Imakefile                  1	
X MANIFEST                   1	This shipping list
X Makefile.noImake           1	
X PATCHLEVEL                 1	
X PromptBox.c                1	
X PromptBox.h                1	
X README                     1	
X SigmaPiBeta                1	
X Xsaver.sed                 1	
X action.h                   1	
X check_mark                 1	
X commLine.h                 1	
X converter.c                1	
X float.c                    2	
X float.h                    1	
X getstring.c                2	
X getstring.h                1	
X globals.h                  1	
X hft.c                      1	
X main.c                     2	
X menuIcon.c                 2	
X password.c                 3	
X resources.h                1	
X savescreen.c               3	
X scaling.c                  1	
X scaling.h                  1	
X setenv.c                   1	
X util.c                     1	
X wordwrap.c                 1	
X wordwrap.h                 1	
X xsaver.h                   2	
X xsaver.man.s               3	
X yinyang                    1	
END_OF_FILE
if test 1137 -ne `wc -c <'MANIFEST'`; then
    echo shar: \"'MANIFEST'\" unpacked with wrong size!
fi
# end of 'MANIFEST'
fi
if test -f 'Makefile.noImake' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile.noImake'\"
else
echo shar: Extracting \"'Makefile.noImake'\" \(3282 characters\)
sed "s/^X//" >'Makefile.noImake' <<'END_OF_FILE'
X#
X# $Source: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/Makefile.noImake,v $
X# $Author: jik $
X# $Header: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/Makefile.noImake,v 1.32 91/05/14 23:04:40 jik Exp $
X#
X# This file is part of xscreensaver.  It contains the Makefile
X# (obviously).
X#
X# Author: Jonathan Kamens, MIT Project Athena and
X#                          MIT Student Information Processing Board
X#
X# Copyright (c) 1989 by Jonathan Kamens.  This code may be distributed
X# freely as long as this notice is kept intact in its entirety and
X# every effort is made to send all corrections and improvements to the
X# code back to the author.  Also, don't try to make money off of it or
X# pretend that you wrote it.
X#
X
XDESTDIR 	=
XBINDIR 		= 	/usr/bin/X11
XAPPDIR 		= 	/usr/lib/X11/app-defaults
XBITMAPDIR 	=	/usr/lib/X11/bitmaps
XMANDIR 		=	/usr/man
XMANSECT 	=	1
XTARGET 		=	xsaver
XMANTARGET	=	xsaver
XAPPTARGET	=	Xsaver
XICONBITMAP	=	SigmaPiBeta
XFLOATBITMAP	=	yinyang
XICONPIXMAP	=	SigmaPiBeta
XXLIBDIR		=	/usr/lib
XXINCDIR 	=	/usr/include
X
XSRCS 		=	main.c scaling.c password.c savescreen.c\
X			menuIcon.c PromptBox.c util.c getstring.c\
X			float.c wordwrap.c setenv.c
XOBJS		=	main.o scaling.o password.o savescreen.o\
X			menuIcon.o PromptBox.o util.o getstring.o\
X			float.o wordwrap.o setenv.o
XBITMAPS		=	$(ICONBITMAP) $(FLOATBITMAP) $(ICONPIXMAP)
XCDEBUGFLAGS	=	-O
X# NOTE:
X# If you are installing the app-defaults somewhere other than in
X# the location where your X toolkit has been compiled to look by
X# default (usually /usr/lib/X11/app-defaults), then add
X# 	-DXAPPLRESDIR=\"$(APPDIR)/\"
X# To your CFLAGS.  This will activate the source code that sets the
X# XAPPLRESDIR variable to make the toolkit look somewhere else.
XCFLAGS 		= 	-L$(XLIBDIR) -I$(XINCDIR) $(CDEBUGFLAGS)\
X			-DAPPCLASS=\"$(APPTARGET)\"
XLIBS		=	-lXaw -lXmu -lXt -lX11 -lm
XDEPEND 		=	makedepend
XINSTALL		=	install
X
X$(TARGET): $(OBJS)
X	$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
X
X$(APPTARGET): Xsaver.sed
X	sed -e 's|$$BITMAPDIR|$(BITMAPDIR)|g'\
X		-e 's|$$ICONPIXMAP|$(ICONPIXMAP)|g'\
X		-e 's|$$ICONBITMAP|$(ICONBITMAP)|g'\
X		-e 's|$$FLOATBITMAP|$(FLOATBITMAP)|g'\
X		-e 's|$$CLASS|$(APPTARGET)|g'\
X		Xsaver.sed > $(APPTARGET)
X
X$(MANTARGET).man: xsaver.man.s
X	sed -e 's|$$TARGET|$(TARGET)|g'\
X		-e 's|$$APPDIR|$(APPDIR)|g'\
X		-e 's|$$APPTARGET|$(APPTARGET)|g'\
X		-e 's|$$BITMAPDIR|$(BITMAPDIR)|g'\
X		-e 's|$$ICONPIXMAP|$(ICONPIXMAP)|g'\
X		-e 's|$$ICONBITMAP|$(ICONBITMAP)|g'\
X		-e 's|$$FLOATBITMAP|$(FLOATBITMAP)|g'\
X		xsaver.man.s > $(MANTARGET).man
X		
Xall: $(TARGET) $(APPTARGET) $(MANTARGET).man
X
Xinstall: bin_install man_install def_install bitmap_install
X
Xbin_install: $(TARGET)
X	$(INSTALL) -c -s $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET)
X
Xman_install:
X	$(INSTALL) -m 644 -c $(TARGET).man\
X		$(DESTDIR)$(MANDIR)/man$(MANSECT)/$(MANTARGET).$(MANSECT)
X
Xdef_install:
X	$(INSTALL) -m 644 -c $(APPTARGET) $(DESTDIR)$(APPDIR)/$(APPTARGET)
X
Xbitmap_install:
X	$(INSTALL) -m 644 -c $(FLOATBITMAP) $(DESTDIR)$(BITMAPDIR)
X	$(INSTALL) -m 644 -c $(ICONBITMAP) $(DESTDIR)$(BITMAPDIR)
X	$(INSTALL) -m 644 -c $(ICONPIXMAP) $(DESTDIR)$(BITMAPDIR)
X
Xclean:
X	-rm -f *.o *~ *.bak *.BAK $(TARGET) $(MANTARGET).man $(APPTARGET)
X
Xdepend:
X	$(DEPEND) $(CFLAGS) $(SRCS)
X
X# DO NOT DELETE THIS LINE -- make depend depends on it.
END_OF_FILE
if test 3282 -ne `wc -c <'Makefile.noImake'`; then
    echo shar: \"'Makefile.noImake'\" unpacked with wrong size!
fi
# end of 'Makefile.noImake'
fi
if test -f 'PATCHLEVEL' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'PATCHLEVEL'\"
else
echo shar: Extracting \"'PATCHLEVEL'\" \(3 characters\)
sed "s/^X//" >'PATCHLEVEL' <<'END_OF_FILE'
X11
END_OF_FILE
if test 3 -ne `wc -c <'PATCHLEVEL'`; then
    echo shar: \"'PATCHLEVEL'\" unpacked with wrong size!
fi
# end of 'PATCHLEVEL'
fi
if test -f 'PromptBox.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'PromptBox.c'\"
else
echo shar: Extracting \"'PromptBox.c'\" \(4227 characters\)
sed "s/^X//" >'PromptBox.c' <<'END_OF_FILE'
X/*
X * $Source: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/PromptBox.c,v $
X * $Author: jik $
X *
X * This file is part of xscreensaver.  It contains a set of routines
X * for building form widgets fileed with lines of centered
X * text/bitmaps.
X *
X * Author: Jonathan Kamens, MIT Project Athena and
X *                          MIT Student Information Processing Board
X *
X * Copyright (c) 1989 by Jonathan Kamens.  This code may be
X * distributed freely as long as this notice is kept intact in its
X * entirety and every effort is made to send all corrections and
X * improvements to the code back to the author.  Also, don't try to
X * make any money off of it or pretend that you wrote it.
X */
X
X#ifndef lint
X     static char rcsid_PromptBox_c[] = "$Header: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/PromptBox.c,v 1.10 90/05/09 10:28:06 jik Exp $";
X#endif
X
X#include "xsaver.h"
X#include <X11/Xaw/Form.h>
X#include <X11/Xaw/Label.h>
X#include "globals.h"
X#include "PromptBox.h"
X
X
Xextern Dimension widget_width();
Xextern void XtMoveWidget();
X
X
X
X
X
Xstatic Widget addBox(w, line, last)
XWidget w, *last;
XPromptLine *line;
X{
X     Arg arglist[10];
X     int i = 0;
X
X     XtSetArg(arglist[i], XtNborderWidth, 0); i++;
X     XtSetArg(arglist[i], XtNresizable, True); i++;
X     if (line->center) {
X	  XtSetArg(arglist[i], XtNjustify, XtJustifyCenter); i++;
X     }
X     if (! line->use_default) {
X	  if (line->bitmap) {
X	       XtSetArg(arglist[i], XtNbitmap, line->bitmap); i++;
X	       XtSetArg(arglist[i], XtNlabel, None); i++;
X	  }
X	  else {
X	       XtSetArg(arglist[i], XtNbitmap, None); i++;
X	       XtSetArg(arglist[i], XtNlabel, line->str); i++;
X	  }
X     }
X     XtSetArg(arglist[i], XtNfromVert, *last); i++;
X     if (line->spread) {
X	  XtSetArg(arglist[i], XtNvertDistance, line->spread); i++;
X     }
X     *last = XtCreateWidget(line->name, labelWidgetClass, w, arglist, i);
X     line->width = widget_width(*last);
X     return(*last);
X}
X
X
X
X
X
X/*
X * parent is the parent widget of the prompt box widget; it must
X *   already be created.
X * name is the name of the prompt box to be created
X * strings is an array of the contents of the prompt box widget
X * num is the number of things in strings
X * return_widgets, if non-null, must contain num+1 locations -- it
X *   will be filled in with the label widget contents of the form
X *   widget followed by a null
X */
XWidget PromptBox(parent, name, strings, num, return_widgets)
XWidget parent;
Xchar *name;
XPromptLine *strings;
XWidget *return_widgets;
Xint num;
X{
X     Widget prompt, lines[MAXPROMPT], last = (Widget) NULL;
X     PromptLine *line_ptr;
X     Dimension width = 0;
X     Arg arglist[1];
X     
X     prompt = XtCreateWidget(name, formWidgetClass, parent, NULL, 0);
X     for (line_ptr = strings; line_ptr - strings < num; line_ptr++) {
X	  lines[line_ptr - strings] = addBox(prompt, line_ptr, &last);
X	  if (width < line_ptr->width) width = line_ptr->width;
X     }
X     XtSetArg(arglist[0], XtNwidth, width);
X     for (line_ptr = strings; line_ptr - strings < num; line_ptr++)
X	  if (line_ptr->center)
X	       XtSetValues(lines[line_ptr - strings], arglist, 1);
X
X     if (return_widgets) {
X	  for (line_ptr = strings; line_ptr - strings < num; line_ptr++)
X	       return_widgets[line_ptr - strings] = lines[line_ptr - strings];
X	  return_widgets[line_ptr - strings] = (Widget) NULL;
X     }
X     XtManageChildren(lines, num);
X     XtRealizeWidget(prompt);
X     return(prompt);
X}
X
X
X
X
XWidget CenteredPromptBox(parent, name, strings, num, return_widgets)
XWidget parent;
Xchar *name;
XPromptLine *strings;
XWidget *return_widgets;
Xint num;
X{
X     Widget prompt; 
X     Dimension shell_width, shell_height, shell_x, shell_y, shell_border;
X     Arg arglist[3];
X
X     prompt = PromptBox(parent, name, strings, num, return_widgets);
X
X     /* Center the widget on the screen */
X     XtSetArg(arglist[0], XtNwidth, &shell_width);
X     XtSetArg(arglist[1], XtNheight, &shell_height);
X     XtSetArg(arglist[2], XtNborder, &shell_border);
X     XtGetValues(prompt, arglist, 3);
X     shell_x = (display_width - shell_width - 2 * shell_border) / 2;
X     shell_y = (display_height - shell_height - 2 * shell_border) / 2;
X     XtMoveWidget(prompt, shell_x, shell_y);
X
X     return(prompt);
X}
END_OF_FILE
if test 4227 -ne `wc -c <'PromptBox.c'`; then
    echo shar: \"'PromptBox.c'\" unpacked with wrong size!
fi
# end of 'PromptBox.c'
fi
if test -f 'PromptBox.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'PromptBox.h'\"
else
echo shar: Extracting \"'PromptBox.h'\" \(444 characters\)
sed "s/^X//" >'PromptBox.h' <<'END_OF_FILE'
Xtypedef struct {
X     char *str;
X     char *name;
X     Pixmap bitmap;
X     Boolean use_default;
X     Boolean center;
X     int spread;
X     Dimension width;
X} PromptLine;
X
X
X
Xstatic PromptLine default_line = {
X     "promptLabel",
X     "prompt",
X     (Pixmap) NULL,
X     False,
X     True,
X     0,
X     0
X};
X
X#define MAXPROMPT		10 /* max number of lines in a */
X				   /* promptbox */
X
Xextern Widget PromptBox();
Xextern Widget CenteredPromptBox();
END_OF_FILE
if test 444 -ne `wc -c <'PromptBox.h'`; then
    echo shar: \"'PromptBox.h'\" unpacked with wrong size!
fi
# end of 'PromptBox.h'
fi
if test -f 'README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(1328 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
X# $Source: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/README,v $
X# $Author: jik $
X# $Header: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/README,v 1.12 91/05/14 23:00:24 jik Exp $
X#
X# Isn't RCS fun?
X#
X
XThis is the source code and all supplementary files for the
Xxscreensaver program.  You should be able to compile the code right
Xout of the box after editing two files: the Imakefile (or
XMakefile.noImake, if you don't use imake; make sure to rename it to
XMakefile), and xsaver.h.  I believe that there are detailed enough
Xcomments in xsaver.h that you should be able to figure out from them
Xwhat to modify and what not to.
X
XYou'll want to edit the application defaults file to display the
XstartupMessage that you want, if any.
X
XImakefile/Makefile.noImake is pretty heavily customized for local use,
Xso you're probably going to want to change a lot of the variables to
Xsuit you.
X
XAny questions, suggested improvements, bugs, bug-fixes, etc. should be
Xsent to Jonathan Kamens (that's me):
X	Internet: 	jik@Athena.MIT.EDU
X                        jik@pit-manager.MIT.EDU
X	BITnet:		s20020@MITVMA
X	UUCP:		{where-ever}!{mit-eddie,bloom-beacon}!mit-athena!jik
X
XHave fun, and make sure to send me your comments, suggestions and
Xfixes!
X
X	Jonathan Kamens
X	MIT Student Information Processing Board
X	MIT Project Athena
END_OF_FILE
if test 1328 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'SigmaPiBeta' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'SigmaPiBeta'\"
else
echo shar: Extracting \"'SigmaPiBeta'\" \(272 characters\)
sed "s/^X//" >'SigmaPiBeta' <<'END_OF_FILE'
X#define spb_width 16
X#define spb_height 16
Xstatic char spb_bits[] = {
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x8e, 0x7a, 0x84, 0x4a,
X   0x98, 0x6a, 0x98, 0x3a, 0x8c, 0x6a, 0x86, 0x4a, 0xbe, 0x6a, 0x00, 0x30,
X   0x00, 0x18, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00};
END_OF_FILE
if test 272 -ne `wc -c <'SigmaPiBeta'`; then
    echo shar: \"'SigmaPiBeta'\" unpacked with wrong size!
fi
# end of 'SigmaPiBeta'
fi
if test -f 'Xsaver.sed' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Xsaver.sed'\"
else
echo shar: Extracting \"'Xsaver.sed'\" \(2821 characters\)
sed "s/^X//" >'Xsaver.sed' <<'END_OF_FILE'
X! $Source: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/Xsaver.sed,v $
X! $Author: jik $
X! $Header: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/Xsaver.sed,v 1.16 90/05/09 18:34:17 jik Exp $
X!
X! This file is part of xscreensaver.  It contains the application
X! defaults file that should be placed in the application defaults
X! directory defined in the Makefile.
X!
X! Author: Jonathan Kamens, MIT Project Athena and
X!                          MIT Student Information Processing Board
X!
X! (c) 1989 by Jonathan Kamens.  This code may be distributed freely
X! as long as this notice is kept intact in its entirety and every
X! effort is made to send all corrections and improvements to the code
X! back to the author.  Also, don't try to make money off of it or
X! pretend that you wrote it.
X
X! THE FOLLOWING DEFAULTS ARE GLOBAL
X
X*cursor:			center_ptr
X*menuButton:			2
X*geometry:			+0+0
X*iconPixmap:			$BITMAPDIR/$ICONPIXMAP
X*synchronize:			true
X*resizable:			false
X*disableXScreenSaver:		true
X*passwordPort:			32253
X
X! *startupMessage:
X
X! THE FOLLOWING DEFAULTS ARE FOR THE XSAVER ICON 
X
X*icon.bitmap:			$BITMAPDIR/$ICONBITMAP
X*icon.resizable:		false
X
X
X! THE FOLLOWING DEFAULTS ARE FOR THE POPUP MENU 
X
X*menu*font:			9x15
X*menu*cursor:			left_ptr
X*menu*leftMargin:		9
X
X! THE FOLLOWING DEFAULTS ARE FOR THE SCREEN-LOCKING WINDOW
X
X! Having something that calls itself a screen saver popping up a
X! white window when it is blanking or locking the screen is a bid
X! ludicrous, even though that's what *should* happen in a normal
X! video application.  Well, this isn't a normal video application --
X! let's use black :-)
X*root.background:		black
X
X
X! THE FOLLOWING DEFAULTS ARE FOR THE FLOATING ICON 
X
X*float.bitmap:			$BITMAPDIR/$FLOATBITMAP
X*float.resizable:		true
X*float.font:			9x15
X*message.font:			9x15
X
X
X! THE FOLLOWING DEFAULTS ARE FOR THE PASSWORD PROMPT BOXES 
X
X*prompt.font:			9x15
X*prompt.time.font:		8x13
X
X
X! THE FOLLOWING DEFAULTS ARE FOR DIALOG BOXES
X
X| all of them
X*gsShell.allowShellResize:		false
X*gsShell*value*useStringInPlace:	true
X*gsShell*value*editType:		edit
X*gsShell*value*resize:			never
X*gsShell*value*resizable:		true
X*gsShell*value*wrap:			word
X*gsShell*label*borderWidth:		0
X
X| just the one-liners
X*gsShell*value*translations: 		#override\
X	<Key>Return:		AcceptValue()\n\
X	Ctrl<Key>Delete:	CancelValue()
X
X! just the lock message
X*gsShell*newMessage*value*translations: 	#override\
X	Ctrl<Key>Return:	AcceptValue()\n\
X	Ctrl<Key>Delete:	CancelValue()
X
X| None of these lengths should be made bigger than 1024
X*newTimeout.value*length: 		10
X*newLock.value*length:	 		100
X*newUnlock.value*length: 		100
X*newMessage.value*length:		1024
X*newMessage.value.height:		60
X
X
X! THE FOLLOWING DEFAULTS ARE THE BUTTON NAMES FOR THE VARIOUS
X! DIALOG BOXES
X
X*gsAccept.label: 	OK
X*gsCancel.label: 	cancel
END_OF_FILE
if test 2821 -ne `wc -c <'Xsaver.sed'`; then
    echo shar: \"'Xsaver.sed'\" unpacked with wrong size!
fi
# end of 'Xsaver.sed'
fi
if test -f 'action.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'action.h'\"
else
echo shar: Extracting \"'action.h'\" \(1203 characters\)
sed "s/^X//" >'action.h' <<'END_OF_FILE'
X/*
X * $Source: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/action.h,v $
X * $Author: jik $
X * $Header: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/action.h,v 1.5 90/05/28 20:27:41 jik Exp $
X * 
X * This file is part of xscreensaver.  It contains a list of action
X * procedures used by main to add action procedures to the toolkit.
X *
X * Author: Jonathan Kamens, MIT Project Athena and
X *                          MIT Student Information Processing Board
X *
X * Copyright (c) 1989 by Jonathan Kamens.  This code may be
X * distributed freely as long as this notice is kept intact in its
X * entirety and every effort is made to send all corrections and
X * improvements to the code back to the author.  Also, don't try to
X * make any money off of it or pretend that you wrote it.
X */
X
Xextern void RaiseRoot(), ClickSave(), ActivateRoot(), ActivateMenu(),
X     RemoveRoot(), GetPassword(), check_lock();
X
Xstatic XtActionsRec actionTable[] = {
X     {"RaiseRoot",		RaiseRoot},
X     {"ActivateRoot",		ActivateRoot},
X     {"ClickSave",		ClickSave},
X     {"ActivateMenu",		ActivateMenu},
X     {"RemoveRoot",		RemoveRoot},
X     {"GetPassword",		GetPassword},
X     {"check_lock",		check_lock}
X};
END_OF_FILE
if test 1203 -ne `wc -c <'action.h'`; then
    echo shar: \"'action.h'\" unpacked with wrong size!
fi
# end of 'action.h'
fi
if test -f 'check_mark' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'check_mark'\"
else
echo shar: Extracting \"'check_mark'\" \(311 characters\)
sed "s/^X//" >'check_mark' <<'END_OF_FILE'
X#define check_width 9
X#define check_height 8
Xstatic char check_bits[] = {
X   0x00, 0x01, 0x80, 0x01, 0xc0, 0x00, 0x60, 0x00,
X   0x31, 0x00, 0x1b, 0x00, 0x0e, 0x00, 0x04, 0x00
X};
Xstatic char blank_bits[] = {
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
X};
END_OF_FILE
if test 311 -ne `wc -c <'check_mark'`; then
    echo shar: \"'check_mark'\" unpacked with wrong size!
fi
# end of 'check_mark'
fi
if test -f 'commLine.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'commLine.h'\"
else
echo shar: Extracting \"'commLine.h'\" \(3156 characters\)
sed "s/^X//" >'commLine.h' <<'END_OF_FILE'
X/*
X * $Source: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/commLine.h,v $
X * $Author: jik $
X * $Header: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/commLine.h,v 1.15 91/11/03 23:20:27 jik Exp $
X * 
X * This file is part of xscreensaver.  It contains the list of
X * command-line options.
X *
X * Author: Jonathan Kamens, MIT Project Athena and
X *                          MIT Student Information Processing Board
X *
X * Copyright (c) 1989 by Jonathan Kamens.  This code may be
X * distributed freely as long as this notice is kept intact in its
X * entirety and every effort is made to send all corrections and
X * improvements to the code back to the author.  Also, don't try to
X * make any money off of it or pretend that you wrote it.
X */
X
Xstatic XrmOptionDescRec app_options[] = {
X{"-B", ".useBackground", XrmoptionNoArg, (caddr_t) "true"},
X{"-v", ".velocity", XrmoptionSepArg, (caddr_t) NULL},
X{"-l", ".autoLock", XrmoptionNoArg, (caddr_t) "true"},
X{"-b", ".allBitmap", XrmoptionSepArg, (caddr_t) NULL},
X{"-t", ".timeout", XrmoptionSepArg, (caddr_t) NULL},
X{"-xsaver", ".disableXScreenSaver", XrmoptionNoArg, (caddr_t) "false"},
X{"-dtime", ".displayTime", XrmoptionNoArg, (caddr_t) "true"},
X{"-delapsed", ".displayElapsed", XrmoptionNoArg, (caddr_t) "true"},
X{"-dtimeout", ".displayTimeout", XrmoptionNoArg, (caddr_t) "true"},
X{"-dtimes", ".DisplayTimes", XrmoptionNoArg, (caddr_t) "true"},
X{"+dtime", ".displayTime", XrmoptionNoArg, (caddr_t) "false"},
X{"+delapsed", ".displayElapsed", XrmoptionNoArg, (caddr_t) "false"},
X{"+dtimeout", ".displayTimeout", XrmoptionNoArg, (caddr_t) "false"},
X{"+dtimes", ".DisplayTimes", XrmoptionNoArg, (caddr_t) "false"},
X{"-key", ".key", XrmoptionSepArg, (caddr_t) NULL},
X{"-ekey", ".encryptedKey", XrmoptionSepArg, (caddr_t) NULL},
X{"-npw", ".usePasswd", XrmoptionNoArg, (caddr_t) "false"},
X{"-lc", ".lockCommand", XrmoptionSepArg, (caddr_t) NULL},
X{"+lc", ".lockCommand", XrmoptionNoArg, (caddr_t) ""},
X{"-uc", ".unlockCommand", XrmoptionSepArg, (caddr_t) NULL},
X{"+uc", ".unlockCommand", XrmoptionNoArg, (caddr_t) ""},
X{"-nofork", ".noFork", XrmoptionNoArg, (caddr_t) "true"},
X{"-mb", ".menuButton", XrmoptionSepArg, (caddr_t) NULL},
X{"-cl", ".leaveClose", XrmoptionNoArg, (caddr_t) "true"},
X{"-L", ".startLocked", XrmoptionNoArg, (caddr_t) "true"},
X{"-m", ".lockMessage", XrmoptionSepArg, (caddr_t) NULL},
X{"-debug", ".debug", XrmoptionNoArg, (caddr_t) "true"},
X{"-icon", ".displayIcon", XrmoptionNoArg, (caddr_t) "true"},
X{"+icon", ".displayIcon", XrmoptionNoArg, (caddr_t) "false"},
X#ifdef PASSWORD_PORT
X{"-port", ".passwordPort", XrmoptionSepArg, (caddr_t) NULL},
X{"+port", ".passwordPort", XrmoptionNoArg, (caddr_t) "0"},
X{"-requirePort", ".requirePort", XrmoptionNoArg, (caddr_t) "false"},
X{"+requirePort", ".requirePort", XrmoptionNoArg, (caddr_t) "true"},
X#endif
X#ifdef _IBMR2
X{"-disableHotkey", ".disableHotkey", XrmoptionNoArg, (caddr_t) "false"},
X{"+disableHotkey", ".disableHotkey", XrmoptionNoArg, (caddr_t) "true"},
X{"-requireHotkey", ".requireHotkey", XrmoptionNoArg, (caddr_t) "false"},
X{"+requireHotkey", ".requireHotkey", XrmoptionNoArg, (caddr_t) "true"},
X#endif /* _IBMR2 */
X};
END_OF_FILE
if test 3156 -ne `wc -c <'commLine.h'`; then
    echo shar: \"'commLine.h'\" unpacked with wrong size!
fi
# end of 'commLine.h'
fi
if test -f 'converter.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'converter.c'\"
else
echo shar: Extracting \"'converter.c'\" \(1669 characters\)
sed "s/^X//" >'converter.c' <<'END_OF_FILE'
X/* $Header: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/converter.c,v 1.3 91/11/06 13:10:56 jik Exp $ */
X/*******************************************************************
X  Copyright (C) 1990 by the Massachusetts Institute of Technology
X
X   Export of this software from the United States of America is assumed
X   to require a specific license from the United States Government.
X   It is the responsibility of any person or organization contemplating
X   export to obtain such a license before exporting.
X
XWITHIN THAT CONSTRAINT, permission to use, copy, modify, and
Xdistribute this software and its documentation for any purpose and
Xwithout fee is hereby granted, provided that the above copyright
Xnotice appear in all copies and that both that copyright notice and
Xthis permission notice appear in supporting documentation, and that
Xthe name of M.I.T. not be used in advertising or publicity pertaining
Xto distribution of the software without specific, written prior
Xpermission.  M.I.T. makes no representations about the suitability of
Xthis software for any purpose.  It is provided "as is" without express
Xor implied warranty.
X
X***************************************************************** */
X
X#include <X11/IntrinsicP.h>
X#include <X11/CoreP.h>
X#include <X11/Xmu/Converters.h>
X
Xstatic XtConvertArgRec foo[] = {
X    {XtBaseOffset, (caddr_t) XtOffset(Widget, core.screen), sizeof(Screen *)}
X};
X
Xextern void XmuCvtStringToBitmap ();
X
Xvoid add_converter ()
X{
X    XtAddConverter( "String", "Bitmap", XmuCvtStringToBitmap,
X		   foo, XtNumber(foo) );
X     XtAddConverter( "String", "Pixmap", XmuCvtStringToBitmap,
X                  foo, XtNumber(foo) );
X}
END_OF_FILE
if test 1669 -ne `wc -c <'converter.c'`; then
    echo shar: \"'converter.c'\" unpacked with wrong size!
fi
# end of 'converter.c'
fi
if test -f 'float.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'float.h'\"
else
echo shar: Extracting \"'float.h'\" \(1335 characters\)
sed "s/^X//" >'float.h' <<'END_OF_FILE'
X/*
X * $Source: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/float.h,v $
X * $Author: jik $
X *
X * This file is part of xscreensaver.  It contains the code for the
X * floating icon.
X *
X * Author: Jonathan Kamens, MIT Project Athena and
X *                          MIT Student Information Processing Board
X *
X * Coyright (c) 1989 by Jonathan Kamens.  This code may be distributed
X * freely as long as this notice is kept intact in its entirety and
X * every effort is made to send all corrections and improvements to
X * the code back to the author.  Also, don't try to make any money off
X * of it or pretend that you wrote it.
X */
X
X#ifndef lint
X     static char rcsid_float_h[] = "$Header: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/float.h,v 1.1 89/09/03 13:40:16 jik Exp $";
X#endif
X
X#ifdef FLOAT
X
Xstatic void UpdateClock();
Xstatic void UpdateFloat();
Xstatic void do_timeout();
Xstatic void MoveFloat();
Xstatic void build_float();
Xstatic int maybe_new_off_opposite_sign();
Xstatic int new_off();
Xstatic Boolean Redo();
X
Xvoid StartupFloat();
Xvoid ActivateFloat();
Xvoid DeactivateFloat();
Xvoid change_message();
Xvoid NewFloat();
X
X#else
X
Xextern void StartupFloat();
Xextern void ActivateFloat();
Xextern void DeactivateFloat();
Xextern void change_message();
Xextern void NewFloat();
X
X#endif
X
X#define DEFAULT_MESSAGE_WIDTH 25
END_OF_FILE
if test 1335 -ne `wc -c <'float.h'`; then
    echo shar: \"'float.h'\" unpacked with wrong size!
fi
# end of 'float.h'
fi
if test -f 'getstring.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'getstring.h'\"
else
echo shar: Extracting \"'getstring.h'\" \(110 characters\)
sed "s/^X//" >'getstring.h' <<'END_OF_FILE'
X#define	GS_CURSORPOS	0
X#define GS_PREVPOS	1
X#define GS_WMPOS	2
X
Xvoid xscr_getstring();
Xvoid init_getstring();
END_OF_FILE
if test 110 -ne `wc -c <'getstring.h'`; then
    echo shar: \"'getstring.h'\" unpacked with wrong size!
fi
# end of 'getstring.h'
fi
if test -f 'globals.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'globals.h'\"
else
echo shar: Extracting \"'globals.h'\" \(1080 characters\)
sed "s/^X//" >'globals.h' <<'END_OF_FILE'
X/*
X * $Source: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/globals.h,v $
X * $Author: jik $
X * $Header: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/globals.h,v 1.9 91/10/06 20:25:36 jik Exp $
X * 
X * This file is part of xscreensaver.  It contains global variable
X * declarations.
X * 
X * Author: Jonathan Kamens, MIT Project Athena and
X *                          MIT Student Information Processing Board
X *
X * Copyright (c) 1989 by Jonathan Kamens.  This code may be
X * distributed freely as long as this notice is kept intact in its
X * entirety and every effort is made to send all corrections and
X * improvements to the code back to the author.  Also, don't try to
X * make any money off of it or pretend that you wrote it.
X */
X
X#ifndef MAIN
X#define tp extern
X#else
X#define tp
X#endif
X
Xtp Display *dpy;
Xtp int screen;
Xtp Widget top_widget, root_widget;
Xtp char *whoami;
Xtp Defaults defs;
Xtp Boolean lock_flag, is_locked;
Xtp Dimension display_height, display_width;
Xtp Window real_root_window;
Xtp Times times;
Xtp FILE *debug_file;
Xtp XtAppContext app_context;
END_OF_FILE
if test 1080 -ne `wc -c <'globals.h'`; then
    echo shar: \"'globals.h'\" unpacked with wrong size!
fi
# end of 'globals.h'
fi
if test -f 'hft.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'hft.c'\"
else
echo shar: Extracting \"'hft.c'\" \(3208 characters\)
sed "s/^X//" >'hft.c' <<'END_OF_FILE'
X/*
X * $Source: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/hft.c,v $
X * $Author: jik $
X *
X * This file is part of xscreensaver.  It contains the code for dealing with
X * enabling/disabling the switching of screens via HFT "hotkeys" on the
X * IBM RS/6000.
X *
X * Author: Lucien Van Elsen, MIT Project Athena
X *
X * Coyright (c) 1989 by Jonathan Kamens.  This code may be distributed
X * freely as long as this notice is kept intact in its entirety and
X * every effort is made to send all corrections and improvements to
X * the code back to the author.  Also, don't try to make any money off
X * of it or pretend that you wrote it.
X */
X
X#ifndef lint
X     static char rcsid_hft_c[] = "$Header: ";
X#endif
X
X#include <sys/types.h>
X#include <sys/hft.h>
X#include <fcntl.h>
X
Xstatic struct hftqstat orig_hft_state;
Xstatic struct hfbuf hft_buffer;
Xstatic int hft_locked = 0;
X
X/* What we're doing here:
X     Get a new hft by opening /dev/hft; this new hft will be inserted at the
X     head of the hft list, making the previously active hft the last one
X     in the list.  We need this new hft to get a handle on the hft device,
X     so that we can use the nec. ioctls.  We let it create a new one for us,
X     because there is no reliable way (without grunging through kernel
X     memory) to determine which hft the X server is running on.
X     
X     Once we've got the hft, "hide" all the screens except the last one,
X     which is the one which was active when the routine was called,
X     which should be the one that the X server is running on.
X     Then, close the hft we got, so it drops out of the ring, and the
X     only unhidden hft becomes the active (visible) one.
X
X     To "unhide" the screens, we again get a new hft to get a handle on the
X     device, and proceed to unhide all the screens that weren't hidden when
X     we started; since we unhide the last terminal in the ring last, it will
X     become the active (visible) one.
X*/
X
Xvoid
Xenable_hft_hotkey()
X{
X  int i,fd;
X  struct hftsmgrcmd hft_cmd;
X
X  if (!hft_locked)
X    return;
X
X  if ((fd = open("/dev/hft",O_RDONLY,0)) < 0) {
X    perror("opening hft");
X    return;
X  }
X
X  for (i=0; i<orig_hft_state.hf_numvts; i++) {
X    if (orig_hft_state.hf_vtinfo[i].hf_vtstate & HFVTHIDDEN)
X      continue;
X    hft_cmd.hf_vtid = orig_hft_state.hf_vtinfo[i].hf_vtid;
X    hft_cmd.hf_cmd = SMUNHIDE;
X
X    if (ioctl(fd, HFTCSMGR, &hft_cmd) != 0)
X      perror("ioctl: HFTCSMGR failed");
X      
X  }
X  close(fd);
X  hft_locked = 0;
X}
X
Xint
Xdisable_hft_hotkey()
X{
X  int fd, i;
X  struct hftsmgrcmd hft_cmd;
X
X  hft_buffer.hf_bufp = (char *) &orig_hft_state;
X  hft_buffer.hf_buflen = sizeof(struct hftqstat);
X
X  if ((fd = open("/dev/hft",O_RDONLY,0)) < 0) {
X    perror("opening hft");
X    return -1;
X  }
X
X  if (ioctl(fd, HFTQSMGR, &hft_buffer) != 0) {
X    perror("ioctl: HFTQSMGR failed");
X    close(fd);
X    return -1;
X  }
X
X  for (i=0; i<(orig_hft_state.hf_numvts -1); i++) {
X    hft_cmd.hf_vtid = orig_hft_state.hf_vtinfo[i].hf_vtid;
X    hft_cmd.hf_cmd = SMHIDE;
X    if (ioctl(fd, HFTCSMGR, &hft_cmd) != 0) { 
X      perror("ioctl: HFTCSMGR failed");
X      close(fd);
X      enable_hft_hotkey();
X      return -1;
X    }
X  }
X  close(fd);
X  hft_locked = 1;
X  return 0;
X}
END_OF_FILE
if test 3208 -ne `wc -c <'hft.c'`; then
    echo shar: \"'hft.c'\" unpacked with wrong size!
fi
# end of 'hft.c'
fi
if test -f 'resources.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'resources.h'\"
else
echo shar: Extracting \"'resources.h'\" \(3728 characters\)
sed "s/^X//" >'resources.h' <<'END_OF_FILE'
X/*
X * $Source: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/resources.h,v $
X * $Author: jik $
X * $Header: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/resources.h,v 1.13 91/11/03 23:20:49 jik Exp $
X *
X * This file is part of xscreensaver.  It contains the array of X
X * resource strings used by the program.
X *
X * Author: Jonathan Kamens, MIT Project Athena and
X *                          MIT Student Information Processing Board
X *
X * Copyright (c) 1989 by Jonathan Kamens.  This code may be
X * distributed freely as long as this notice is kept intact in its
X * entirety and every effort is made to send all corrections and
X * improvements to the code back to the author.  Also, don't try to
X * make any money off of it or pretend that you wrote it.
X */
X
Xstatic XtResource app_resources[] = {
X{"useBackground", "UseBackground", XtRBoolean, sizeof(Boolean),
X XtOffset(Defaults *, use_background), XtRString, "false"},
X{"velocity", "Velocity", XtRInt, sizeof(int), 
X XtOffset(Defaults *, velocity), XtRString, CMPERMINUTE},
X{"autoLock", "AutoLock", XtRBoolean, sizeof(Boolean),
X XtOffset(Defaults *, auto_lock), XtRString, "false"},
X{"displayTime", "DisplayTimes", XtRBoolean, sizeof(Boolean),
X XtOffset(Defaults *, d_time), XtRString, "true"},
X{"displayElapsed", "DisplayTimes", XtRBoolean, sizeof(Boolean),
X XtOffset(Defaults *, d_elapsed), XtRString, "true"},
X{"displayTimeout", "DisplayTimes", XtRBoolean, sizeof(Boolean),
X XtOffset(Defaults *, d_timeout), XtRString, "true"},
X{"timeout", "Timeout", XtRInt, sizeof(int),
X XtOffset(Defaults *, timeout), XtRString, TIMEOUT},
X{"key", "Key", XtRString, sizeof(String),
X XtOffset(Defaults *, key), XtRString, ""},
X{"encryptedKey", "EncryptedKey", XtRString, sizeof(String),
X XtOffset(Defaults *, ekey), XtRString, ""},
X{"usePasswd", "UsePasswd", XtRBoolean, sizeof(Boolean),
X XtOffset(Defaults *, use_passwd), XtRString, "true"},
X{"lockCommand", "LockCommand", XtRString, sizeof(String),
X XtOffset(Defaults *, lock_command), XtRString, ""},
X{"unlockCommand", "UnlockCommand", XtRString, sizeof(String),
X XtOffset(Defaults *, unlock_command), XtRString, ""},
X{"noFork", "NoFork", XtRBoolean, sizeof(Boolean),
X XtOffset(Defaults *, no_fork), XtRString, "false"},
X{"menuButton", "MenuButton", XtRInt, sizeof(int),
X XtOffset(Defaults *, menu_button), XtRString, MENUBUTTON},
X{"leaveClose", "LeaveClose", XtRBoolean, sizeof(Boolean),
X XtOffset(Defaults *, leave_close), XtRString, "false"},
X{"startLocked", "StartLocked", XtRBoolean, sizeof(Boolean),
X XtOffset(Defaults *, start_locked), XtRString, "false"},
X{"lockMessage", "LockMessage", XtRString, sizeof(String),
X XtOffset(Defaults *, lock_message), XtRString, ""},
X{"startupMessage", "StartupMessage", XtRString, sizeof(String),
X XtOffset(Defaults *, startup_message), XtRString, ""},
X{"disableXScreenSaver", "DisableXScreenSaver", XtRBoolean, sizeof(Boolean),
X XtOffset(Defaults *, disable_x_screensaver), XtRString, "true"},
X{"debug", "Debug", XtRBoolean, sizeof(Boolean),
X XtOffset(Defaults *, debug), XtRString, "false"},
X{"displayIcon", "DisplayIcon", XtRBoolean, sizeof(Boolean),
X XtOffset(Defaults *, display_icon), XtRString, "true"},
X#ifdef PASSWORD_PORT
X{"passwordPort", "PasswordPort", XtRInt, sizeof(int),
X XtOffset(Defaults *, password_port), XtRImmediate, (caddr_t) PASSWORD_PORT},
X{"requirePort", "RequirePort", XtRBoolean, sizeof(Boolean),
X XtOffset(Defaults *, require_port), XtRString, "true"},
X#endif
X#ifdef _IBMR2
X{"disableHotkey", "DisableHotkey", XtRBoolean, sizeof(Boolean),
X XtOffset(Defaults *, disable_hotkey), XtRString, "true"},
X{"requireHotkey", "RequireHotkey", XtRBoolean, sizeof(Boolean),
X XtOffset(Defaults *, require_hotkey), XtRString, "true"},
X#endif /* _IBMR2 */     
X};
END_OF_FILE
if test 3728 -ne `wc -c <'resources.h'`; then
    echo shar: \"'resources.h'\" unpacked with wrong size!
fi
# end of 'resources.h'
fi
if test -f 'scaling.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'scaling.c'\"
else
echo shar: Extracting \"'scaling.c'\" \(2085 characters\)
sed "s/^X//" >'scaling.c' <<'END_OF_FILE'
X/*
X * $Source: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/scaling.c,v $
X * $Author: jik $
X *
X * This file is part of xscreensaver.  It contains code for figuring
X * out screen aspect ratios.  This stuff is a bit of magic that
X * probably doesn't work very well since the X server invariably seems
X * to have incorrect numbers for its aspect ratios, but it makes me
X * sleep better at night to know it's here.
X *
X * Author: Jonathan Kamens, MIT Project Athena and
X *                          MIT Student Information Processing Board
X *
X * Copyright (c) 1989 by Jonathan Kamens.  This code may be
X * distributed freely as long as this notice is kept intact in its
X * entirety and every effort is made to send all corrections and
X * improvements to the code back to the author.  Also, don't try to
X * make any money off of it or pretend that you wrote it.
X */
X
X#if !defined(lint) && !defined(SABER)
X     static char rcsid_scaling_c[] = "$Header: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/scaling.c,v 1.8 90/05/09 18:30:23 jik Exp $";
X#endif
X
X#include "xsaver.h"
X#include <math.h>
X#include "globals.h"
X
Xextern double pow(), sqrt();
X
Xdouble cm_per_pixel_x;
Xdouble cm_per_pixel_y;
X
Xvoid init_scaling()
X{
X     cm_per_pixel_x = (double) DisplayWidthMM(dpy, screen) /
X	  display_width / (double) 10.0;
X     cm_per_pixel_y = (double) DisplayHeightMM(dpy, screen) /
X	  display_height / (double) 10.0;
X}
X
Xdouble cm_x(x)
Xint x;
X{
X     return((double) (cm_per_pixel_x * x));
X}
X
Xdouble cm_y(y)
Xint y;
X{
X     return((double) (cm_per_pixel_y * y));
X}
X
X     
Xdouble line_length_cm(x, y)
Xint x, y;
X{
X     return(sqrt((double) (pow(cm_x(x), 2.0) + pow(cm_y(y), 2.0))));
X}
X
X
Xint calc_delay(x_off, y_off, velocity)
Xint x_off, y_off, velocity;
X{
X     double line_length;
X     double delay_minutes, delay_seconds;
X     int delay;
X     
X     line_length = line_length_cm(x_off, y_off);
X     delay_minutes = line_length / (double) velocity;
X     delay_seconds = 60.0 * delay_minutes;
X     delay = (int) ((delay_seconds - (double) ((int) delay_seconds)) * 1000);
X     return (delay);
X}
X
END_OF_FILE
if test 2085 -ne `wc -c <'scaling.c'`; then
    echo shar: \"'scaling.c'\" unpacked with wrong size!
fi
# end of 'scaling.c'
fi
if test -f 'scaling.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'scaling.h'\"
else
echo shar: Extracting \"'scaling.h'\" \(897 characters\)
sed "s/^X//" >'scaling.h' <<'END_OF_FILE'
X/*
X * $Source: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/scaling.h,v $
X * $Author: jik $
X * $Header: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/scaling.h,v 1.4 89/02/28 06:55:26 jik Exp $
X *
X * This file is part of xscreensaver.  It contains the declarations
X * for the code in scaling.c.
X * 
X * Author: Jonathan Kamens, MIT Project Athena and
X *                          MIT Student Information Processing Board
X *
X * Copyright (c) 1989 by Jonathan Kamens.  This code may be
X * distributed freely as long as this notice is kept intact in its
X * entirety and every effort is made to send all corrections and
X * improvements to the code back to the author.  Also, don't try to
X * make any money off of it or pretend that you wrote it.
X */
X
Xextern double cm_per_pixel_x, cm_per_pixel_y;
Xextern double cm_x(), cm_y();
Xextern double line_length_cm();
Xextern int calc_delay();
END_OF_FILE
if test 897 -ne `wc -c <'scaling.h'`; then
    echo shar: \"'scaling.h'\" unpacked with wrong size!
fi
# end of 'scaling.h'
fi
if test -f 'setenv.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'setenv.c'\"
else
echo shar: Extracting \"'setenv.c'\" \(2753 characters\)
sed "s/^X//" >'setenv.c' <<'END_OF_FILE'
X/*
X * Copyright (c) 1987 Regents of the University of California.
X * This file may be freely redistributed provided that this
X * notice remains attached.
X */
X
X#if defined(LIBC_SCCS) && !defined(lint)
Xstatic char sccsid[] = "@(#)setenv.c	1.3 (Berkeley) 6/16/87";
X#endif LIBC_SCCS and not lint
X
X#include "xsaver.h"
X#include <sys/types.h>
X
X#ifdef COMPILE_SETENV
X
X/*
X * setenv(name,value,rewrite)
X *	Set the value of the environmental variable "name" to be
X *	"value".  If rewrite is set, replace any current value.
X */
Xsetenv(name,value,rewrite)
X	register char	*name,
X			*value;
X	int	rewrite;
X{
X	extern char	**environ;
X	static int	alloced;		/* if allocated space before */
X	register char	*C;
X	int	l_value,
X		offset;
X	char	*malloc(), *realloc(), *_findenv();
X
X	if (*value == '=')			/* no `=' in value */
X		++value;
X	l_value = strlen(value);
X	if ((C = _findenv(name,&offset))) {	/* find if already exists */
X		if (!rewrite)
X			return(0);
X		if (strlen(C) >= l_value) {	/* old larger; copy over */
X			while (*C++ = *value++);
X			return(0);
X		}
X	}
X	else {					/* create new slot */
X		register int	cnt;
X		register char	**P;
X
X		for (P = environ,cnt = 0;*P;++P,++cnt);
X		if (alloced) {			/* just increase size */
X			environ = (char **)realloc((char *)environ,
X			    (u_int)(sizeof(char *) * (cnt + 2)));
X			if (!environ)
X				return(-1);
X		}
X		else {				/* get new space */
X			alloced = 1;		/* copy old entries into it */
X			P = (char **)malloc((u_int)(sizeof(char *) *
X			    (cnt + 2)));
X			if (!P)
X				return(-1);
X			bcopy(environ,P,cnt * sizeof(char *));
X			environ = P;
X		}
X		environ[cnt + 1] = NULL;
X		offset = cnt;
X	}
X	for (C = name;*C && *C != '=';++C);	/* no `=' in name */
X	if (!(environ[offset] =			/* name + `=' + value */
X	    malloc((u_int)((int)(C - name) + l_value + 2))))
X		return(-1);
X	for (C = environ[offset];(*C = *name++) && *C != '=';++C);
X	for (*C++ = '=';*C++ = *value++;);
X	return(0);
X}
X
X/*
X * unsetenv(name) --
X *	Delete environmental variable "name".
X */
Xvoid
Xunsetenv(name)
X	char	*name;
X{
X	extern	char	**environ;
X	register char	**P;
X	int	offset;
X
X	while (_findenv(name,&offset))		/* if set multiple times */
X		for (P = &environ[offset];;++P)
X			if (!(*P = *(P + 1)))
X				break;
X}
X
X
Xchar *
X_findenv(name,offset)
X        register char *name;
X        int     *offset;
X{
X        extern char     **environ;
X        register int    len;
X        register char   **P,
X                        *C;
X
X        for (C = name,len = 0;*C && *C != '=';++C,++len);
X        for (P = environ;*P;++P)
X                if (!strncmp(*P,name,len))
X                        if (*(C = *P + len) == '=') {
X                                *offset = P - environ;
X                                return(++C);
X                        }
X        return(NULL);
X}
X
X#endif
END_OF_FILE
if test 2753 -ne `wc -c <'setenv.c'`; then
    echo shar: \"'setenv.c'\" unpacked with wrong size!
fi
# end of 'setenv.c'
fi
if test -f 'util.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'util.c'\"
else
echo shar: Extracting \"'util.c'\" \(5058 characters\)
sed "s/^X//" >'util.c' <<'END_OF_FILE'
X/*
X * $Source: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/util.c,v $
X * $Author: jik $
X *
X * This file is part of xscreensaver.  It contains a whole bunch of
X * utility procedures.
X *
X * Author: Jonathan Kamens, MIT Project Athena and
X *                          MIT Student Information Processing Board
X *
X * Copyright (c) 1989 by Jonathan Kamens.  This code may be
X * distributed freely as long as this notice is kept intact in its
X * entirety and every effort is made to send all corrections and
X * improvements to the code back to the author.  Also, don't try to
X * make any money off of it or pretend that you wrote it.
X */
X
X#ifndef lint
Xstatic char rcsid_util_c[] = "$Header: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/util.c,v 1.11 90/05/09 10:28:34 jik Exp $";
X#endif
X
X#include "xsaver.h"
X#include <X11/Xaw/Form.h>
X#include <pwd.h>
X#include "globals.h"
X
X
Xextern char *getenv(), *malloc();
X
Xchar *get_user();
X
X
X
X
X
X
X
X/* Returns the width of the widget passed in as an argument */
XDimension widget_width(w)
XWidget w;
X{
X     Arg arglist[1];
X     Dimension width;
X     
X     XtSetArg(arglist[0], XtNwidth, &width);
X     XtGetValues(w, arglist, 1);
X
X     return(width);
X}
X
X
X
X
Xchar *widget_string(w)
XWidget w;
X{
X     Arg arglist[1];
X     String label;
X     
X     XtSetArg(arglist[0], XtNlabel, &label);
X     XtGetValues(w, arglist, 1);
X
X     return(label);
X}
X
X
X
X
X
X/* Returns a blank cursor */
XCursor blank_cursor()
X{
X     static Cursor blank = (Cursor) NULL;
X     Pixmap foo;
X     XColor baz;
X
X     if (! blank) {
X	  foo = XCreatePixmap(dpy, RootWindow(dpy, screen), 1, 1, 1);
X	  baz.red = baz.blue = baz.green = 0;
X	  blank = XCreatePixmapCursor(dpy, foo, foo, &baz, &baz, 1, 1);
X     }
X     return(blank);
X}
X
X
X
X
X
Xchar *user_string(str)
Xchar *str;
X{
X     static char buf[100];
X     static int initialized = 0;
X
X     if (! initialized) {
X	  sprintf(buf, str, get_user());
X     }
X     return(buf);
X}
X
X
Xchar *time_string(str, force)
XForceType force;
Xchar *str;
X{
X     struct tm *local;
X     static char buf[100];
X     char new[100];
X     int newf = 0;
X     
X     local = localtime((long) &times.current);
X     sprintf(new, str, local->tm_hour, local->tm_min);
X     if (strcmp(new, buf)) {
X	  strcpy(buf, new);
X	  newf++;
X     }
X     if (newf || (force == Force))
X	  return(buf);
X     else
X	  return ((char *) NULL);
X}     
X
X
X
Xchar *elapsed_string(str, force)
XForceType force;
Xchar *str;
X{
X     static char buf[100];
X     int hours, minutes;
X     char new[100];
X     int newf = 0;
X
X     int elapsed_sec = times.current - times.start;
X     hours = elapsed_sec / 3600;
X     minutes = (elapsed_sec - 3600 * hours) / 60;
X     sprintf(new, str, hours, minutes);
X     if (strcmp(new, buf)) {
X	  strcpy(buf, new);
X	  newf++;
X     }
X     if (newf || (force == Force))
X	  return(buf);
X     else
X	  return((char *) NULL);
X}
X
X
Xchar *timeout_string(str, force)
XForceType force;
Xchar *str;
X{
X     static char buf[100];
X     int hours, minutes;
X     char new[100];
X     int newf = 0;
X     
X     hours = defs.timeout / 60;
X     minutes = defs.timeout - 60 * hours;
X     sprintf(new, str, hours, (hours == 1 ? "hour" : "hours"), 
X	     minutes, (minutes == 1 ? "minute" : "minutes"));
X     if (strcmp(new, buf)) {
X	  strcpy(buf, new);
X	  newf++;
X     }
X
X     if (newf || (force == Force))
X	  return(buf);
X     else
X	  return((char *) NULL);
X}
X
X
Xchar *timeleft_string(str, force)
XForceType force;
Xchar *str;
X{
X     static char buf[100];
X     int hours, minutes;
X     int elapsed_sec = times.current - times.start;
X     char new[100];
X     int newf = 0;
X
X     /* Note that the + 59 in both equations is so that the counter will
X      * always display the minute it is counting down, instead of the
X      * minute before it.  I use + 59 rather than + 60 because
X      * otherwise, when the widget is first mapped it will display one
X      * number above the timeout value.  This is the same reason we
X      * add 1 to the value of the current time when we activate the clock.
X      */
X     hours = (defs.timeout * 60 - elapsed_sec + 59) / 3600;
X     minutes = (defs.timeout * 60 - elapsed_sec + 59 - 3600 * hours) / 60;
X     sprintf(new, str, hours, (hours == 1 ? "hour" : "hours"),
X	     minutes, (minutes == 1 ? "minute" : "minutes"));
X     if (strcmp(new, buf)) {
X	  strcpy(buf, new);
X	  newf++;
X     }
X
X     if (newf || (force == Force))
X	  return(buf);
X     else
X	  return((char *) NULL);
X}
X
X
X
X
X
Xchar *get_user()
X{
X     static char user[MAXUSERNAME];
X     struct passwd *pwent;
X     static char *ptr = (char *) NULL;
X     
X     if (ptr)
X	  return(ptr);
X     
X     ptr = getenv("USER");
X
X     if (ptr) {
X	  ptr = strcpy(user, ptr);
X	  return(user);
X     }
X
X     pwent = getpwuid(getuid());
X
X     if (pwent) {
X	  ptr = strcpy(user, pwent->pw_name);
X	  return(ptr);
X     }
X
X     *user = '\0';
X     
X     return(user);
X}
X
X
X
X
X
Xchar *my_malloc(n, msg)
Xint n;
Xchar *msg;
X{
X     char *temp;
X
X     temp = malloc(n);
X     if (! temp) {
X	  fprintf(stderr, "%s: error malloc'ing for %s\n", whoami, msg);
X	  clean_up_and_die(1);
X     }
X     return(temp);
X}
X
X		  
END_OF_FILE
if test 5058 -ne `wc -c <'util.c'`; then
    echo shar: \"'util.c'\" unpacked with wrong size!
fi
# end of 'util.c'
fi
if test -f 'wordwrap.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'wordwrap.c'\"
else
echo shar: Extracting \"'wordwrap.c'\" \(3579 characters\)
sed "s/^X//" >'wordwrap.c' <<'END_OF_FILE'
X/*
X * $Source: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/wordwrap.c,v $
X * $Author: jik $
X * 
X * This file is part of xscreensaver.  It contains routines for
X * wrapping a string of words into separate lines (and a routine for
X * discarding a set of wrapped lines).
X *
X * Author: Jonathan Kamens, MIT Project Athena and
X *                          MIT Student Information Processing Board
X *
X * Copyright (c) 1989 by Jonathan Kamens.  This code may be
X * distributed freely as long as this notice is kept intact in its
X * entirety and every effort is made to send all corrections and
X * improvements to the code back to the author.  Also, don't try to
X * make any money off of it or pretend that you wrote it.
X */
X
X#ifndef lint
Xstatic char rcsid_wordwrap_c[] = "$Header: /afs/sipb.mit.edu/project/sipbsrc/src/xscreensaver/RCS/wordwrap.c,v 1.3 90/02/01 13:50:12 jik Exp $";
X#endif
X
X#include "xsaver.h"
X#include "globals.h"
X
Xextern char *my_malloc();
X
X
X
X
Xstatic char *string_less_than_n(str, n, next)
Xchar *str;
Xint n;
Xchar **next; /* RETURN */
X{
X     char *buf;
X     char *beginptr, *endptr;
X
X     beginptr = str;
X     /* First, throw away any blanks at the beginning of the line */
X     while (*beginptr == ' ')
X	  beginptr++;
X     /* Next, check if there is a linebreak within the required line */
X     /* length */
X     endptr = index(beginptr, '\n');
X     if (endptr && (endptr - beginptr <= n)) {
X	  /* There is a linebreak, so we return everything up to the */
X	  /* linebreak as the string, and return one past the */
X	  /* linebreak as the next string */
X	  buf = my_malloc(endptr - beginptr + 1, "lock message");
X	  strncpy(buf, beginptr, endptr - beginptr);
X	  buf[endptr - beginptr] = '\0';
X	  *next = endptr + 1;
X	  return(buf);
X     }
X     if (strlen(beginptr) > n) {
X	  /* find the first space within the requested length */
X	  endptr = beginptr + n;
X	  while ((*endptr != ' ') && (endptr > beginptr))
X	       endptr--;
X	  if (endptr == beginptr) {
X	       /* there are no spaces, so we make the return string */
X	       /* the maximum width, put a null at the end of it and */
X	       /* return as the next pointer one after the last */
X	       /* character in buf.  */
X	       buf = my_malloc(n + 1, "lock message");
X	       strncpy(buf, beginptr, n);
X	       buf[n] = '\0';
X	       *next = beginptr + n;
X	       return(buf);
X	  }
X	  else {
X	       /* we've found a space.  The character before it is the */
X	       /* last character in the return array. */
X	       buf = my_malloc(endptr - beginptr + 1, "lock message");
X	       strncpy(buf, beginptr, endptr - beginptr);
X	       buf[endptr - beginptr] = '\0';
X	       *next = endptr + 1;
X	       return(buf);
X	  }
X     }
X     else {
X	  /* the string is less than the maximum length, so we return */
X	  /* the whole thing */
X	  buf = my_malloc(strlen(beginptr) + 1, "lock message");
X	  strcpy(buf, beginptr);
X	  *next = (char *) NULL;
X	  return(buf);
X     }
X}
X
X
X
Xchar **word_wrap(str, ln_lngth, max_lines)
Xchar *str;
Xint ln_lngth, max_lines;
X{
X     char *next_string;
X     char **string_list, **begin;
X     
X     begin = string_list = (char **) my_malloc(sizeof(char *) * 
X					       (max_lines + 1),
X					       "lock message");
X
X     for (next_string = str; next_string && max_lines; 
X	    max_lines--, string_list++)
X	  *string_list = string_less_than_n(next_string, ln_lngth,
X					    &next_string);
X     *string_list = (char *) NULL;
X
X     return(begin);
X}
X
X
X
X
Xvoid discard_wrap(lines)
Xchar **lines;
X{
X     char **ptr;
X
X     for (ptr = lines; *ptr; ptr++)
X	  free(*ptr);
X
X     free(lines);
X}
X
X
END_OF_FILE
if test 3579 -ne `wc -c <'wordwrap.c'`; then
    echo shar: \"'wordwrap.c'\" unpacked with wrong size!
fi
# end of 'wordwrap.c'
fi
if test -f 'wordwrap.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'wordwrap.h'\"
else
echo shar: Extracting \"'wordwrap.h'\" \(55 characters\)
sed "s/^X//" >'wordwrap.h' <<'END_OF_FILE'
Xextern char **word_wrap();
Xextern void discard_wrap();
END_OF_FILE
if test 55 -ne `wc -c <'wordwrap.h'`; then
    echo shar: \"'wordwrap.h'\" unpacked with wrong size!
fi
# end of 'wordwrap.h'
fi
if test -f 'yinyang' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'yinyang'\"
else
echo shar: Extracting \"'yinyang'\" \(281 characters\)
sed "s/^X//" >'yinyang' <<'END_OF_FILE'
X#define foobar_width 16
X#define foobar_height 16
Xstatic char foobar_bits[] = {
X   0xe0, 0x07, 0xf8, 0x19, 0xfc, 0x20, 0x7e, 0x40, 0x7e, 0x40, 0x7f, 0x80,
X   0x7f, 0x80, 0xff, 0x80, 0xff, 0x81, 0xff, 0x83, 0xff, 0x83, 0xfe, 0x43,
X   0xfe, 0x43, 0xfc, 0x21, 0xf8, 0x18, 0xe0, 0x07};
END_OF_FILE
if test 281 -ne `wc -c <'yinyang'`; then
    echo shar: \"'yinyang'\" unpacked with wrong size!
fi
# end of 'yinyang'
fi
echo shar: End of archive 1 \(of 3\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 3 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
