v03i043: Yet another screen saver, Part03/03
Mike Wexler
mikew at wyse.wyse.com
Sat Mar 11 04:40:38 AEST 1989
Submitted-by: jik at pit-manager.mit.edu (Jonathan I. Kamens)
Posting-number: Volume 3, Issue 43
Archive-name: xsaver/part03
#! /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 3 (of 3)."
# Contents: MANIFEST AUTHOR SigmaPiBeta action.h commLine.h globals.h
# resources.h scaling.c scaling.h yinyang
# Wrapped by mikew at wyse on Fri Mar 10 10:36:41 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'MANIFEST' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'MANIFEST'\"
else
echo shar: Extracting \"'MANIFEST'\" \(840 characters\)
sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
X File Name Archive # Description
X-----------------------------------------------------------
X List.c 3
X MANIFEST 1
X Makefile 1
X PATCHLEVEL 1
X PromptBox.c 1
X README 1
X Xscreensaver.sed 1
X action.h 1
X commandLine.h 1
X globals.h 1
X main.c 1
X menuIcon.c 2
X password.c 1
X resources.h 1
X savescreen.c 2
X scaling.c 1
X scaling.h 1
X sigma_pi_beta 1
X sigma_pi_beta 1
X toolkit_patch 1
X util.c 1
X xscreensaver.h 1
X xscreensaver.man.sed 2
X yinyang 1
END_OF_FILE
if test 840 -ne `wc -c <'MANIFEST'`; then
echo shar: \"'MANIFEST'\" unpacked with wrong size!
fi
# end of 'MANIFEST'
fi
if test -f 'AUTHOR' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'AUTHOR'\"
else
echo shar: Extracting \"'AUTHOR'\" \(696 characters\)
sed "s/^X//" >'AUTHOR' <<'END_OF_FILE'
X(Message inbox:1011)
XReturn-Path: jik at PIT-MANAGER.MIT.EDU
XReceived: by wyse.wyse.com (5.58/Wyse master/5-13-88)
X id AA03289; Tue, 28 Feb 89 18:07:35 PST
XReceived: from PIT-MANAGER.MIT.EDU by uunet.UU.NET (5.61/1.14) with SMTP
X id AA28736; Tue, 28 Feb 89 07:21:04 -0500
XReceived: by PIT-MANAGER.MIT.EDU (5.60/1.0)
X id <AA04416 at PIT-MANAGER.MIT.EDU>; Tue, 28 Feb 89 07:20:42 EST
XDate: Tue, 28 Feb 89 07:20:42 EST
XMessage-Id: <8902281220.AA04416 at PIT-MANAGER.MIT.EDU>
XFrom: Jonathan I. Kamens <jik at Athena.MIT.EDU>
XSender: jik at PIT-MANAGER.MIT.EDU
XTo: mikew at wyse.com
XIn-Reply-To: Mike Wexler's message of Thu, 23 Feb 89 14:18:14 -0800 <8902232218.AA12385 at wyse.wyse.com>
XSubject: xscreensaver/Part01
X
X
END_OF_FILE
if test 696 -ne `wc -c <'AUTHOR'`; then
echo shar: \"'AUTHOR'\" unpacked with wrong size!
fi
# end of 'AUTHOR'
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 'action.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'action.h'\"
else
echo shar: Extracting \"'action.h'\" \(1207 characters\)
sed "s/^X//" >'action.h' <<'END_OF_FILE'
X/*
X * $Source: /mit/sipbsrc/uus/src/xscreensaver/RCS/action.h,v $
X * $Author: jik $
X * $Header: action.h,v 1.4 89/02/28 06:54:49 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(), IconOn(), IconOff(), 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 {"IconOn", IconOn},
X {"IconOff", IconOff},
X {"check_lock", check_lock}
X};
END_OF_FILE
if test 1207 -ne `wc -c <'action.h'`; then
echo shar: \"'action.h'\" unpacked with wrong size!
fi
# end of 'action.h'
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'\" \(2113 characters\)
sed "s/^X//" >'commLine.h' <<'END_OF_FILE'
X/*
X * $Source: /mit/sipbsrc/uus/src/xscreensaver/RCS/commandLine.h,v $
X * $Author: jik $
X * $Header: commandLine.h,v 1.7 89/02/28 06:54:59 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", "*bitmap", XrmoptionSepArg, (caddr_t) NULL},
X{"-t", "*timeout", XrmoptionSepArg, (caddr_t) NULL},
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{"-uc", "*unlockCommand", XrmoptionSepArg, (caddr_t) NULL},
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};
END_OF_FILE
if test 2113 -ne `wc -c <'commLine.h'`; then
echo shar: \"'commLine.h'\" unpacked with wrong size!
fi
# end of 'commLine.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'\" \(1170 characters\)
sed "s/^X//" >'globals.h' <<'END_OF_FILE'
X/*
X * $Source: /mit/sipbsrc/uus/src/xscreensaver/RCS/globals.h,v $
X * $Author: jik $
X * $Header: globals.h,v 1.4 89/02/28 06:55:02 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#ifdef MAIN
XDisplay *dpy;
Xint screen;
XWidget top_widget, root_widget;
Xchar *whoami;
XDefaults defs;
XBoolean lock_flag;
XDimension display_height, display_width;
XWindow real_root_window;
XTimes times;
XSaver saver;
X#else
Xextern Display *dpy;
Xextern int screen;
Xextern Widget top_widget, root_widget;
Xextern char *whoami;
Xextern Defaults defs;
Xextern Boolean lock_flag;
Xextern Dimension display_height, display_width;
Xextern Window real_root_window;
Xextern Times times;
Xextern Saver saver;
X#endif
END_OF_FILE
if test 1170 -ne `wc -c <'globals.h'`; then
echo shar: \"'globals.h'\" unpacked with wrong size!
fi
# end of 'globals.h'
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'\" \(2614 characters\)
sed "s/^X//" >'resources.h' <<'END_OF_FILE'
X/*
X * $Source: /mit/sipbsrc/uus/src/xscreensaver/RCS/resources.h,v $
X * $Author: jik $
X * $Header: resources.h,v 1.5 89/02/28 06:55:15 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};
END_OF_FILE
if test 2614 -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'\" \(2036 characters\)
sed "s/^X//" >'scaling.c' <<'END_OF_FILE'
X/*
X * $Source: /mit/sipbsrc/uus/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#ifndef lint
X static char rcsid_scaling_c[] = "$Header: scaling.c,v 1.5 89/02/28 06:55:23 jik Exp $";
X#endif
X
X#include <math.h>
X#include <X11/Intrinsic.h>
X#include <X11/Xos.h>
X#include "xsaver.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 2036 -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'\" \(825 characters\)
sed "s/^X//" >'scaling.h' <<'END_OF_FILE'
X/*
X * $Source: /mit/sipbsrc/uus/src/xscreensaver/RCS/scaling.h,v $
X * $Author: jik $
X * $Header: 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 825 -ne `wc -c <'scaling.h'`; then
echo shar: \"'scaling.h'\" unpacked with wrong size!
fi
# end of 'scaling.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 3 \(of 3\).
cp /dev/null ark3isdone
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
--
Mike Wexler(wyse!mikew) Phone: (408)433-1000 x1330
Moderator of comp.sources.x
More information about the Comp.sources.x
mailing list