v12i101: xcal, Part01/04
Peter Collinson
pc at hillside.co.uk
Mon May 13 06:20:53 AEST 1991
Submitted-by: Peter Collinson <pc at hillside.co.uk>
Posting-number: Volume 12, Issue 101
Archive-name: xcal/part01
[ moderator's note: this is a complete repost since most people didn't
have the version that the latest "patch" was supposed to upgrade.
This is now the most recent official release.
]
Xcal is a calendar program. It generally sits on your screen
displaying todays date - the format of this can be tailored to your
taste - for more details see the README file discernable below.
Xcal seems to have suffered from distribution problems judging from
the amount of mail that I have in response to my patch. Many people
do not have 3.2. So here is xcal 3.3 in full.
-------------- cut --------------
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
# README
# CHANGES
# TODO
# Imakefile
# Makefile
# XCal.ad
# mouse.bm
# mouseaway.bm
# patchlevel.h
# pscal
# This archive created: Wed May 8 09:14:08 1991
export PATH; PATH=/bin:$PATH
echo shar: extracting "'README'" '(2038 characters)'
if test -f 'README'
then
echo shar: will not over-write existing file "'README'"
else
sed 's/^ X//' << \SHAR_EOF > 'README'
XXcal is a calendar program. It generally sits on your screen
Xdisplaying todays date - the format of this can be tailored to your
Xtaste.
X
XHitting the left button in the date window gives you a `strip' showing
Xthe current month with one line per day. Daily details can be stored
Xin files (like xcalendar - from where I stole the code). The daily
Xdetails will be displayed in the strip - so you can see what you have
Xto do. The X11R4 multi-line widget makes this rather nice.
X
XDaily details can be edited by poking at the appropriate day and
Xgetting an edit window. Daily details can contain times and can
Xbe used to trigger screen alarms.
X
XEach strip has `next' and `previous' button, so you can do the common
Xactions quickly - alternatively you can hit the middle button in the
Xdate window to get a dialogue box which you can use to enter the date
Xof the month which you want to display.
X
XA top level button on the date strip gives you access to a memo pad
Xwhere you can store things that you should be doing. This panel also
Xshows todays information so a single button click can be used to see
Xtodays appointments.
X
XI have also stolen pscal from the net and modified it to work with the
Xprogram. So you can generate pretty printed calendars whenever you
Xlike - assuming that you have a PostScript printer.
X
XThis is release 3.3
XThe history is:
X Release 1.1 posted to comp.sources.x
X + two patches
X Release 2.1 circulated privately
X Release 3.1 posted unintentionally to comp.sources.x
X Release 3.2 posted to comp.sources.x
X
XCaveats
X
XYes this IS another - `I need something real to find out about X exercise'.
XSo, it demonstrates all those faults.
X
XPeter Collinson
XHillside Systems
X61 Hillside Avenue
XCanterbury
XKent, CT2 8HA
X
XPhone: +44 227 761824
XFax: +44 227 762554
XEmail: pc at hillside.co.uk
X
X22/March/1990
X
XFixes/enhancements welcomed....
X
XThis is free... however, if you are going to make some profit from
Xthis, then perhaps you should consider passing something back to me
Xsince I am freelance and mostly don't get paid everyday.
SHAR_EOF
if test 2038 -ne "`wc -c < 'README'`"
then
echo shar: error transmitting "'README'" '(should have been 2038 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'CHANGES'" '(3999 characters)'
if test -f 'CHANGES'
then
echo shar: will not over-write existing file "'CHANGES'"
else
sed 's/^ X//' << \SHAR_EOF > 'CHANGES'
XChanges: CHANGES 2.12 91/03/22
X
X--------------------------- 3.3
X
X Implement the ability to deal with regular weekly events.
X This is part of the memo system. Today's current events are
X shown as part of the memo panel. They can be edited by hitting
X a button and bringing up a special strip with an entry for
X each day. These regular event files are integrated into
X the alarm system.
X
X Allow today's name: Monday, Tuesday etc to appear in the top
X level widget, the header of an edit window and the title of
X the memo box. This is controlled by the Order and Format
X resources and so previous behaviour can be maintained. Beware
X that this redefines the names of the days so
X Sunday maps to Sunday
X and a new short name is used for the abbreviated form
X Sun maps to Sun
X used in date strips.
X
X Ensure that middle and right button translations work in the
X memo button in the top level widget (suggested by Casey
X Leedom).
X
X New Imakefile from Casey Leedom. This has support for pscal.
X New pscal/Imakefile.
X
X Add initialMemo resource so the memo box can popup at startup
X time - (suggested by G. W. Pigman III)
X
X Steven Plite pointed out that the year display is
X inconsistent. To allow choice, add three new resources:
X dateYearIsTwoDigits
X memoYearIsTwoDigits
X editYearIsTwoDigits
X You can now choose how you would like to have your year
X displayed in the various places.
X Defaults to showing four digits.
X
X System V release 4 fixes from Dave McCraken.
X Alters: xcal_alarm.c, xcal_cal.c, *.bm xcal.c
X
X The memo box quit button causes a Save File
X dialogue box to be popped if the memo data has been
X altered and not saved. The behaviour of this was wrong
X when there was no memo data. Reported by Greg Bond.
X Fixed by changing tests in xcal_memo.c.
X
X Proper length of a directory entry under SYSV is
X strlen(dp->d_name) not strlen(dp->d_name)+1.
X Changed xcal_edit.c (Dave McCraken)
X
X Eliminated double definition of GetMemoFile() and incorrect
X definition of MemoHelp() in xcal_memo.c (David C Lawrence)
X
X--------------------------- 3.2
X
XXcal - Version 3.2 Issued to comp.sources.x
X
X Fixes some stupid bugs
X Ensures that update code works properly
X
X---------------------------- 3.1
X
XXcal - Version 3.1 Issued to comp.sources.x (un-intentionally)
X
X Adds the memo functionality and the Stick/Unpin feature
X for alarms.
X
X---------------------------- 2.1
X
XXcal - Version 2.1 Issued privately
X
X Two main differences between version 1.1 and version 2.1
X a) Version 2.1 has alarms so that xcal can poll you
X during the day - idea contributed by Mark Majhor, Sequent
X and then unashame-edly hacked by me.
X b) Version 2.1 has a support program supplied by Ed Gould
X from Mt Xinu allowing you to set up a file suitable for
X driving UNIX's calendar program.
X
X---------------------------- 1.6
X
Xpscal/pscal.sh Fix to make sed work better to truncate the calendar file
X when printing.
X From Gregory Bond, Burdett Buckeridge & Young Ltd, Melbourne, Australia
X Internet: gnb at melba.bby.oz.au non-MX: gnb%melba.bby.oz at uunet.uu.net
X
X---------------------------- 1.5
X
Xxcal.h Add initialCalendar/initialEdit switches
X Support for better start-up options... from
X From: Rod Whitby <rwhitby at adl.austek.oz.au>
X
Xxcal.c Add hooks and code to perform startuo
X
XImakefile Corrected
X
Xxcal.man Add new lines supporting initialCalendar/initialEdit
X
X---------------------------- 1.4
Xxcal_edit.c Fix bug where colour mapping on days failed to change when
X data is deleted or added.
X
Xxcal.h/xcal.c/xcal_strip.c
X Add a new resource minStripWidth intended to allow
X users to widen the strip to some value which seems
X sensible. If zero the resource is unused.
X
XXCal.ad Add colour map from wade at cs.utk.edu
X
Xxcal_edit.c Changes to XBell calls due to typo
X Steve Alexander, Software Technologies Group
X INTERACTIVE Systems Corporation, Naperville, IL
X ...!{sun,ico}!laidbak!stevea
X stevea at i88.isc.com
X
X
X
XXcal - Version 1.1 Issued to the net comp.sources.x.
X xcal: Volume 7, Issue 1-2
X
SHAR_EOF
if test 3999 -ne "`wc -c < 'CHANGES'`"
then
echo shar: error transmitting "'CHANGES'" '(should have been 3999 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'TODO'" '(513 characters)'
if test -f 'TODO'
then
echo shar: will not over-write existing file "'TODO'"
else
sed 's/^ X//' << \SHAR_EOF > 'TODO'
XThere are many things on the list to be done.
X
X1) Xcal needs some way to deal with the situation that the
X strip grows to fill the screen.
X I have various ideas about how to do this.
X Folding the strip?
X
X2) Some people would like a way to deal with annual/monthly events
X and to integrate that with the current strip. Not sure that this
X will happen.
X
XThanks to the many people who have mailed to say thanks and added
Xideas to xcal. Sorry to the people who I refused to listen to or whose
Xideas I haven't used.
X
SHAR_EOF
if test 513 -ne "`wc -c < 'TODO'`"
then
echo shar: error transmitting "'TODO'" '(should have been 513 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'Imakefile'" '(960 characters)'
if test -f 'Imakefile'
then
echo shar: will not over-write existing file "'Imakefile'"
else
sed 's/^ X//' << \SHAR_EOF > 'Imakefile'
X/*
X * Define InstallPsCal if you want to have pscal compiled and installed as
X * part of the xcal compilation and installation.
X */
X/* #define InstallPsCal */
X
X OSMAJORVERSION = OSMajorVersion
X OSMINORVERSION = OSMinorVersion
X DEFINES = -DOSMAJORVERSION=$(OSMAJORVERSION) \
X -DOSMINORVERSION=$(OSMINORVERSION) \
X -DVER_VEC
X
X SRCS1 = xcal.c xcal_alarm.c xcal_edit.c xcal_help.c xcal_popup.c \
X xcal_strip.c xcal_memo.c version.c
X OBJS1 = xcal.o xcal_alarm.o xcal_edit.o xcal_help.o xcal_popup.o \
X xcal_strip.o xcal_memo.o version.o
X
X SRCS2 = xcal_cal.c
X OBJS2 = xcal_cal.o
X
X PROGRAMS = xcal xcal_cal
X
XComplexProgramTarget_1(xcal, XawClientLibs, /**/)
XComplexProgramTarget_2(xcal_cal, /**/, /**/)
XInstallAppDefaults(XCal)
X
X#ifdef InstallPsCal
X#define IHaveSubdirs
X#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
X
X SUBDIRS = pscal
X
XMakeSubdirs($(SUBDIRS))
XDependSubdirs($(SUBDIRS))
X#endif
SHAR_EOF
if test 960 -ne "`wc -c < 'Imakefile'`"
then
echo shar: error transmitting "'Imakefile'" '(should have been 960 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'Makefile'" '(9424 characters)'
if test -f 'Makefile'
then
echo shar: will not over-write existing file "'Makefile'"
else
sed 's/^ X//' << \SHAR_EOF > 'Makefile'
X# Makefile generated by imake - do not edit!
X# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
X#
X# The cpp used on this machine replaces all newlines and multiple tabs and
X# spaces in a macro expansion with a single space. Imake tries to compensate
X# for this, but is not always successful.
X#
X
X###########################################################################
X# Makefile generated from "Imake.tmpl" and <Imakefile>
X# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
X#
X# Platform-specific parameters may be set in the appropriate .cf
X# configuration files. Site-wide parameters may be set in the file
X# site.def. Full rebuilds are recommended if any parameters are changed.
X#
X# If your C preprocessor doesn't define any unique symbols, you'll need
X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
X# "make Makefile", "make Makefiles", or "make World").
X#
X# If you absolutely can't get imake to work, you'll need to set the
X# variables at the top of each Makefile as well as the dependencies at the
X# bottom (makedepend will do this automatically).
X#
X
X###########################################################################
X# platform-specific configuration parameters - edit sun.cf to change
X
X# platform: $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
X# operating system: SunOS 4.1
X
X###########################################################################
X# site-specific configuration parameters - edit site.def to change
X
X# site: $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
X
X SHELL = /bin/sh
X
X TOP = /s/X11/mit
X CURRENT_DIR = .
X
X AR = ar cq
X BOOTSTRAPCFLAGS =
X CC = gcc
X
X COMPRESS = compress
X CPP = /lib/cpp $(STD_CPP_DEFINES)
X PREPROCESSCMD = gcc -E $(STD_CPP_DEFINES)
X INSTALL = install
X LD = ld
X LINT = lint
X LINTLIBFLAG = -C
X LINTOPTS = -axz
X LN = ln -s
X MAKE = make
X MV = mv
X CP = cp
X RANLIB = ranlib
X RANLIBINSTFLAGS =
X RM = rm -f
X STD_INCLUDES =
X STD_CPP_DEFINES =
X STD_DEFINES =
X EXTRA_LOAD_FLAGS =
X EXTRA_LIBRARIES =
X TAGS = ctags
X
X SHAREDCODEDEF = -DSHAREDCODE
X SHLIBDEF = -DSUNSHLIB
X
X PROTO_DEFINES =
X
X INSTPGMFLAGS =
X
X INSTBINFLAGS = -m 0755
X INSTUIDFLAGS = -m 4755
X INSTLIBFLAGS = -m 0664
X INSTINCFLAGS = -m 0444
X INSTMANFLAGS = -m 0444
X INSTDATFLAGS = -m 0444
X INSTKMEMFLAGS = -m 4755
X
X DESTDIR =
X
X TOP_INCLUDES = -I$(INCROOT)
X
X CDEBUGFLAGS = -O
X CCOPTIONS =
X COMPATFLAGS = -DXAW_BC
X
X ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
X ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
X CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
X LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
X LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
X LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
X LDCOMBINEFLAGS = -X -r
X
X MACROFILE = sun.cf
X RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
X
X IMAKE_DEFINES =
X
X IRULESRC = $(CONFIGDIR)
X IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
X
X ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
X $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
X $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
X
X###########################################################################
X# X Window System Build Parameters
X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
X
X###########################################################################
X# X Window System make variables; this need to be coordinated with rules
X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
X
X PATHSEP = /
X USRLIBDIR = $(DESTDIR)/usr/local/lib
X BINDIR = $(DESTDIR)/usr/local/wbin/X11
X INCROOT = $(DESTDIR)/usr/local/include
X BUILDINCROOT = $(TOP)
X BUILDINCDIR = $(BUILDINCROOT)/X11
X BUILDINCTOP = ..
X INCDIR = $(INCROOT)/X11
X ADMDIR = $(DESTDIR)/usr/adm
X LIBDIR = $(USRLIBDIR)/X11
X CONFIGDIR = $(LIBDIR)/config
X LINTLIBDIR = $(USRLIBDIR)/lint
X
X FONTDIR = $(LIBDIR)/fonts
X XINITDIR = $(LIBDIR)/xinit
X XDMDIR = $(LIBDIR)/xdm
X AWMDIR = $(LIBDIR)/awm
X TWMDIR = $(LIBDIR)/twm
X GWMDIR = $(LIBDIR)/gwm
X MANPATH = $(DESTDIR)/usr/man
X MANSOURCEPATH = $(MANPATH)/man
X MANDIR = $(MANSOURCEPATH)n
X LIBMANDIR = $(MANSOURCEPATH)3
X XAPPLOADDIR = $(LIBDIR)/app-defaults
X
X SOXLIBREV = 4.2
X SOXTREV = 4.0
X SOXAWREV = 4.0
X SOOLDXREV = 4.0
X SOXMUREV = 4.0
X SOXEXTREV = 4.0
X
X FONTCFLAGS = -t
X
X INSTAPPFLAGS = $(INSTDATFLAGS)
X
X IMAKE = imake
X DEPEND = makedepend
X RGB = rgb
X FONTC = bdftosnf
X MKFONTDIR = mkfontdir
X MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier.sh
X
X CONFIGSRC = $(TOP)/config
X CLIENTSRC = $(TOP)/clients
X DEMOSRC = $(TOP)/demos
X LIBSRC = $(TOP)/lib
X FONTSRC = $(TOP)/fonts
X INCLUDESRC = $(TOP)/X11
X SERVERSRC = $(TOP)/server
X UTILSRC = $(TOP)/util
X SCRIPTSRC = $(UTILSRC)/scripts
X EXAMPLESRC = $(TOP)/examples
X CONTRIBSRC = $(TOP)/../contrib
X DOCSRC = $(TOP)/doc
X RGBSRC = $(TOP)/rgb
X DEPENDSRC = $(UTILSRC)/makedepend
X IMAKESRC = $(CONFIGSRC)
X XAUTHSRC = $(LIBSRC)/Xau
X XLIBSRC = $(LIBSRC)/X
X XMUSRC = $(LIBSRC)/Xmu
X TOOLKITSRC = $(LIBSRC)/Xt
X AWIDGETSRC = $(LIBSRC)/Xaw
X OLDXLIBSRC = $(LIBSRC)/oldX
X XDMCPLIBSRC = $(LIBSRC)/Xdmcp
X BDFTOSNFSRC = $(FONTSRC)/bdftosnf
X MKFONTDIRSRC = $(FONTSRC)/mkfontdir
X EXTENSIONSRC = $(TOP)/extensions
X
X DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a
X EXTENSIONLIB = -lXext
X
X DEPXLIB = $(DEPEXTENSIONLIB)
X XLIB = $(EXTENSIONLIB) -lX11
X
X DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
X XAUTHLIB = -lXau
X
X DEPXMULIB =
X XMULIB = -lXmu
X
X DEPOLDXLIB =
X OLDXLIB = -loldX
X
X DEPXTOOLLIB =
X XTOOLLIB = -lXt
X
X DEPXAWLIB =
X XAWLIB = -lXaw
X
X LINTEXTENSIONLIB = $(USRLIBDIR)/llib-lXext.ln
X LINTXLIB = $(USRLIBDIR)/llib-lX11.ln
X LINTXMU = $(USRLIBDIR)/llib-lXmu.ln
X LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln
X LINTXAW = $(USRLIBDIR)/llib-lXaw.ln
X
X DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
X
X DEPLIBS1 = $(DEPLIBS)
X DEPLIBS2 = $(DEPLIBS)
X DEPLIBS3 = $(DEPLIBS)
X
X###########################################################################
X# Imake rules for building libraries, programs, scripts, and data files
X# rules: $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $
X
X###########################################################################
X# start of Imakefile
X
X OSMAJORVERSION = 4
X OSMINORVERSION = 1
X DEFINES = -DOSMAJORVERSION=$(OSMAJORVERSION) \
X -DOSMINORVERSION=$(OSMINORVERSION) \
X -DVER_VEC
X
X SRCS1 = xcal.c xcal_alarm.c xcal_edit.c xcal_help.c xcal_popup.c \
X xcal_strip.c xcal_memo.c version.c
X OBJS1 = xcal.o xcal_alarm.o xcal_edit.o xcal_help.o xcal_popup.o \
X xcal_strip.o xcal_memo.o version.o
X
X SRCS2 = xcal_cal.c
X OBJS2 = xcal_cal.o
X
X PROGRAMS = xcal xcal_cal
X
X OBJS = $(OBJS1) $(OBJS2) $(OBJS3)
X SRCS = $(SRCS1) $(SRCS2) $(SRCS3)
X
Xall:: $(PROGRAMS)
X
Xxcal: $(OBJS1) $(DEPLIBS1)
X $(RM) $@
X $(CC) -o $@ $(LDOPTIONS) $(OBJS1) $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
X
Xinstall:: xcal
X $(INSTALL) -c $(INSTPGMFLAGS) xcal $(BINDIR)
X
Xinstall.man:: xcal.man
X $(INSTALL) -c $(INSTMANFLAGS) xcal.man $(MANDIR)/xcal.n
X
Xdepend::
X $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
X
Xlint:
X $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
Xlint1:
X $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
X
Xclean::
X $(RM) $(PROGRAMS)
X
Xxcal_cal: $(OBJS2) $(DEPLIBS2)
X $(RM) $@
X $(CC) -o $@ $(LDOPTIONS) $(OBJS2) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
X
Xinstall:: xcal_cal
X $(INSTALL) -c $(INSTPGMFLAGS) xcal_cal $(BINDIR)
X
Xinstall.man:: xcal_cal.man
X $(INSTALL) -c $(INSTMANFLAGS) xcal_cal.man $(MANDIR)/xcal_cal.n
X
Xinstall:: XCal.ad
X $(INSTALL) -c $(INSTAPPFLAGS) XCal.ad $(XAPPLOADDIR)/XCal
X
X###########################################################################
X# common rules for all Makefiles - do not edit
X
Xemptyrule::
X
Xclean::
X $(RM_CMD) \#*
X
XMakefile::
X - at if [ -f Makefile ]; then \
X echo " $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
X $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
X else exit 0; fi
X $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
X
Xtags::
X $(TAGS) -w *.[ch]
X $(TAGS) -xw *.[ch] > TAGS
X
X###########################################################################
X# empty rules for directories that do not have SUBDIRS - do not edit
X
Xinstall::
X @echo "install in $(CURRENT_DIR) done"
X
Xinstall.man::
X @echo "install.man in $(CURRENT_DIR) done"
X
XMakefiles::
X
Xincludes::
X
X###########################################################################
X# dependencies generated by makedepend
X
SHAR_EOF
if test 9424 -ne "`wc -c < 'Makefile'`"
then
echo shar: error transmitting "'Makefile'" '(should have been 9424 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'XCal.ad'" '(2003 characters)'
if test -f 'XCal.ad'
then
echo shar: will not over-write existing file "'XCal.ad'"
else
sed 's/^ X//' << \SHAR_EOF > 'XCal.ad'
XXCal.MarkForeground: Black
XXCal.MarkBackground: White
XXCal.edit.geometry: 325x150
XXCal.memo.geometry: 325x300
XXCal.alarm.geometry: 325x100+0+150
XXCal*help.geometry: 600x300
XXCal.fontToday: lucidasanstypewriter-12
XXCal*Font: lucidasanstypewriter-12
XXCal*info.Font: lucidasans-10
XXCal*alarmText*Font: 12x24
XXCal*alarmText*scrollVertical: WhenNeeded
XXCal*alarmText*wrap: word
XXCal*display.scrollVertical: WhenNeeded
XXCal*display.scrollHorizontal: WhenNeeded
XXCal*display.cursor: dot
XXCal*text.scrollVertical: WhenNeeded
XXCal*text.scrollHorizontal: WhenNeeded
XXCal*text.autoFill: True
XXCal*helpText.scrollVertical: Always
XXCal*helpText.scrollHorizontal: WhenNeeded
XXCal*helpText.autoFill: True
XXCal*back.Label: <
XXCal*quit.Label: Quit
XXCal*next.Label: >
XXCal*help.Label: Help
XXCal*newdate.Label: Enter mmm yyyy?
XXCal*newdate.ok.Label: ok
XXCal*newdate.cancel.Label: cancel
XXCal*exit.Label: Really exit?
XXCal*exit.yes.Label: yes
XXCal*exit.no.Label: no
XXCal*noedit.ok.Label: ok
XXCal*edit.quit.Label: Quit
XXCal*edit.save.Label: Save
XXCal*edit.help.Label: Help
XXCal*check.Label: Save file?
XXCal*check.yes.Label: yes
XXCal*check.no.Label: no
XXCal*help*helpQuit.Label: quit
XXCal*alarmQuit.Label: Unpin
XXCal*alarmHold.Label: Stick
XXCal*memoTitle.Label: Edit the memo file
XXCal*weeklyEdit.Label: Edit
XXCal*weeklyTitle.Label: Today's regular events
X
X!
X! Colours from reed wade at cs.utk.edu
X!
X!XCal*background: LightSteelBlue
X!XCal*foreground: SaddleBrown
X!XCal.MarkForeground: Black
X!XCal.MarkBackground: CornflowerBlue
X!XCal.edit.background: CornflowerBlue
X!XCal.edit.foreground: OliveGreen
X!XCal*exit.background: MediumTurquoise
X!XCal*exit.foreground: SlateGrey
X!XCal*check.background: lavender
X!XCal*help*background: wheat
X!XCal*help*foreground: blue
X!XCal*newdate*background: plum
X!XCal*newdate*foreground: red
X!XCal*quit.background: SteelBlue
X!XCal*quit.background: green
X!XCal*back.background: yellow
X!XCal*next.background: yellow
X!XCal*no.background: DarkKhaki
X!XCal*yes.background: PapayaWhip
SHAR_EOF
if test 2003 -ne "`wc -c < 'XCal.ad'`"
then
echo shar: error transmitting "'XCal.ad'" '(should have been 2003 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'mouse.bm'" '(251 characters)'
if test -f 'mouse.bm'
then
echo shar: will not over-write existing file "'mouse.bm'"
else
sed 's/^ X//' << \SHAR_EOF > 'mouse.bm'
X#define mouse_width 16
X#define mouse_height 13
Xstatic unsigned char mouse_bits[] = {
X 0xfe, 0x7f, 0xff, 0xff, 0x21, 0x84, 0xa1, 0xb5, 0xa1, 0xb5, 0xa1, 0xb5,
X 0xa1, 0xb5, 0xa1, 0xb5, 0xa1, 0xb5, 0x21, 0x84, 0xff, 0xff, 0xff, 0xff,
X 0xff, 0xff};
SHAR_EOF
if test 251 -ne "`wc -c < 'mouse.bm'`"
then
echo shar: error transmitting "'mouse.bm'" '(should have been 251 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'mouseaway.bm'" '(263 characters)'
if test -f 'mouseaway.bm'
then
echo shar: will not over-write existing file "'mouseaway.bm'"
else
sed 's/^ X//' << \SHAR_EOF > 'mouseaway.bm'
X#define mouseaway_width 16
X#define mouseaway_height 13
Xstatic unsigned char mouseaway_bits[] = {
X 0xfe, 0x7f, 0xff, 0xff, 0x21, 0x84, 0xad, 0xb5, 0xad, 0xb5, 0xad, 0xb5,
X 0xad, 0xb5, 0xad, 0xb5, 0xad, 0xb5, 0x21, 0x84, 0xff, 0xff, 0xff, 0xff,
X 0xff, 0xff};
SHAR_EOF
if test 263 -ne "`wc -c < 'mouseaway.bm'`"
then
echo shar: error transmitting "'mouseaway.bm'" '(should have been 263 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'patchlevel.h'" '(21 characters)'
if test -f 'patchlevel.h'
then
echo shar: will not over-write existing file "'patchlevel.h'"
else
sed 's/^ X//' << \SHAR_EOF > 'patchlevel.h'
X#define PATCHLEVEL 1
SHAR_EOF
if test 21 -ne "`wc -c < 'patchlevel.h'`"
then
echo shar: error transmitting "'patchlevel.h'" '(should have been 21 characters)'
fi
fi # end of overwriting check
if test ! -d 'pscal'
then
echo shar: creating directory "'pscal'"
mkdir 'pscal'
fi
echo shar: entering directory "'pscal'"
cd 'pscal'
echo shar: extracting "'Makefile'" '(8235 characters)'
if test -f 'Makefile'
then
echo shar: will not over-write existing file "'Makefile'"
else
sed 's/^ X//' << \SHAR_EOF > 'Makefile'
X# Makefile generated by imake - do not edit!
X# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
X#
X# The cpp used on this machine replaces all newlines and multiple tabs and
X# spaces in a macro expansion with a single space. Imake tries to compensate
X# for this, but is not always successful.
X#
X
X###########################################################################
X# Makefile generated from "Imake.tmpl" and <Imakefile>
X# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
X#
X# Platform-specific parameters may be set in the appropriate .cf
X# configuration files. Site-wide parameters may be set in the file
X# site.def. Full rebuilds are recommended if any parameters are changed.
X#
X# If your C preprocessor doesn't define any unique symbols, you'll need
X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
X# "make Makefile", "make Makefiles", or "make World").
X#
X# If you absolutely can't get imake to work, you'll need to set the
X# variables at the top of each Makefile as well as the dependencies at the
X# bottom (makedepend will do this automatically).
X#
X
X###########################################################################
X# platform-specific configuration parameters - edit sun.cf to change
X
X# platform: $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
X# operating system: SunOS 4.1
X
X###########################################################################
X# site-specific configuration parameters - edit site.def to change
X
X# site: $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
X
X SHELL = /bin/sh
X
X TOP = /s/X11/mit
X CURRENT_DIR = .
X
X AR = ar cq
X BOOTSTRAPCFLAGS =
X CC = cc
X
X COMPRESS = compress
X CPP = /lib/cpp $(STD_CPP_DEFINES)
X PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
X INSTALL = install
X LD = ld
X LINT = lint
X LINTLIBFLAG = -C
X LINTOPTS = -axz
X LN = ln -s
X MAKE = make
X MV = mv
X CP = cp
X RANLIB = ranlib
X RANLIBINSTFLAGS =
X RM = rm -f
X STD_INCLUDES =
X STD_CPP_DEFINES =
X STD_DEFINES =
X EXTRA_LOAD_FLAGS =
X EXTRA_LIBRARIES =
X TAGS = ctags
X
X SHAREDCODEDEF = -DSHAREDCODE
X SHLIBDEF = -DSUNSHLIB
X
X PROTO_DEFINES =
X
X INSTPGMFLAGS =
X
X INSTBINFLAGS = -m 0755
X INSTUIDFLAGS = -m 4755
X INSTLIBFLAGS = -m 0664
X INSTINCFLAGS = -m 0444
X INSTMANFLAGS = -m 0444
X INSTDATFLAGS = -m 0444
X INSTKMEMFLAGS = -m 4755
X
X DESTDIR =
X
X TOP_INCLUDES = -I$(INCROOT)
X
X CDEBUGFLAGS = -O
X CCOPTIONS =
X COMPATFLAGS = -DXAW_BC
X
X ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
X ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
X CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
X LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
X LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
X LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
X LDCOMBINEFLAGS = -X -r
X
X MACROFILE = sun.cf
X RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
X
X IMAKE_DEFINES =
X
X IRULESRC = $(CONFIGDIR)
X IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
X
X ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
X $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
X $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
X
X###########################################################################
X# X Window System Build Parameters
X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
X
X###########################################################################
X# X Window System make variables; this need to be coordinated with rules
X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
X
X PATHSEP = /
X USRLIBDIR = $(DESTDIR)/usr/local/lib
X BINDIR = $(DESTDIR)/usr/local/wbin/X11
X INCROOT = $(DESTDIR)/usr/local/include
X BUILDINCROOT = $(TOP)
X BUILDINCDIR = $(BUILDINCROOT)/X11
X BUILDINCTOP = ..
X INCDIR = $(INCROOT)/X11
X ADMDIR = $(DESTDIR)/usr/adm
X LIBDIR = $(USRLIBDIR)/X11
X CONFIGDIR = $(LIBDIR)/config
X LINTLIBDIR = $(USRLIBDIR)/lint
X
X FONTDIR = $(LIBDIR)/fonts
X XINITDIR = $(LIBDIR)/xinit
X XDMDIR = $(LIBDIR)/xdm
X AWMDIR = $(LIBDIR)/awm
X TWMDIR = $(LIBDIR)/twm
X GWMDIR = $(LIBDIR)/gwm
X MANPATH = $(DESTDIR)/usr/man
X MANSOURCEPATH = $(MANPATH)/man
X MANDIR = $(MANSOURCEPATH)n
X LIBMANDIR = $(MANSOURCEPATH)3
X XAPPLOADDIR = $(LIBDIR)/app-defaults
X
X SOXLIBREV = 4.2
X SOXTREV = 4.0
X SOXAWREV = 4.0
X SOOLDXREV = 4.0
X SOXMUREV = 4.0
X SOXEXTREV = 4.0
X
X FONTCFLAGS = -t
X
X INSTAPPFLAGS = $(INSTDATFLAGS)
X
X IMAKE = imake
X DEPEND = makedepend
X RGB = rgb
X FONTC = bdftosnf
X MKFONTDIR = mkfontdir
X MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier.sh
X
X CONFIGSRC = $(TOP)/config
X CLIENTSRC = $(TOP)/clients
X DEMOSRC = $(TOP)/demos
X LIBSRC = $(TOP)/lib
X FONTSRC = $(TOP)/fonts
X INCLUDESRC = $(TOP)/X11
X SERVERSRC = $(TOP)/server
X UTILSRC = $(TOP)/util
X SCRIPTSRC = $(UTILSRC)/scripts
X EXAMPLESRC = $(TOP)/examples
X CONTRIBSRC = $(TOP)/../contrib
X DOCSRC = $(TOP)/doc
X RGBSRC = $(TOP)/rgb
X DEPENDSRC = $(UTILSRC)/makedepend
X IMAKESRC = $(CONFIGSRC)
X XAUTHSRC = $(LIBSRC)/Xau
X XLIBSRC = $(LIBSRC)/X
X XMUSRC = $(LIBSRC)/Xmu
X TOOLKITSRC = $(LIBSRC)/Xt
X AWIDGETSRC = $(LIBSRC)/Xaw
X OLDXLIBSRC = $(LIBSRC)/oldX
X XDMCPLIBSRC = $(LIBSRC)/Xdmcp
X BDFTOSNFSRC = $(FONTSRC)/bdftosnf
X MKFONTDIRSRC = $(FONTSRC)/mkfontdir
X EXTENSIONSRC = $(TOP)/extensions
X
X DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a
X EXTENSIONLIB = -lXext
X
X DEPXLIB = $(DEPEXTENSIONLIB)
X XLIB = $(EXTENSIONLIB) -lX11
X
X DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
X XAUTHLIB = -lXau
X
X DEPXMULIB =
X XMULIB = -lXmu
X
X DEPOLDXLIB =
X OLDXLIB = -loldX
X
X DEPXTOOLLIB =
X XTOOLLIB = -lXt
X
X DEPXAWLIB =
X XAWLIB = -lXaw
X
X LINTEXTENSIONLIB = $(USRLIBDIR)/llib-lXext.ln
X LINTXLIB = $(USRLIBDIR)/llib-lX11.ln
X LINTXMU = $(USRLIBDIR)/llib-lXmu.ln
X LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln
X LINTXAW = $(USRLIBDIR)/llib-lXaw.ln
X
X DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
X
X DEPLIBS1 = $(DEPLIBS)
X DEPLIBS2 = $(DEPLIBS)
X DEPLIBS3 = $(DEPLIBS)
X
X###########################################################################
X# Imake rules for building libraries, programs, scripts, and data files
X# rules: $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $
X
X###########################################################################
X# start of Imakefile
X
Xall:: pscal.script
X
Xinstall:: pscal.script
X $(INSTALL) -c $(INSTPGMFLAGS) pscal.script $(BINDIR)/pscal
X
Xinstall.man:: pscal.man
X $(INSTALL) -c $(INSTMANFLAGS) pscal.man $(MANDIR)/pscal.n
X
Xdepend::
X
Xlint::
X
Xinstall.ln::
X
X###########################################################################
X# common rules for all Makefiles - do not edit
X
Xemptyrule::
X
Xclean::
X $(RM_CMD) \#*
X
XMakefile::
X - at if [ -f Makefile ]; then \
X echo " $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
X $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
X else exit 0; fi
X $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
X
Xtags::
X $(TAGS) -w *.[ch]
X $(TAGS) -xw *.[ch] > TAGS
X
X###########################################################################
X# empty rules for directories that do not have SUBDIRS - do not edit
X
Xinstall::
X @echo "install in $(CURRENT_DIR) done"
X
Xinstall.man::
X @echo "install.man in $(CURRENT_DIR) done"
X
XMakefiles::
X
Xincludes::
X
X###########################################################################
X# dependencies generated by makedepend
X
SHAR_EOF
if test 8235 -ne "`wc -c < 'Makefile'`"
then
echo shar: error transmitting "'Makefile'" '(should have been 8235 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'Imakefile'" '(119 characters)'
if test -f 'Imakefile'
then
echo shar: will not over-write existing file "'Imakefile'"
else
sed 's/^ X//' << \SHAR_EOF > 'Imakefile'
XAllTarget(pscal.script)
XInstallScript(pscal,$(BINDIR))
XInstallManPage(pscal,$(MANDIR))
X
Xdepend::
X
Xlint::
X
Xinstall.ln::
SHAR_EOF
if test 119 -ne "`wc -c < 'Imakefile'`"
then
echo shar: error transmitting "'Imakefile'" '(should have been 119 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'pscal.man'" '(3399 characters)'
if test -f 'pscal.man'
then
echo shar: will not over-write existing file "'pscal.man'"
else
sed 's/^ X//' << \SHAR_EOF > 'pscal.man'
X.TH PSCAL 1 "8/January/1990"
X.SH NAME
Xpscal
X.SH SYNOPSIS:
X.B pscal
X[
X.B \-Pprinter
X] [
X.B \-R
X] [
X.B \-r
X] [
X.B \-t
X] [
X.B other printer flags
X] [ month [ year ] ]
X.SH DESCRIPTION:
X.I Pscal
Xgenerates the Postscript showing a calendar for the specified month and year.
XThe year, if omitted, defaults
Xto the current year.
XIf both month and year are omitted, the current month is printed.
X.I Year
Xcan be between 1753
Xand 9999.
XThe
X.I month
Xis a number between 1 and 12.
XI can also be a three letter month abbreviation.
X.LP
XThe calendar can be loaded with information from the user.
XThe information either comes in an `Event' file or can be
Xderived from files under the user's Calendar directory should this exist.
XThe search for this data is as follows, if any of these succeeds the data
Xfor the calendar is taken from that source.
X.IP 1)
XThe shell variable EFILE may be set to the name of an Event file.
X.IP 2)
XAn event file called `Event' may exist in the current directory.
X.IP 3)
XThe file $HOME/.holiday may exist and contain a list of events.
X.IP 4)
XThe directory $HOME/Calendar
Xmay exist containing XCal files.
X.LP
XAn event file should consist of lines of the form
X.IP
Xmonth:day:message string
X.LP
XMessages should be 20 characters or less, with no more than 6
Xmessages per day.
XNo spaces should appear from the beginning
Xof a line until after the second colon.
XMonth and day should be numbers in the obvious ranges.
X.SH OPTIONS
X.IP "\-P\fIprinter\fR" 1i
XThe printer may be specified with the usual \-P\fIprinter\fR syntax.
X.IP "\-r" 1i
XThe calendar page is printed in ``landscape'' orientation (the default).
X.IP "\-R" 1i
XThe calendar page is printed in ``portrait'' orientation; this
Xyields a slightly smaller image and may be more suitable for
Xembedding into other documents.
X.IP "\-t" 1i
XCauses the PostScript to be sent to the standard output, rather
Xthan to the printer. This is useful if you wish to save the
Xoutput in a file, or if you want to use options with the
X.IR lpr (1)
Xcommand.
X.IP "\-F\fIfont\fR" 1i
XSets the font family for the title text (the month and year).
X.IP "\-f\fIfont\fR" 1i
XSets the font family for the day-of-month numbers.
X.PP
XOther arguments starting with `\-' are passed through to
X.IR lpr (1).
X.PP
XAny argument whose first character is '-' is passed on to lpr.
XThe shell variables BANNER, LFOOT, CFOOT, and RFOOT become a
Xtop centered banner, and left, centered, or right justified
Xfooters respectively. As in:
X.IP
XBANNER="Schedule 1" CFOOT=Preliminary pscal 4 90
X.SH AUTHOR
XPatrick Wood
X.br
XCopyright (C) 1987 by Pipeline Associates, Inc.
X.br
XPermission is granted to modify and distribute this free of charge.
X.SH HISTORY
XOriginal From: patwood at unirot.UUCP (Patrick Wood)
X.br
XShell stuff added 3/9/87 by King Ables
X.br
XMade pretty by tjt 1988
X.br
XHoliday and printer flag passing hacks added Dec 1988
Xby smann at june.cs.washington.edu
X.br
XUsed the better looking version with 5 rows of days rather than 6
Xhacked together with holiday and banner/footnotes added
Xby Joe (No Relation) Wood, 12/89, jlw at lzga.ATT.COM
X.SH BUGS
X`Pscal' doesn't work for months before 1753 (weird stuff happened
Xin September, 1752).
X.PP
XA better format for the dates of holidays would be nice.
XAn escape to allow holiday messages to be raw PostScript would
Xalso be nice.
X.PP
XThe holiday messages should be handled more intelligently (ie,
Xthe messages should be clipped to the day).
X
SHAR_EOF
if test 3399 -ne "`wc -c < 'pscal.man'`"
then
echo shar: error transmitting "'pscal.man'" '(should have been 3399 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'pscal.script'" '(13136 characters)'
if test -f 'pscal.script'
then
echo shar: will not over-write existing file "'pscal.script'"
else
sed 's/^ X//' << \SHAR_EOF > 'pscal.script'
X#!/bin/sh
X#+
X#
X# NAME:
X# pscal
X#
X# SYNOPSIS:
X# pscal [-Pprinter] [other printer flags] month year
X#
X# DESCRIPTION:
X# `Pscal' is a PostScript program to print calendars.
X#
X# The file $HOME/.holiday is read and used to print short messages
X# on specified days. The .holiday file should consist of lines of
X# the form
X# month:day:message string
X# Messages should be 20 characters or less, with no more than 6
X# messages per day. No spaces should appear from the beginning
X# of a line until after the second colon.
X# Month and day should be numbers in the obvious ranges.
X# 12/89 - The holiday checking has been loosened up in that the
X# following takes place:
X# 1. The Shell Variable EFILE is used preferentially
X# 2. Then the file Events in the current directory is used
X# 3. Finally the $HOME/.holiday file is used.
X# The whole process can be turned off by setting EFILE=/dev/null.
X#
X# OPTIONS:
X# Any argument whose first character is '-' is passed on to lpr.
X# The shell variables BANNER, LFOOT, CFOOT, and RFOOT become a
X# top centered banner, and left, centered, or right justified
X# footers respectively. As in:
X#
X# BANNER="Schedule 1" CFOOT=Preliminary pscal 4 90
X#
X# AUTHOR:
X# Patrick Wood
X# Copyright (C) 1987 by Pipeline Associates, Inc.
X# Permission is granted to modify and distribute this free of charge.
X#
X# HISTORY:
X# @Original From: patwood at unirot.UUCP (Patrick Wood)
X# @Shell stuff added 3/9/87 by King Ables
X# @Made pretty by tjt 1988
X# @Holiday and printer flag passing hacks added Dec 1988
X# @ by smann at june.cs.washington.edu
X# @Used the better looking version with 5 rows of days rather than 6
X# @ hacked together with holiday and banner/footnotes added
X# @ by Joe (No Relation) Wood, 12/89, jlw at lzga.ATT.COM
X# @Fixed "-R" (didn't work at all; now it at least works on 8.5x11)
X# @Also fixed handling of unrecognized arguments
X# @ by Jeff Mogul, 1/90, mogul at decwrl.dec.com
X#
X# BUGS:
X# `Pscal' doesn't work for months before 1753 (weird stuff happened
X# in September, 1752).
X#
X# A better format for the dates of holidays would be nice.
X# An escape to allow holiday messages to be raw PostScript would
X# also be nice.
X# The holiday messages should be handled more intelligently (ie,
X# the messages should be clipped to the day).
X#
X
X#
X# PostScript program to print calendars.
X# Doesn't deal well with September 1752 or before.
X#
X
XUSAGE="Usage: pscal [ -Rrt ] [ -F hfont ] [ -f font ] [ month [ year ] ]"
X
XTFONT=Times-Bold
XDFONT=Helvetica-Bold
XEFONT=Times-Roman
X
XCalendar=$HOME/Calendar
X
XROTATE=90
XSCALE="1.0 1.0"
X# Was 50 -120 - changed to 71 -120 for A4 Use
XTRANSLATE="71 -120"
X
XLPR="lpr"
X
Xwhile test $# != 0
Xdo
X case $1 in
X -P) test $# -lt 2 && { echo "$USAGE" 1>&2; exit 1; }
X eval ENVAR="$1$2"; shift 2;;
X -P*) eval ENVAR=$1; shift 1;;
X -F) test $# -lt 2 && { echo "$USAGE" 1>&2; exit 1; }
X TFONT="$2"; shift 2;;
X -F*) TFONT=`echo $1 | sed -n 1s/-.//p`; shift 1;;
X -f) test $# -lt 2 && { echo "$USAGE" 1>&2; exit 1; }
X DFONT="$2"; shift 2;;
X -f*) DFONT=`echo $1 | sed -n 1s/-.//p`; shift 1;;
X -t) LPR=cat; shift 1;;
X -r) ROTATE=90; shift 1;;
X -R) ROTATE=0; SCALE="0.75 0.75"; TRANSLATE="50 900"; shift 1;;
X --|-) break;;
X -*) eval ENVAR=\"$ENVAR $1\"; shift 1;;
X *) break
X esac
Xdone
X
Xtest $# -gt 2 && { echo "$USAGE" 1>&2; exit 1; }
X
Xcase $# in
X 0) set `date`; YEAR=$6; MONTH=$2;;
X 1) MONTH=$1; set `date`; YEAR=$6;;
X 2) MONTH=$1 YEAR=$2;;
Xesac
X
XMONTH=`case $MONTH in Jan|jan) echo 1;;Feb|feb) echo 2;;Mar|mar) echo 3;;Apr|apr) echo 4;;
X May|may) echo 5;;Jun|jun) echo 6;;Jul|jul) echo 7;;Aug|aug) echo 8;;
X Sep|sep) echo 9;;Oct|oct) echo 10;;Nov|nov) echo 11;;Dec|dec) echo 12;;
X 1|2|3|4|5|6|7|8|9|10|11|12) echo $MONTH;;esac`
X
Xtest $YEAR -lt 100 && YEAR=`expr $YEAR + 1900`
X
Xif [ -n "$EFILE" -a -r "$EFILE" ]
Xthen
X Files=$EFILE
X monthday=yes
Xelif [ -r Events ]
Xthen
X Files=Events
X monthday=yes
Xelif [ -r $HOME/.holiday ]
Xthen
X Files=$HOME/.holiday
X monthday=yes
Xelif [ -d $Calendar ]
Xthen
X cd $Calendar
X if [ -d xy$YEAR ]
X then
X cd xy$YEAR
X fi
X set 'dummy' 'Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec'
X shift $MONTH
X list=`echo xc*$1$YEAR`
X case "$list" in
X xc\*$1$YEAR)
X ;;
X *)
X for file in $list
X do
X day=`expr $file : 'xc\([0-9]*\)'`
X (cat $file;echo) | sed '/^$/d
X s/^/./' | fmt -25 |
X sed -n "7q
X s/^\.//
X s/^/$day ( /
X s/\$/ )/
X p"
X done > /tmp/pscal$$
X holidays=`cat /tmp/pscal$$`
X rm -f /tmp/pscal$$
X esac
Xfi
X
Xcase "$monthday" in
Xyes)
X holidays=`cat $Files | grep \^$MONTH: | awk -F: '{printf("%s ( %s",$2,$3);\
X for(i = 4; i <= NF; i++) printf(":%s", $i);printf(")\n"); }'`
Xesac
X
X
X$LPR $ENVAR <<END-OF-CALENDAR
X%!
X% PostScript program to draw calendar
X% Copyright (C) 1987 by Pipeline Associates, Inc.
X% Permission is granted to modify and distribute this free of charge.
X
X% The number after /month should be set to a number from 1 to 12.
X% The number after /year should be set to the year you want.
X% You can change the title and date fonts, if you want.
X% We figure out the rest.
X% This program won't produce valid calendars before 1800 due to the switch
X% from Julian to Gregorian calendars in September of 1752 wherever English
X% was spoken.
X
X/month $MONTH def
X/year $YEAR def
X/titlefont /$TFONT def
X/dayfont /$DFONT def
X/eventfont /$EFONT def
X/holidays [ $holidays ] def
X/Bannerstring ($BANNER) def
X/Lfootstring ($LFOOT) def
X/Rfootstring ($RFOOT) def
X/Cfootstring ($CFOOT) def
X
X% calendar names - change these if you don't speak english
X% "August", "April" and "February" could stand to be kerned even if you do
X
X/month_names
X[ (January) (February) (March) (April) (May) (June) (July)
X(August) (September) (October) (November) (December) ]
Xdef
X
X/day_names
X[ (Sunday) (Monday) (Tuesday) (Wednesday) (Thursday) (Friday) (Saturday) ]
Xdef
X
X% layout parameters - you can change these, but things may not look nice
X
X/daywidth 100 def
X/dayheight 95 def
X
X/titlefontsize 48 def
X/weekdayfontsize 10 def
X/datefontsize 30 def
X/footfontsize 20 def
X
X/topgridmarg 35 def
X/leftmarg 35 def
X/daytopmarg 10 def
X/dayleftmarg 5 def
X
X% layout constants - don't change these, things probably won't work
X
X/rows 5 def
X/subrows 6 def
X
X% calendar constants - change these if you want a French revolutionary calendar
X
X/days_week 7 def
X
X/days_month [ 31 28 31 30 31 30 31 31 30 31 30 31 ] def
X
X/isleap { % is this a leap year?
X year 4 mod 0 eq % multiple of 4
X year 100 mod 0 ne % not century
X year 1000 mod 0 eq or and % unless it's a millenia
X} def
X
X/ndays { % number of days in this month
X days_month month 1 sub get
X month 2 eq % February
X isleap and
X {
X 1 add
X } if
X} def
X
X/weekday { % weekday (range 0-6) for integer date
X days_week mod
X} def
X
X/startday { % starting day-of-week for this month
X /off year 2000 sub def % offset from start of "epoch"
X off
X off 4 idiv add % number of leap years
X off 100 idiv sub % number of centuries
X off 1000 idiv add % number of millenia
X 6 add weekday days_week add % offset from Jan 1 2000
X /off exch def
X 1 1 month 1 sub {
X /idx exch def
X days_month idx 1 sub get
X idx 2 eq
X isleap and
X {
X 1 add
X } if
X /off exch off add def
X } for
X off weekday % 0--Sunday, 1--monday, etc.
X} def
X
X/prtevent { % event-string day prtevent
X % print out an event
X /start startday def
X /day 2 1 roll def
X day start add 1 sub 7 mod daywidth mul
X day start add 1 sub 7 div truncate dayheight neg mul
X -5
X numevents day start add get -10 mul add
X numevents
X day start add
X numevents day start add get 1 add
X put
X add moveto
X show
X} def
X
X/drawevents { % read in a file full of events; print
X % the events for this month
X /numevents
X [0 0 0 0 0 0 0
X 0 0 0 0 0 0 0
X 0 0 0 0 0 0 0
X 0 0 0 0 0 0 0
X 0 0 0 0 0 0 0
X 0 0 0 0 0 0 0] def
X eventfont findfont 9 scalefont setfont
X 0 2 holidays length 2 sub {
X dup
X 1 add holidays 2 1 roll get
X 2 1 roll holidays 2 1 roll get
X prtevent
X } for
X
X} def
X
X% ------------------------------------------------------------------------
X
X/prtnum { 3 string cvs show } def
X
X/center { % center string in given width
X /width exch def
X /str exch def width str
X stringwidth pop sub 2 div 0 rmoveto str show
X} def
X
X/centernum { exch 3 string cvs exch center } def
X
X/drawgrid { % draw calendar boxes
X titlefont findfont weekdayfontsize scalefont setfont
X currentpoint /y0 exch def /x0 exch def
X 0 1 days_week 1 sub {
X submonth 0 eq
X {
X x0 y0 moveto
X dup dup daywidth mul 40 rmoveto
X day_names exch get
X daywidth center
X } if
X x0 y0 moveto
X daywidth mul topgridmarg rmoveto
X 1.0 setlinewidth
X submonth 0 eq
X {
X /rowsused rows 1 sub def
X }
X {
X /rowsused rows def
X }
X ifelse
X 0 1 rowsused {
X gsave
X daywidth 0 rlineto
X 0 dayheight neg rlineto
X daywidth neg 0 rlineto
X closepath stroke
X grestore
X 0 dayheight neg rmoveto
X } for
X } for
X} def
X
X/drawnums { % place day numbers on calendar
X dayfont findfont datefontsize
X submonth 0 ne
X {
X 2.5 mul
X } if scalefont setfont
X /start startday def
X /days ndays def
X start daywidth mul dayleftmarg add daytopmarg rmoveto
X submonth 0 ne
X {
X dayleftmarg neg dayheight -2 div rmoveto
X } if
X 1 1 days {
X /day exch def
X gsave
X day start add weekday 0 eq
X {
X submonth 0 eq
X {
X .7 setgray
X } if
X } if
X day start add weekday 1 eq
X {
X submonth 0 eq
X {
X .7 setgray
X } if
X } if
X submonth 0 eq
X {
X isdouble
X {
X day prtdouble
X }
X {
X day prtnum
X } ifelse
X }
X {
X day daywidth centernum
X } ifelse
X grestore
X day start add weekday 0 eq
X {
X currentpoint exch pop dayheight sub 0 exch moveto
X submonth 0 eq
X {
X dayleftmarg 0 rmoveto
X } if
X }
X {
X daywidth 0 rmoveto
X } ifelse
X } for
X} def
X/isdouble { % overlay today with next/last week?
X days start add rows days_week mul gt
X {
X day start add rows days_week mul gt
X {
X true true
X }
X {
X day start add rows 1 sub days_week mul gt
X day days_week add days le and
X {
X false true
X }
X {
X false
X } ifelse
X } ifelse
X }
X {
X false
X } ifelse
X} def
X
X/prtdouble {
X gsave
X dayfont findfont datefontsize 2 mul 3 div scalefont setfont
X exch
X {
X (23/) stringwidth pop dayheight rmoveto
X prtnum
X }
X {
X 0 datefontsize 5 div rmoveto
X prtnum
X 0 datefontsize -5 div rmoveto
X gsave
X dayfont findfont datefontsize scalefont setfont
X (/) show
X grestore
X } ifelse
X grestore
X} def
X
X/drawfill { % place fill squares on calendar
X /start startday def
X /days ndays def
X currentpoint /y0 exch def /x0 exch def
X submonth 0 eq
X {
X usefirst
X {
X /fillstart 2 def
X }
X {
X /fillstart 0 def
X }
X ifelse
X }
X {
X /fillstart 0 def
X }
X ifelse
X fillstart daywidth mul topgridmarg rmoveto
X 1.0 setlinewidth
X fillstart 1 start 1 sub {
X gsave
X .9 setgray
X daywidth 0 rlineto
X 0 dayheight neg rlineto
X daywidth neg 0 rlineto
X closepath fill
X grestore
X daywidth 0 rmoveto
X } for
X x0 y0 moveto
X submonth 0 ne
X {
X /lastday rows 1 add days_week mul def
X days_week 1 sub daywidth mul -440 rmoveto
X }
X {
X /lastday rows days_week mul 2 sub fillstart add def
X days_week 3 sub fillstart add daywidth mul
X -440 dayheight add rmoveto
X } ifelse
X lastday -1 ndays start 1 add add
X {
X /day exch def
X gsave
X .9 setgray
X daywidth 0 rlineto
X 0 dayheight neg rlineto
X daywidth neg 0 rlineto
X closepath fill
X grestore
X day weekday 1 eq
X {
X x0 y0 moveto
X days_week 1 sub daywidth mul -440 dayheight add rmoveto
X }
X {
X daywidth neg 0 rmoveto
X } ifelse
X } for
X} def
X
X/usefirst { % are last two boxes used by days?
X start ndays add rows days_week mul 3 sub gt
X start 2 ge and
X
X} def
X
X/calendar
X{
X titlefont findfont titlefontsize scalefont setfont
X 0 60 moveto
X /month_name month_names month 1 sub get def
X month_name show
X /yearstring year 10 string cvs def
X daywidth days_week mul yearstring stringwidth pop sub 60 moveto
X yearstring show
X
X eventflag {
X % Show a centered Banner if any at the Top
X daywidth days_week mul 2 div
X Bannerstring stringwidth pop 2 div sub
X 60 moveto
X Bannerstring show
X % Show footnotes left-center-right
X eventfont findfont footfontsize scalefont setfont
X /bottomrow { dayheight rows mul 5 sub neg } def
X 0 bottomrow moveto
X Lfootstring show
X daywidth days_week mul Rfootstring stringwidth pop sub
X bottomrow moveto
X Rfootstring show
X daywidth days_week mul Cfootstring stringwidth pop sub 2 div
X bottomrow moveto
X Cfootstring show
X
X } if
X
X 0 -5 moveto
X drawnums
X
X 0 -5 moveto
X drawfill
X
X eventflag {
X 0 0 moveto
X drawevents
X } if
X
X 0 -5 moveto
X drawgrid
X} def
X
X/eventflag true def
X
X$SCALE scale
X$ROTATE rotate
X$TRANSLATE translate
X/submonth 0 def
Xcalendar
X/eventflag false def
Xmonth 1 sub 0 eq
X{
X /lmonth 12 def
X /lyear year 1 sub def
X}
X{
X /lmonth month 1 sub def
X /lyear year def
X} ifelse
Xmonth 1 add 13 eq
X{
X /nmonth 1 def
X /nyear year 1 add def
X}
X{
X /nmonth month 1 add def
X /nyear year def
X} ifelse
Xusefirst
X{
X 0 30 translate
X}
X{
X days_week 2 sub daywidth mul -350 translate
X}
Xifelse
X/submonth 1 def
X/year lyear def
X/month lmonth def
Xgsave
X.138 .138 scale
X12 -120 translate
Xcalendar
Xgrestore
X/submonth 1 def
X/year nyear def
X/month nmonth def
Xdaywidth 0 translate
Xgsave
X.138 .138 scale
X12 -120 translate
Xcalendar
Xgrestore
X
Xshowpage
X
XEND-OF-CALENDAR
X
SHAR_EOF
if test 13136 -ne "`wc -c < 'pscal.script'`"
then
echo shar: error transmitting "'pscal.script'" '(should have been 13136 characters)'
fi
fi # end of overwriting check
echo shar: done with directory "'pscal'"
cd ..
# End of shell archive
exit 0
--
Dan Heller
O'Reilly && Associates Z-Code Software Comp-sources-x:
Senior Writer President comp-sources.x at uunet.uu.net
argv at ora.com argv at zipcode.com
More information about the Comp.sources.x
mailing list