[alt.sources] Xkal 1.13 - Part02/05

ferguson@cs.rochester.edu (George Ferguson) (03/14/91)

#! /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 2 (of 5)."
# Contents:  Xkal.ad Xkal.ad.h day.c
# Wrapped by ferguson@swan.cs.rochester.edu on Wed Mar 13 13:49:58 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Xkal.ad' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Xkal.ad'\"
else
echo shar: Extracting \"'Xkal.ad'\" \(23519 characters\)
sed "s/^X//" >'Xkal.ad' <<'END_OF_FILE'
X!
X!	Xkal.ad : Graphical appointment calendar resource file
X!
X!	George Ferguson (ferguson@cs.rochester.edu), 27 Oct 1990.
X!	Version 1.1 - 27 Feb 1991.
X!
X!	$Id: Xkal.ad,v 2.2 91/03/13 13:30:55 ferguson Exp $
X!
X
X! This has must be the first line in the "official" app-defaults file.
XXkal.revision:                  $Revision: 2.2 $
X
X!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X!
X! Options (many of which can be set on the command line)
X!
X
X! Where to get system (non-editable) appointments (can use #include)
XXkal.systemAppoints:		/u/ferguson/lib/xkal.appoints
X
X! Where to get and save personal appointments (can use #include)
XXkal.personalAppoints:		~/.appoints
X
X! The suffix to use when backing up personal appoints before saving.
X! If this is empty then no backups are performed.
XXkal.backupExtension:		~
X
X! How to write out appointments. See the man page for description of
X! the possible escape sequences.
XXkal.outputFormat:		%w%~%d%~%m%~%y%~%t%~%l%~
X
X! If True, then todays appointments are simply listed to stdout. Using
X! xkal with this option does not require an X server connection. This
X! is usually invoked with the "-listOnly" or "-l" command line argument.
X! The exit status is the number of appointments for the day (see also
X! exitUsesLevels below).
XXkal.listOnly:			False
X
X! If True, then like listOnly but only the exit status is set. This
X! also does not require an X server connection and can be set with the
X! "-silent" or "-s" command line argument.
XXkal.silent:			False
X
X! If True, then the exit status for "listOnly" or "silent" modes is the
X! sum of the criticality levels of the appointments, rather than the number
X! of them. This can be set with the "-exitUsesLevels" or "-e" argument.
XXkal.exitUsesLevels:		False
X
X! If True, then the xkal version and patchlevel are printed to stdout
X! and xkal exits. This also not require an X server connection and
X! can be set with the "-version" or "-v" command line argument.
XXkal.version:			False
X
X! If true, then the day's appointments are shown next to the month(s)
X! display. If false, then clicking on a day pops up it's entries.
XXkal.bothShown:			True
X
X! If true, the titlebar of the main window and any popup day windows is
X! changed to reflect the selected day.
XXkal.useTitlebar:		True
X
X! Can be 1, 2, 3, or 12, indicating the number of months to display upon
X! startup.
XXkal.numMonths:			1
X
X! If true, the day number is drawn opaquely in its box in the month display.
X! This may be clearer on mono displays with certain stipple patterns (see
X! "shades" below.
XXkal.opaqueDates:		True
X
X! If true, then the top of each month's columns is labelled with the
X! appropriate day-of-the-week.
XXkal.dowLabels:			False
X
X! The number of minutes between automatic checkpointing (saving) of the
X! appointments.  If this is zero, then no automatic checkpointing is done.
XXkal.checkpointInterval:	5
X
X! The characters that delimit the "criticality level" of an appointment
X! in an appointments file.
XXkal.levelDelim:	@@
X
X! The default level of criticality when an appointment is added.
XXkal.defaultLevel:	1
X
X!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X!
X! These resources allow you customize the names of days-of-the-week and
X! months for other languages. The "dowOffset" resource indicates which
X! day of the week is "leftmost". This would typically be "0" for North
X! America and "1" for Europe (to put Monday at the left). If the
X! "daySlashMonth" resource is true, then dates with a slash are interpreted
X! as day/mon/year rather than the default mon/day/year.
X!
XXkal.longDowStrings:	Sunday Monday Tuesday Wednesday Thursday Friday Saturday
XXkal.shortDowStrings:	Sun Mon Tue Wed Thu Fri Sat
XXkal.longMonthStrings:	January February March April May June \
X			July August September October November December
XXkal.shortMonthStrings: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
XXkal.dowOffset:		0
XXkal.daySlashMonth:	False
X
X!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X!
X! These resources customize how a day's appointments are presented. Entries
X! are provided starting at "appsStartTime", going by increments of
X! "appsIncrement" to "appsEndTime". These times can be given in 12- or 24-hr
X! notation; the "appsUseAmPm" resource specifies how they should be displayed.
X! Then "numNotes" entries labelled with "notesLabel" are presented.
X! The "noonStr" and "midnightStr" customize labels for the corresponding slots.
X! (You can make them "12:00pm" and "12:00am" if you just want them all to
X! look the same. Be careful that this doesn't throw off the interpretation
X! of existing appointment files.)
X!
X! Entries for times outside this range or entries that collide with other
X! entries are moved. The "rearrangeSilently" resource indicates whether or
X! not to indicate the original time in brackets before the appointment's text.
X!
XXkal.appsStartTime:	8:00
XXkal.appsEndTime:	17:00
XXkal.appsIncrement:	:30
XXkal.appsUseAmPm:	False
XXkal.numNotes:		2
XXkal.notesLabel:	NOTES
XXkal.noonStr:		Noon
XXkal.midnightStr:	Midnight
XXkal.rearrangeSilently:	False
X
X!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X!
X! The toplevel shell and form
X!
XXkal*allowShellResize:		True
XXkal.bothForm.defaultDistance:	2
X
X!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X!
X! The menu buttons across the top of the main window.
X! These are specified using the EzMenu package.
X!
XXkal.bothForm.fileButton.label:		File
XXkal.bothForm.fileButton.menuName:	fileMenu
XXkal.bothForm.fileMenu.menu:\
X	(item "File") \
X	(line) \
X	(item "[S] Save" (action "xkal-save()")) \
X	(item "[Q] Quit" (action "xkal-quit()")) \
X	(item "[X] Exit" (action "xkal-exit()"))
X
XXkal.bothForm.viewButton.label:		View
XXkal.bothForm.viewButton.fromHoriz:	fileButton
XXkal.bothForm.viewButton.menuName:	viewMenu
XXkal.bothForm.viewMenu.menu:\
X	(item "View") \
X	(line) \
X	(item "[N] Next" (action "xkal-next()")) \
X	(item "[P] Prev" (action "xkal-prev()")) \
X	(item "[T] Today" (action "xkal-today()")) \
X	(item "[1] 1 Month" (action "xkal-numMonths(1)")) \
X	(item "[2] 2 Months" (action "xkal-numMonths(2)")) \
X	(item "[3] 3 Months" (action "xkal-numMonths(3)")) \
X	(item "[12] 12 Months" (action "xkal-numMonths(12)"))
X
XXkal.bothForm.otherButton.label:	Other
XXkal.bothForm.otherButton.fromHoriz:	viewButton
XXkal.bothForm.otherButton.menuName:	otherMenu
XXkal.bothForm.otherMenu.menu:\
X	(item "Other") \
X	(line) \
X	(item "[?] Help" (action "xkal-system(xterm -title 'Xkal Help' -e man xkal)")) \
X	(item "[E] Edit defaults" (action "xkal-edit-defaults()"))
X
X!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X!
X! These resources control the layout of the (possibly multiple) months
X! and translations for all widgets having to do with months or the days
X! in them.
X!
X! Where there are four sets of entries ending in "1", "2", "3", and "12"
X! respectively, then each set applies when that number of months is being
X! displayed. Entries of the form "X_Y" apply to the Y'th month when X
X! months are being displayed.
X!
X
X! All 1, 2, 3, or 12 months are put in "allMonthsForm", which goes under
X! the menuButtons.
XXkal.bothForm.allMonthsForm.fromVert:		fileButton
XXkal.bothForm.allMonthsForm*defaultDistance:	0
XXkal.bothForm.allMonthsForm*resizable:		True
XXkal.bothForm.allMonthsForm*internalWidth:	1
XXkal.bothForm.allMonthsForm*internalHeight:	1
XXkal.bothForm.allMonthsForm*translations:#override\n\
X	<Key>Q:		xkal-quit() \n\
X	<Key>X:		xkal-exit() \n\
X	<Key>N:		xkal-next() \n\
X	<Key>P:		xkal-prev() \n\
X	<Key>T:		xkal-today() \n\
X	<Key>S:		xkal-save() \n\
X	<Key>?:		xkal-system("xterm -title 'Xkal Help' -e man xkal") \n\
X	<Key>E:		xkal-edit-defaults() \n\
X	<Key>1:		xkal-numMonths(1) \n\
X	<Key>2:		xkal-numMonths(2) \n\
X	<Key>3:		xkal-numMonths(3) \n\
X	<Key>1,<Key>2:	xkal-numMonths(12) \n
X
X! When only one month is being displayed its the only one, of course.
XXkal.bothForm.allMonthsForm.monthForm1.fromHoriz:	NULL
XXkal.bothForm.allMonthsForm.monthForm1.fromVert:	NULL
X
X! When two months are being displayed we put them vertically.
XXkal.bothForm.allMonthsForm.monthForm2_1.fromHoriz:	NULL
XXkal.bothForm.allMonthsForm.monthForm2_1.fromVert:	NULL
XXkal.bothForm.allMonthsForm.monthForm2_2.fromVert:	monthForm2_1
X
X! When three months are being displayed we put them vertically.
XXkal.bothForm.allMonthsForm.monthForm3_1.fromHoriz:	NULL
XXkal.bothForm.allMonthsForm.monthForm3_1.fromVert:	NULL
XXkal.bothForm.allMonthsForm.monthForm3_2.fromVert:	monthForm3_1
XXkal.bothForm.allMonthsForm.monthForm3_3.fromVert:	monthForm3_2
X
X! When twelve months are being displayed we put them four across and
X! three down.
XXkal.bothForm.allMonthsForm.monthForm12_1.fromHoriz:	NULL
XXkal.bothForm.allMonthsForm.monthForm12_1.fromVert:	NULL
XXkal.bothForm.allMonthsForm.monthForm12_2.fromHoriz:	monthForm12_1
XXkal.bothForm.allMonthsForm.monthForm12_3.fromHoriz:	monthForm12_2
XXkal.bothForm.allMonthsForm.monthForm12_4.fromHoriz:	monthForm12_3
X
XXkal.bothForm.allMonthsForm.monthForm12_5.fromVert:	monthForm12_1
XXkal.bothForm.allMonthsForm.monthForm12_6.fromHoriz:	monthForm12_5
XXkal.bothForm.allMonthsForm.monthForm12_6.fromVert:	monthForm12_2
XXkal.bothForm.allMonthsForm.monthForm12_7.fromHoriz:	monthForm12_6
XXkal.bothForm.allMonthsForm.monthForm12_7.fromVert:	monthForm12_3
XXkal.bothForm.allMonthsForm.monthForm12_8.fromHoriz:	monthForm12_7
XXkal.bothForm.allMonthsForm.monthForm12_8.fromVert:	monthForm12_4
X
XXkal.bothForm.allMonthsForm.monthForm12_9.fromVert:	monthForm12_5
XXkal.bothForm.allMonthsForm.monthForm12_10.fromHoriz:	monthForm12_9
XXkal.bothForm.allMonthsForm.monthForm12_10.fromVert:	monthForm12_6
XXkal.bothForm.allMonthsForm.monthForm12_11.fromHoriz:	monthForm12_10
XXkal.bothForm.allMonthsForm.monthForm12_11.fromVert:	monthForm12_7
XXkal.bothForm.allMonthsForm.monthForm12_12.fromHoriz:	monthForm12_11
XXkal.bothForm.allMonthsForm.monthForm12_12.fromVert:	monthForm12_8
X
X!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X!
X! The month forms that display shaded/colored boxes for each day.
X! These widgets are all children of Xkal.bothForm.allMonthsForm.monthFormX_Y
X! where X is the number of months being displayed and Y is which month this
X! is of those.
X
X! The month labels in the monthForms (ie. the name of the month). The width
X! has to be specified to make it fit nicely. The best I can come up with is:
X!	monthLabelX.width = (dateWidthX+internalWidth)*7+borderWidth*12
X!
XXkal*monthLabel1.font:		*fixed*bold*
XXkal*monthLabel1.borderWidth:	0
XXkal*monthLabel1.justify:	center
XXkal*monthLabel1.width:		376
XXkal*monthLabel1.resize:	False
X
XXkal*monthLabel2.font:		6x9
XXkal*monthLabel2.borderWidth:	0
XXkal*monthLabel2.justify:	center
XXkal*monthLabel2.width:		201
XXkal*monthLabel2.resize:	False
X
XXkal*monthLabel3.font:		6x9
XXkal*monthLabel3.borderWidth:	0
XXkal*monthLabel3.justify:	center
XXkal*monthLabel3.width:		201
XXkal*monthLabel3.resize:	False
X
XXkal*monthLabel12.font:		5x8
XXkal*monthLabel12.borderWidth:	0
XXkal*monthLabel12.justify:	center
XXkal*monthLabel12.width:	131
XXkal*monthLabel12.resize:	False
X
X! The day-of-week labels (if .dowLabels is True). Again, here's a crack at
X! figuring the width:
X!	dowLabelX.width = dateWidthX+internalWidth*2
X!
XXkal*dowLabel1.font:		*fixed*bold*
XXkal*dowLabel1.borderWidth:	1
XXkal*dowLabel1.width:		52
XXkal*dowLabel1.resize:		False
X
XXkal*dowLabel2.font:		6x9
XXkal*dowLabel2.borderWidth:	1
XXkal*dowLabel2.width:		27
XXkal*dowLabel2.resize:		False
X
XXkal*dowLabel3.font:		6x9
XXkal*dowLabel3.borderWidth:	1
XXkal*dowLabel3.width:		27
XXkal*dowLabel3.resize:		False
X
XXkal*dowLabel12.font:		5x8
XXkal*dowLabel12.borderWidth:	1
XXkal*dowLabel12.width:		17
XXkal*dowLabel12.resize:		False
X
X!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X!
X! These control the individual days in the monthForms. Their height and
X! width determine, in large part, the size of the application, so adjust
X! accordingly. The "datePosition" is an offset in pixels from the top,
X! left corner. Note that "dateWidthX" and "dateHeightX" are *not* actually
X! resources of the Command widgets they are specifying. Rather, they are
X! applications resources of Xkal. This is because I can't figure out how
X! to do it any other way and still have the thing come out properly sized.
X! It doesn't really matter, since you'd have to specify it somewhere anyway.
X!
X! See also the "level of criticality" resources, below.
X!
X
XXkal.dateFont1:			*fixed*bold*
XXkal.datePosition1:		+10+10
XXkal.dateWidth1:		50
XXkal.dateHeight1:		50
X
XXkal.dateFont2:			6x9
XXkal.datePosition2:		+0+6
XXkal.dateWidth2:		25
XXkal.dateHeight2:		25
X
XXkal.dateFont3:			6x9
XXkal.datePosition3:		+0+6
XXkal.dateWidth3:		25
XXkal.dateHeight3:		25
X
XXkal.dateFont12:		5x8
XXkal.datePosition12:		+0+6
XXkal.dateWidth12:		15
XXkal.dateHeight12:		15
X
X!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X! These resources control the graphical representation of the "criticality"
X! level of appointments. For mono displays this is done by shading the
X! calendar "box" with a pattern; for color displays the box is drawn in
X! the appropriate color. At most "maxLevel" levels can be distinguished;
X! levels above this use the last shade or color. If less than "maxLevel"
X! shades or colors are given in the "shades" or "colors" resources, then
X! the last entry given is used for levels for which none is specified.
X!
X! For example, if you want *any* day for which there is at least one
X! non-zero-level appointment to be shaded/colored, simply set "maxLevel"
X! to "1" and set "shades" and/or "colors" to the desired color.
X!
X! The shade bitmaps are found in the directory specified by the global
X! resource "bitmapFilePath" (/usr/staff/include/X11/bitmaps by default).
X!
X! See also "levelDelim" and "defaultLevel" above.
X!
X
X! The shade for calendar boxes without dates
XXkal.noDayShade:	cross_weave
X
X! The number of levels of criticality (reflected by shade or color)
XXkal.maxLevel:		7
X
X! For mono displays, the patterns reflecting the number of appointments
XXkal.shades:	gray3 gray3 light_gray light_gray gray gray flipped_gray
X
X! For color displays, the colors reflecting the number of appointments
XXkal.colors:	green green blue blue yellow yellow red
X
X!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X!
X! The dayForm, that displays one day's appointment. See also "appsStartTime",
X! "appsEndTime", "appsIncrement", and the rest, above. This can be a
X! popup window or not, depending on "bothShown".
X!
X
X! if it's a popup
XXkal.popupDayShell.title:				Xkal Day Window
X
XXkal.popupDayShell.popupDayForm.defaultDistance:	2
X
XXkal.popupDayShell.popupDayForm.dismissButton.label:	Dismiss
XXkal.popupDayShell.popupDayForm.selectButton.label:	Select
XXkal.popupDayShell.popupDayForm.selectButton.fromHoriz:	dismissButton
XXkal.popupDayShell.popupDayForm.unselectButton.label:	Unselect
XXkal.popupDayShell.popupDayForm.unselectButton.fromHoriz:selectButton
X
XXkal.popupDayShell.popupDayForm.dayForm.fromVert:	dismissButton
XXkal.popupDayShell.popupDayForm.dayForm.borderWidth:	0
X
X! if it's not a popup
XXkal.bothForm.dayForm.fromHoriz:			allMonthsForm
XXkal.bothForm.dayForm.fromVert:				fileButton
XXkal.bothForm.dayForm.defaultDistance:			4
X
X!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X!
X! Each entry in the dayForm (popup or not) is displayed using an "appointLabel"
X! for the time of the entry and an "appointText" for the text of the entry.
X! The date of the day being displayed is set in the "dayLabel" at the top
X! of the form. Note that the dayLabel is not displayed in popup day
X! windows when "useTitlebar" is true (since is redundant then).
X!
XXkal*dayForm*dayLabel.justify:			center
XXkal*dayForm*dayLabel.width:			230
XXkal*dayForm*dayLabel.borderWidth:		0
XXkal*dayForm*dayLabel.label:			Xkal 1.1
X
XXkal*dayForm*appointLabel.font:			fixed
XXkal*dayForm*appointLabel.borderWidth:		0
XXkal*dayForm*appointLabel.vertDistance:		2
XXkal*dayForm*appointLabel.translations:#override\n\
X        <Btn1Up>(2):		xkal-edit-appoint() \n
X
XXkal*dayForm*appointText*font:			fixed
XXkal*dayForm*appointText.width:			200
XXkal*dayForm*appointText.height:		20
XXkal*dayForm*appointText.vertDistance:		3
XXkal*dayForm*appointText.borderWidth:		0
XXkal*dayForm*appointText.topMargin:		0
XXkal*dayForm*appointText*editType:		edit
XXkal*dayForm*appointText*resize:		True
XXkal*dayForm*appointText*displayCaret:		False
XXkal*dayForm*appointText.scrollHorizontal:	whenNeeded
XXkal*dayForm*appointText*Scrollbar.thickness:	5
X! These translations allow the input focus to switch between entries
X! using Return and Shift-Return. You could also change them to arrow
X! keys or anything else, but I suggest making Return a no-op() then
X! to avoid losing the text in a one-line window.
XXkal*dayForm*appointText.translations:#override\n\
X	<Enter>:		xkal-focus-this-item() \n\
X	<Leave>:		xkal-focus-no-item() \n\
X	<FocusIn>:		display-caret(True) \n\
X	<FocusOut>:		display-caret(False) \n\
X        None<Key>Return:	xkal-focus-next-item() \n\
X        Shift<Key>Return:	xkal-focus-prev-item() \n\
X        <Btn1Up>(2):		xkal-edit-appoint() \n
X
X
X!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X!
X! The popup appointment editing panel.
X!
XXkal.editShell.title:		Xkal Appointment Editor
X
XXkal.editShell.editForm.applyButton.label:	Apply
X
XXkal.editShell.editForm.revertButton.label:	Revert
XXkal.editShell.editForm.revertButton.fromHoriz:	applyButton
X
XXkal.editShell.editForm.deleteButton.label:	Delete
XXkal.editShell.editForm.deleteButton.fromHoriz:	revertButton
X
XXkal.editShell.editForm.dismissButton.label:	Dismiss
XXkal.editShell.editForm.dismissButton.fromHoriz:deleteButton
X
XXkal.editShell.editForm.Label.borderWidth:	0
XXkal.editShell.editForm*Text*borderWidth:	0
XXkal.editShell.editForm*Text*editType:		edit
XXkal.editShell.editForm*Text*font:		fixed
XXkal.editShell.editForm*Text*width:		200
XXkal.editShell.editForm*Text*displayCaret:	False
XXkal.editShell.editForm*Text.scrollHorizontal:	whenNeeded
XXkal.editShell.editForm*Text*Scrollbar.thickness:5
X! Note that these translations use "xkal-focus-*-edit-item()".
XXkal.editShell.editForm*Text*translations:#override\n\
X	<Enter>:		xkal-focus-this-item() \n\
X	<Leave>:		xkal-focus-no-item() \n\
X	<FocusIn>:		display-caret(True) \n\
X	<FocusOut>:		display-caret(False) \n\
X        None<Key>Return:	xkal-focus-next-edit-item() \n\
X        Shift<Key>Return:	xkal-focus-prev-edit-item() \n
X
XXkal.editShell.editForm.dowLabel.label:		Day-of-week:
XXkal.editShell.editForm.dowLabel.fromVert:	applyButton
XXkal.editShell.editForm.dowText.fromHoriz:	dowLabel
XXkal.editShell.editForm.dowText.fromVert:	applyButton
X
XXkal.editShell.editForm.dayLabel.label:		Day:
XXkal.editShell.editForm.dayLabel.fromVert:	dowLabel
XXkal.editShell.editForm.dayText.fromHoriz:	dayLabel
XXkal.editShell.editForm.dayText.fromVert:	dowLabel
X
XXkal.editShell.editForm.monLabel.label:		Month:
XXkal.editShell.editForm.monLabel.fromVert:	dayLabel
XXkal.editShell.editForm.monText.fromHoriz:	monLabel
XXkal.editShell.editForm.monText.fromVert:	dayLabel
X
XXkal.editShell.editForm.yearLabel.label:	Year:
XXkal.editShell.editForm.yearLabel.fromVert:	monLabel
XXkal.editShell.editForm.yearText.fromHoriz:	yearLabel
XXkal.editShell.editForm.yearText.fromVert:	monLabel
X
XXkal.editShell.editForm.timeLabel.label:	Time:
XXkal.editShell.editForm.timeLabel.fromVert:	yearLabel
XXkal.editShell.editForm.timeText.fromHoriz:	timeLabel
XXkal.editShell.editForm.timeText.fromVert:	yearLabel
X
XXkal.editShell.editForm.textLabel.label:	Text:
XXkal.editShell.editForm.textLabel.fromVert:	timeLabel
XXkal.editShell.editForm.textText.fromHoriz:	textLabel
XXkal.editShell.editForm.textText.fromVert:	timeLabel
X
XXkal.editShell.editForm.levelLabel.label:	Level:
XXkal.editShell.editForm.levelLabel.fromVert:	textLabel
XXkal.editShell.editForm.levelText.fromHoriz:	levelLabel
XXkal.editShell.editForm.levelText.fromVert:	textLabel
X
X!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X!
X! The popup defaults editing panel.
X!
XXkal.defaultsShell.title:		Xkal Defaults Editor
X
XXkal.defaultsShell.defaultsForm.applyButton.label:	Apply
X
XXkal.defaultsShell.defaultsForm.revertButton.label:	Revert
XXkal.defaultsShell.defaultsForm.revertButton.fromHoriz:	applyButton
X
XXkal.defaultsShell.defaultsForm.dismissButton.label:	Dismiss
XXkal.defaultsShell.defaultsForm.dismissButton.fromHoriz:revertButton
X
XXkal.defaultsShell.defaultsForm.Label.borderWidth:	0
XXkal.defaultsShell.defaultsForm*Text*borderWidth:	0
XXkal.defaultsShell.defaultsForm*Text*editType:		edit
XXkal.defaultsShell.defaultsForm*Text*font:		fixed
XXkal.defaultsShell.defaultsForm*Text*width:		200
XXkal.defaultsShell.defaultsForm*Text*displayCaret:	False
XXkal.defaultsShell.defaultsForm*Text.scrollHorizontal:	whenNeeded
XXkal.defaultsShell.defaultsForm*Text*Scrollbar.thickness:5
X! Note that these translations use "xkal-focus-*-defaults-item()".
XXkal.defaultsShell.defaultsForm*Text*translations:#override\n\
X	<Enter>:		xkal-focus-this-item() \n\
X	<Leave>:		xkal-focus-no-item() \n\
X	<FocusIn>:		display-caret(True) \n\
X	<FocusOut>:		display-caret(False) \n\
X	None<Key>Return:	xkal-focus-next-defaults-item() \n\
X	Shift<Key>Return:	xkal-focus-prev-defaults-item() \n
X
XXkal.defaultsShell*personalAppointsLabel.label:		personalAppoints:
XXkal.defaultsShell*personalAppointsLabel.fromVert:	applyButton
XXkal.defaultsShell*personalAppointsText.fromHoriz:	personalAppointsLabel
XXkal.defaultsShell*personalAppointsText.fromVert:	applyButton
X
XXkal.defaultsShell*backupExtensionLabel.label:		backupExtension:
XXkal.defaultsShell*backupExtensionLabel.fromVert:	personalAppointsLabel
XXkal.defaultsShell*backupExtensionText.fromHoriz:	backupExtensionLabel
XXkal.defaultsShell*backupExtensionText.fromVert:	personalAppointsLabel
X
XXkal.defaultsShell*dateLabel.label:			date:
XXkal.defaultsShell*dateLabel.fromVert:			backupExtensionLabel
XXkal.defaultsShell*dateText.fromHoriz:			dateLabel
XXkal.defaultsShell*dateText.fromVert:			backupExtensionLabel
X
XXkal.defaultsShell*numMonthsLabel.label:		numMonths:
XXkal.defaultsShell*numMonthsLabel.fromVert:		dateLabel
XXkal.defaultsShell*numMonthsText.fromHoriz:		numMonthsLabel
XXkal.defaultsShell*numMonthsText.fromVert:		dateLabel
X
XXkal.defaultsShell*checkpointIntervalLabel.label:	checkpointInterval:
XXkal.defaultsShell*checkpointIntervalLabel.fromVert:	numMonthsLabel
XXkal.defaultsShell*checkpointIntervalText.fromHoriz:	checkpointIntervalLabel
XXkal.defaultsShell*checkpointIntervalText.fromVert:	numMonthsLabel
X
XXkal.defaultsShell*rearrangeSilentlyLabel.label:	rearrangeSilently:
XXkal.defaultsShell*rearrangeSilentlyLabel.fromVert:	checkpointIntervalLabel
XXkal.defaultsShell*rearrangeSilentlyText.fromHoriz:	rearrangeSilentlyLabel
XXkal.defaultsShell*rearrangeSilentlyText.fromVert:	checkpointIntervalLabel
X
XXkal.defaultsShell*defaultLevelLabel.label:		defaultLevel:
XXkal.defaultsShell*defaultLevelLabel.fromVert:		rearrangeSilentlyLabel
XXkal.defaultsShell*defaultLevelText.fromHoriz:		defaultLevelLabel
XXkal.defaultsShell*defaultLevelText.fromVert:		rearrangeSilentlyLabel
X
XXkal.defaultsShell*levelDelimLabel.label:		levelDelim:
XXkal.defaultsShell*levelDelimLabel.fromVert:		defaultLevelLabel
XXkal.defaultsShell*levelDelimText.fromHoriz:		levelDelimLabel
XXkal.defaultsShell*levelDelimText.fromVert:		defaultLevelLabel
X
X!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X!
X! The popup alert box, if you defined USE_ALERT.
X!
XXkal.popup.allowShellResize:		True
XXkal.popup.alert*resizable:		True
XXkal.popup.alert.okButton.label:	OK
END_OF_FILE
if test 23519 -ne `wc -c <'Xkal.ad'`; then
    echo shar: \"'Xkal.ad'\" unpacked with wrong size!
fi
# end of 'Xkal.ad'
fi
if test -f 'Xkal.ad.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Xkal.ad.h'\"
else
echo shar: Extracting \"'Xkal.ad.h'\" \(14977 characters\)
sed "s/^X//" >'Xkal.ad.h' <<'END_OF_FILE'
X"Xkal.revision:                  $Revision: 2.1 $",
X"Xkal.systemAppoints:		/u/ferguson/lib/xkal.appoints",
X"Xkal.personalAppoints:		~/.appoints",
X"Xkal.backupExtension:		~",
X"Xkal.outputFormat:		%w%~%d%~%m%~%y%~%t%~%l%~",
X"Xkal.listOnly:			False",
X"Xkal.silent:			False",
X"Xkal.exitUsesLevels:		False",
X"Xkal.version:			False",
X"Xkal.bothShown:			True",
X"Xkal.useTitlebar:		True",
X"Xkal.numMonths:			1",
X"Xkal.opaqueDates:		True",
X"Xkal.dowLabels:			False",
X"Xkal.checkpointInterval:	5",
X"Xkal.levelDelim:	@@",
X"Xkal.defaultLevel:	1",
X"Xkal.longDowStrings:	Sunday Monday Tuesday Wednesday Thursday Friday Saturday",
X"Xkal.shortDowStrings:	Sun Mon Tue Wed Thu Fri Sat",
X"Xkal.longMonthStrings:	January February March April May June \
X			July August September October November December",
X"Xkal.shortMonthStrings: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec",
X"Xkal.dowOffset:		0",
X"Xkal.daySlashMonth:	False",
X"Xkal.appsStartTime:	8:00",
X"Xkal.appsEndTime:	17:00",
X"Xkal.appsIncrement:	:30",
X"Xkal.appsUseAmPm:	False",
X"Xkal.numNotes:		2",
X"Xkal.notesLabel:	NOTES",
X"Xkal.noonStr:		Noon",
X"Xkal.midnightStr:	Midnight",
X"Xkal.rearrangeSilently:	False",
X"Xkal*allowShellResize:		True",
X"Xkal.bothForm.defaultDistance:	2",
X"Xkal.bothForm.fileButton.label:		File",
X"Xkal.bothForm.fileButton.menuName:	fileMenu",
X"Xkal.bothForm.fileMenu.menu:\
X	(item \"File\") \
X	(line) \
X	(item \"[S] Save\" (action \"xkal-save()\")) \
X	(item \"[Q] Quit\" (action \"xkal-quit()\")) \
X	(item \"[X] Exit\" (action \"xkal-exit()\"))",
X"Xkal.bothForm.viewButton.label:		View",
X"Xkal.bothForm.viewButton.fromHoriz:	fileButton",
X"Xkal.bothForm.viewButton.menuName:	viewMenu",
X"Xkal.bothForm.viewMenu.menu:\
X	(item \"View\") \
X	(line) \
X	(item \"[N] Next\" (action \"xkal-next()\")) \
X	(item \"[P] Prev\" (action \"xkal-prev()\")) \
X	(item \"[T] Today\" (action \"xkal-today()\")) \
X	(item \"[1] 1 Month\" (action \"xkal-numMonths(1)\")) \
X	(item \"[2] 2 Months\" (action \"xkal-numMonths(2)\")) \
X	(item \"[3] 3 Months\" (action \"xkal-numMonths(3)\")) \
X	(item \"[12] 12 Months\" (action \"xkal-numMonths(12)\"))",
X"Xkal.bothForm.otherButton.label:	Other",
X"Xkal.bothForm.otherButton.fromHoriz:	viewButton",
X"Xkal.bothForm.otherButton.menuName:	otherMenu",
X"Xkal.bothForm.otherMenu.menu:\
X	(item \"Other\") \
X	(line) \
X	(item \"[?] Help\" (action \"xkal-system(xterm -title 'Xkal Help' -e man xkal)\")) \
X	(item \"[E] Edit defaults\" (action \"xkal-edit-defaults()\"))",
X"Xkal.bothForm.allMonthsForm.fromVert:		fileButton",
X"Xkal.bothForm.allMonthsForm*defaultDistance:	0",
X"Xkal.bothForm.allMonthsForm*resizable:		True",
X"Xkal.bothForm.allMonthsForm*internalWidth:	1",
X"Xkal.bothForm.allMonthsForm*internalHeight:	1",
X"Xkal.bothForm.allMonthsForm*translations:#override\\n\
X	<Key>Q:		xkal-quit() \\n\
X	<Key>X:		xkal-exit() \\n\
X	<Key>N:		xkal-next() \\n\
X	<Key>P:		xkal-prev() \\n\
X	<Key>T:		xkal-today() \\n\
X	<Key>S:		xkal-save() \\n\
X	<Key>?:		xkal-system(\"xterm -title 'Xkal Help' -e man xkal\") \\n\
X	<Key>E:		xkal-edit-defaults() \\n\
X	<Key>1:		xkal-numMonths(1) \\n\
X	<Key>2:		xkal-numMonths(2) \\n\
X	<Key>3:		xkal-numMonths(3) \\n\
X	<Key>1,<Key>2:	xkal-numMonths(12) \\n",
X"Xkal.bothForm.allMonthsForm.monthForm1.fromHoriz:	NULL",
X"Xkal.bothForm.allMonthsForm.monthForm1.fromVert:	NULL",
X"Xkal.bothForm.allMonthsForm.monthForm2_1.fromHoriz:	NULL",
X"Xkal.bothForm.allMonthsForm.monthForm2_1.fromVert:	NULL",
X"Xkal.bothForm.allMonthsForm.monthForm2_2.fromVert:	monthForm2_1",
X"Xkal.bothForm.allMonthsForm.monthForm3_1.fromHoriz:	NULL",
X"Xkal.bothForm.allMonthsForm.monthForm3_1.fromVert:	NULL",
X"Xkal.bothForm.allMonthsForm.monthForm3_2.fromVert:	monthForm3_1",
X"Xkal.bothForm.allMonthsForm.monthForm3_3.fromVert:	monthForm3_2",
X"Xkal.bothForm.allMonthsForm.monthForm12_1.fromHoriz:	NULL",
X"Xkal.bothForm.allMonthsForm.monthForm12_1.fromVert:	NULL",
X"Xkal.bothForm.allMonthsForm.monthForm12_2.fromHoriz:	monthForm12_1",
X"Xkal.bothForm.allMonthsForm.monthForm12_3.fromHoriz:	monthForm12_2",
X"Xkal.bothForm.allMonthsForm.monthForm12_4.fromHoriz:	monthForm12_3",
X"Xkal.bothForm.allMonthsForm.monthForm12_5.fromVert:	monthForm12_1",
X"Xkal.bothForm.allMonthsForm.monthForm12_6.fromHoriz:	monthForm12_5",
X"Xkal.bothForm.allMonthsForm.monthForm12_6.fromVert:	monthForm12_2",
X"Xkal.bothForm.allMonthsForm.monthForm12_7.fromHoriz:	monthForm12_6",
X"Xkal.bothForm.allMonthsForm.monthForm12_7.fromVert:	monthForm12_3",
X"Xkal.bothForm.allMonthsForm.monthForm12_8.fromHoriz:	monthForm12_7",
X"Xkal.bothForm.allMonthsForm.monthForm12_8.fromVert:	monthForm12_4",
X"Xkal.bothForm.allMonthsForm.monthForm12_9.fromVert:	monthForm12_5",
X"Xkal.bothForm.allMonthsForm.monthForm12_10.fromHoriz:	monthForm12_9",
X"Xkal.bothForm.allMonthsForm.monthForm12_10.fromVert:	monthForm12_6",
X"Xkal.bothForm.allMonthsForm.monthForm12_11.fromHoriz:	monthForm12_10",
X"Xkal.bothForm.allMonthsForm.monthForm12_11.fromVert:	monthForm12_7",
X"Xkal.bothForm.allMonthsForm.monthForm12_12.fromHoriz:	monthForm12_11",
X"Xkal.bothForm.allMonthsForm.monthForm12_12.fromVert:	monthForm12_8",
X"Xkal*monthLabel1.font:		*fixed*bold*",
X"Xkal*monthLabel1.borderWidth:	0",
X"Xkal*monthLabel1.justify:	center",
X"Xkal*monthLabel1.width:		376",
X"Xkal*monthLabel1.resize:	False",
X"Xkal*monthLabel2.font:		6x9",
X"Xkal*monthLabel2.borderWidth:	0",
X"Xkal*monthLabel2.justify:	center",
X"Xkal*monthLabel2.width:		201",
X"Xkal*monthLabel2.resize:	False",
X"Xkal*monthLabel3.font:		6x9",
X"Xkal*monthLabel3.borderWidth:	0",
X"Xkal*monthLabel3.justify:	center",
X"Xkal*monthLabel3.width:		201",
X"Xkal*monthLabel3.resize:	False",
X"Xkal*monthLabel12.font:		5x8",
X"Xkal*monthLabel12.borderWidth:	0",
X"Xkal*monthLabel12.justify:	center",
X"Xkal*monthLabel12.width:	131",
X"Xkal*monthLabel12.resize:	False",
X"Xkal*dowLabel1.font:		*fixed*bold*",
X"Xkal*dowLabel1.borderWidth:	1",
X"Xkal*dowLabel1.width:		52",
X"Xkal*dowLabel1.resize:		False",
X"Xkal*dowLabel2.font:		6x9",
X"Xkal*dowLabel2.borderWidth:	1",
X"Xkal*dowLabel2.width:		27",
X"Xkal*dowLabel2.resize:		False",
X"Xkal*dowLabel3.font:		6x9",
X"Xkal*dowLabel3.borderWidth:	1",
X"Xkal*dowLabel3.width:		27",
X"Xkal*dowLabel3.resize:		False",
X"Xkal*dowLabel12.font:		5x8",
X"Xkal*dowLabel12.borderWidth:	1",
X"Xkal*dowLabel12.width:		17",
X"Xkal*dowLabel12.resize:		False",
X"Xkal.dateFont1:			*fixed*bold*",
X"Xkal.datePosition1:		+10+10",
X"Xkal.dateWidth1:		50",
X"Xkal.dateHeight1:		50",
X"Xkal.dateFont2:			6x9",
X"Xkal.datePosition2:		+0+6",
X"Xkal.dateWidth2:		25",
X"Xkal.dateHeight2:		25",
X"Xkal.dateFont3:			6x9",
X"Xkal.datePosition3:		+0+6",
X"Xkal.dateWidth3:		25",
X"Xkal.dateHeight3:		25",
X"Xkal.dateFont12:		5x8",
X"Xkal.datePosition12:		+0+6",
X"Xkal.dateWidth12:		15",
X"Xkal.dateHeight12:		15",
X"Xkal.noDayShade:	cross_weave",
X"Xkal.maxLevel:		7",
X"Xkal.shades:	gray3 gray3 light_gray light_gray gray gray flipped_gray",
X"Xkal.colors:	green green blue blue yellow yellow red",
X"Xkal.popupDayShell.title:				Xkal Day Window",
X"Xkal.popupDayShell.popupDayForm.defaultDistance:	2",
X"Xkal.popupDayShell.popupDayForm.dismissButton.label:	Dismiss",
X"Xkal.popupDayShell.popupDayForm.selectButton.label:	Select",
X"Xkal.popupDayShell.popupDayForm.selectButton.fromHoriz:	dismissButton",
X"Xkal.popupDayShell.popupDayForm.unselectButton.label:	Unselect",
X"Xkal.popupDayShell.popupDayForm.unselectButton.fromHoriz:selectButton",
X"Xkal.popupDayShell.popupDayForm.dayForm.fromVert:	dismissButton",
X"Xkal.popupDayShell.popupDayForm.dayForm.borderWidth:	0",
X"Xkal.bothForm.dayForm.fromHoriz:			allMonthsForm",
X"Xkal.bothForm.dayForm.fromVert:				fileButton",
X"Xkal.bothForm.dayForm.defaultDistance:			4",
X"Xkal*dayForm*dayLabel.justify:			center",
X"Xkal*dayForm*dayLabel.width:			230",
X"Xkal*dayForm*dayLabel.borderWidth:		0",
X"Xkal*dayForm*dayLabel.label:			Xkal 1.1",
X"Xkal*dayForm*appointLabel.font:			fixed",
X"Xkal*dayForm*appointLabel.borderWidth:		0",
X"Xkal*dayForm*appointLabel.vertDistance:		2",
X"Xkal*dayForm*appointLabel.translations:#override\\n\
X        <Btn1Up>(2):		xkal-edit-appoint() \\n",
X"Xkal*dayForm*appointText*font:			fixed",
X"Xkal*dayForm*appointText.width:			200",
X"Xkal*dayForm*appointText.height:		20",
X"Xkal*dayForm*appointText.vertDistance:		3",
X"Xkal*dayForm*appointText.borderWidth:		0",
X"Xkal*dayForm*appointText.topMargin:		0",
X"Xkal*dayForm*appointText*editType:		edit",
X"Xkal*dayForm*appointText*resize:		True",
X"Xkal*dayForm*appointText*displayCaret:		False",
X"Xkal*dayForm*appointText.scrollHorizontal:	whenNeeded",
X"Xkal*dayForm*appointText*Scrollbar.thickness:	5",
X"Xkal*dayForm*appointText.translations:#override\\n\
X	<Enter>:		xkal-focus-this-item() \\n\
X	<Leave>:		xkal-focus-no-item() \\n\
X	<FocusIn>:		display-caret(True) \\n\
X	<FocusOut>:		display-caret(False) \\n\
X        None<Key>Return:	xkal-focus-next-item() \\n\
X        Shift<Key>Return:	xkal-focus-prev-item() \\n\
X        <Btn1Up>(2):		xkal-edit-appoint() \\n",
X"Xkal.editShell.title:		Xkal Appointment Editor",
X"Xkal.editShell.editForm.applyButton.label:	Apply",
X"Xkal.editShell.editForm.revertButton.label:	Revert",
X"Xkal.editShell.editForm.revertButton.fromHoriz:	applyButton",
X"Xkal.editShell.editForm.deleteButton.label:	Delete",
X"Xkal.editShell.editForm.deleteButton.fromHoriz:	revertButton",
X"Xkal.editShell.editForm.dismissButton.label:	Dismiss",
X"Xkal.editShell.editForm.dismissButton.fromHoriz:deleteButton",
X"Xkal.editShell.editForm.Label.borderWidth:	0",
X"Xkal.editShell.editForm*Text*borderWidth:	0",
X"Xkal.editShell.editForm*Text*editType:		edit",
X"Xkal.editShell.editForm*Text*font:		fixed",
X"Xkal.editShell.editForm*Text*width:		200",
X"Xkal.editShell.editForm*Text*displayCaret:	False",
X"Xkal.editShell.editForm*Text.scrollHorizontal:	whenNeeded",
X"Xkal.editShell.editForm*Text*Scrollbar.thickness:5",
X"Xkal.editShell.editForm*Text*translations:#override\\n\
X	<Enter>:		xkal-focus-this-item() \\n\
X	<Leave>:		xkal-focus-no-item() \\n\
X	<FocusIn>:		display-caret(True) \\n\
X	<FocusOut>:		display-caret(False) \\n\
X        None<Key>Return:	xkal-focus-next-edit-item() \\n\
X        Shift<Key>Return:	xkal-focus-prev-edit-item() \\n",
X"Xkal.editShell.editForm.dowLabel.label:		Day-of-week:",
X"Xkal.editShell.editForm.dowLabel.fromVert:	applyButton",
X"Xkal.editShell.editForm.dowText.fromHoriz:	dowLabel",
X"Xkal.editShell.editForm.dowText.fromVert:	applyButton",
X"Xkal.editShell.editForm.dayLabel.label:		Day:",
X"Xkal.editShell.editForm.dayLabel.fromVert:	dowLabel",
X"Xkal.editShell.editForm.dayText.fromHoriz:	dayLabel",
X"Xkal.editShell.editForm.dayText.fromVert:	dowLabel",
X"Xkal.editShell.editForm.monLabel.label:		Month:",
X"Xkal.editShell.editForm.monLabel.fromVert:	dayLabel",
X"Xkal.editShell.editForm.monText.fromHoriz:	monLabel",
X"Xkal.editShell.editForm.monText.fromVert:	dayLabel",
X"Xkal.editShell.editForm.yearLabel.label:	Year:",
X"Xkal.editShell.editForm.yearLabel.fromVert:	monLabel",
X"Xkal.editShell.editForm.yearText.fromHoriz:	yearLabel",
X"Xkal.editShell.editForm.yearText.fromVert:	monLabel",
X"Xkal.editShell.editForm.timeLabel.label:	Time:",
X"Xkal.editShell.editForm.timeLabel.fromVert:	yearLabel",
X"Xkal.editShell.editForm.timeText.fromHoriz:	timeLabel",
X"Xkal.editShell.editForm.timeText.fromVert:	yearLabel",
X"Xkal.editShell.editForm.textLabel.label:	Text:",
X"Xkal.editShell.editForm.textLabel.fromVert:	timeLabel",
X"Xkal.editShell.editForm.textText.fromHoriz:	textLabel",
X"Xkal.editShell.editForm.textText.fromVert:	timeLabel",
X"Xkal.editShell.editForm.levelLabel.label:	Level:",
X"Xkal.editShell.editForm.levelLabel.fromVert:	textLabel",
X"Xkal.editShell.editForm.levelText.fromHoriz:	levelLabel",
X"Xkal.editShell.editForm.levelText.fromVert:	textLabel",
X"Xkal.defaultsShell.title:		Xkal Defaults Editor",
X"Xkal.defaultsShell.defaultsForm.applyButton.label:	Apply",
X"Xkal.defaultsShell.defaultsForm.revertButton.label:	Revert",
X"Xkal.defaultsShell.defaultsForm.revertButton.fromHoriz:	applyButton",
X"Xkal.defaultsShell.defaultsForm.dismissButton.label:	Dismiss",
X"Xkal.defaultsShell.defaultsForm.dismissButton.fromHoriz:revertButton",
X"Xkal.defaultsShell.defaultsForm.Label.borderWidth:	0",
X"Xkal.defaultsShell.defaultsForm*Text*borderWidth:	0",
X"Xkal.defaultsShell.defaultsForm*Text*editType:		edit",
X"Xkal.defaultsShell.defaultsForm*Text*font:		fixed",
X"Xkal.defaultsShell.defaultsForm*Text*width:		200",
X"Xkal.defaultsShell.defaultsForm*Text*displayCaret:	False",
X"Xkal.defaultsShell.defaultsForm*Text.scrollHorizontal:	whenNeeded",
X"Xkal.defaultsShell.defaultsForm*Text*Scrollbar.thickness:5",
X"Xkal.defaultsShell.defaultsForm*Text*translations:#override\\n\
X	<Enter>:		xkal-focus-this-item() \\n\
X	<Leave>:		xkal-focus-no-item() \\n\
X	<FocusIn>:		display-caret(True) \\n\
X	<FocusOut>:		display-caret(False) \\n\
X	None<Key>Return:	xkal-focus-next-defaults-item() \\n\
X	Shift<Key>Return:	xkal-focus-prev-defaults-item() \\n",
X"Xkal.defaultsShell*personalAppointsLabel.label:		personalAppoints:",
X"Xkal.defaultsShell*personalAppointsLabel.fromVert:	applyButton",
X"Xkal.defaultsShell*personalAppointsText.fromHoriz:	personalAppointsLabel",
X"Xkal.defaultsShell*personalAppointsText.fromVert:	applyButton",
X"Xkal.defaultsShell*backupExtensionLabel.label:		backupExtension:",
X"Xkal.defaultsShell*backupExtensionLabel.fromVert:	personalAppointsLabel",
X"Xkal.defaultsShell*backupExtensionText.fromHoriz:	backupExtensionLabel",
X"Xkal.defaultsShell*backupExtensionText.fromVert:	personalAppointsLabel",
X"Xkal.defaultsShell*dateLabel.label:			date:",
X"Xkal.defaultsShell*dateLabel.fromVert:			backupExtensionLabel",
X"Xkal.defaultsShell*dateText.fromHoriz:			dateLabel",
X"Xkal.defaultsShell*dateText.fromVert:			backupExtensionLabel",
X"Xkal.defaultsShell*numMonthsLabel.label:		numMonths:",
X"Xkal.defaultsShell*numMonthsLabel.fromVert:		dateLabel",
X"Xkal.defaultsShell*numMonthsText.fromHoriz:		numMonthsLabel",
X"Xkal.defaultsShell*numMonthsText.fromVert:		dateLabel",
X"Xkal.defaultsShell*checkpointIntervalLabel.label:	checkpointInterval:",
X"Xkal.defaultsShell*checkpointIntervalLabel.fromVert:	numMonthsLabel",
X"Xkal.defaultsShell*checkpointIntervalText.fromHoriz:	checkpointIntervalLabel",
X"Xkal.defaultsShell*checkpointIntervalText.fromVert:	numMonthsLabel",
X"Xkal.defaultsShell*rearrangeSilentlyLabel.label:	rearrangeSilently:",
X"Xkal.defaultsShell*rearrangeSilentlyLabel.fromVert:	checkpointIntervalLabel",
X"Xkal.defaultsShell*rearrangeSilentlyText.fromHoriz:	rearrangeSilentlyLabel",
X"Xkal.defaultsShell*rearrangeSilentlyText.fromVert:	checkpointIntervalLabel",
X"Xkal.defaultsShell*defaultLevelLabel.label:		defaultLevel:",
X"Xkal.defaultsShell*defaultLevelLabel.fromVert:		rearrangeSilentlyLabel",
X"Xkal.defaultsShell*defaultLevelText.fromHoriz:		defaultLevelLabel",
X"Xkal.defaultsShell*defaultLevelText.fromVert:		rearrangeSilentlyLabel",
X"Xkal.defaultsShell*levelDelimLabel.label:		levelDelim:",
X"Xkal.defaultsShell*levelDelimLabel.fromVert:		defaultLevelLabel",
X"Xkal.defaultsShell*levelDelimText.fromHoriz:		levelDelimLabel",
X"Xkal.defaultsShell*levelDelimText.fromVert:		defaultLevelLabel",
X"Xkal.popup.allowShellResize:		True",
X"Xkal.popup.alert*resizable:		True",
X"Xkal.popup.alert.okButton.label:	OK",
END_OF_FILE
if test 14977 -ne `wc -c <'Xkal.ad.h'`; then
    echo shar: \"'Xkal.ad.h'\" unpacked with wrong size!
fi
# end of 'Xkal.ad.h'
fi
if test -f 'day.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'day.c'\"
else
echo shar: Extracting \"'day.c'\" \(14611 characters\)
sed "s/^X//" >'day.c' <<'END_OF_FILE'
X/*
X *	day.c : The day windows that display a single day's appoints.
X *
X *	George Ferguson, ferguson@cs.rochester.edu, 27 Oct 1990.
X *	Version 1.1 - 27 Feb 1991.
X *
X *	$Id: day.c,v 2.2 91/03/13 13:31:09 ferguson Exp $
X */
X#include <stdio.h>
X#include <ctype.h>
X#include <X11/Intrinsic.h>
X#include <X11/Shell.h>
X#include <X11/StringDefs.h>
X#include <X11/Xaw/Form.h>
X#include <X11/Xaw/Command.h>
X#include <X11/Xaw/Label.h>
X#include <X11/Xaw/AsciiText.h>
X#include <X11/Xaw/Cardinals.h>
X#include "xkal.h"
X#include "month.h"
X#include "day.h"
X#include "db.h"
X#include "util.h"
X#include "date-strings.h"
X#include "app-resources.h"
X#include "patchlevel.h"
X#ifdef USE_ALERT
X#include "alert.h"
X#endif
X
X/*
X * Functions defined in this file
X */
XDayFormData *createDayFormData(),*createPopupDayFormData();
Xvoid setDayFormData();
Xvoid checkpointAppoints();
Xint timetopos();
Xvoid postotime();
X
Xstatic void textEventProc(),dismissProc(),selectProc(),unselectProc();
Xstatic char *skipLabel();
X
X/*
X * Data defined in this file
X */
XDayFormData *currentDayFormData;
Xint numDisplayedAppoints = -1;		/* total number of text widgets */
Xint displayStartTime;			/* time of earliest appoint (mins) */
Xint displayEndTime;			/* time of latest appoint (mins) */
Xint displayInc;				/* interval between appoints (mins) */
Xint displayFirstNotePos;		/* index of first notes entry */
X
Xstatic int dayAppointsChanged;		/* fast, local test for changes */
Xstatic Msgrec **apps;			/* used for lookupEntry() to set */
Xstatic int *appFlags;			/* used in setDayFormData() */
X
X#define CALLBACK_PROC(NAME)     static void NAME(w,client_data,call_data) \
X					Widget w; \
X					caddr_t client_data,call_data;
X
X
X/*	-	-	-	-	-	-	-	-	*/
X/* Creation routines */
X/*
X * createDayFormData() : Creates a new dayForm. The first time this
X *	routine is called, it sets several globals to prevent having
X *	to parse them from the resources every time. malloc()'s tons
X *	of space, for all the variable length stuff we allow.
X */
XDayFormData *
XcreateDayFormData(parent)
XWidget parent;
X{
X    DayFormData *d;
X    DayTextData *t;
X    Arg args[3];
X    int i,n;
X
X    if (numDisplayedAppoints == -1) {
X	displayStartTime = strtotime(appResources.appsStartTime);
X	displayEndTime = strtotime(appResources.appsEndTime);
X	displayInc = strtotime(appResources.appsIncrement);
X	displayFirstNotePos = (displayEndTime-displayStartTime)/displayInc+1;
X	numDisplayedAppoints = displayFirstNotePos+appResources.numNotes;
X	apps = (Msgrec **)XtCalloc(numDisplayedAppoints,sizeof(Msgrec *));
X	appFlags = (int *)XtCalloc(numDisplayedAppoints,sizeof(int));
X    }
X    d = XtNew(DayFormData);
X    d->form = XtCreateManagedWidget("dayForm",formWidgetClass,parent,
X								NULL,ZERO);
X    if (appResources.bothShown || !appResources.useTitlebar) {
X	d->date = XtCreateManagedWidget("dayLabel",labelWidgetClass,d->form,
X								NULL,ZERO);
X    } else {
X	d->date = NULL;
X    }
X    d->items = (DayTextData **)XtCalloc(numDisplayedAppoints,
X							sizeof(DayTextData));
X    i = 0;
X    XtSetArg(args[0],XtNfromVert,d->date);
X    for (n = displayStartTime; n <= displayEndTime; n += displayInc) {
X	t = d->items[i++] = XtNew(DayTextData);
X	XtSetArg(args[1],XtNfromHoriz,NULL);
X	XtSetArg(args[2],XtNlabel,timetostr(n));
X	t->time = XtCreateManagedWidget("appointLabel",labelWidgetClass,
X							d->form,args,THREE);
X	XtSetArg(args[1],XtNfromHoriz,t->time);
X	t->text = XtCreateManagedWidget("appointText",asciiTextWidgetClass,
X							d->form,args,TWO);
X	XtAddEventHandler(t->text,KeyPressMask|ButtonPressMask,False,
X							textEventProc,d);
X	XtSetArg(args[0],XtNfromVert,t->time);
X    }
X    for (n = 0; n < appResources.numNotes; n++) {
X	t = d->items[i++] = XtNew(DayTextData);
X	XtSetArg(args[1],XtNfromHoriz,NULL);
X	XtSetArg(args[2],XtNlabel,appResources.notesLabel);
X	t->time = XtCreateManagedWidget("appointLabel",labelWidgetClass,
X							d->form,args,THREE);
X	XtSetArg(args[1],XtNfromHoriz,t->time);
X	t->text = XtCreateManagedWidget("appointText",asciiTextWidgetClass,
X							d->form,args,TWO);
X	XtAddEventHandler(t->text,KeyPressMask|ButtonPressMask,False,
X							textEventProc,d);
X	XtSetArg(args[0],XtNfromVert,t->time);
X    }
X    d->shell = toplevel;	/* may be overridden */
X    d->msgText = (String *)XtCalloc(numDisplayedAppoints,sizeof(String));
X    d->msg = (Msgrec **)XtCalloc(numDisplayedAppoints,sizeof(Msgrec *));
X    d->changed = False;
X    d->editing = False;
X    return(d);
X}
X
X/*
X * createPopupDayFormData() : Creates a popup dayForm by wrapping one of
X *	the above dayForms in a shell and adding some buttons.
X */
XDayFormData *
XcreatePopupDayFormData()
X{
X    Widget shell,form,select,dismiss,unselect;
X    DayFormData *d;
X
X    shell = XtCreatePopupShell("popupDayShell",topLevelShellWidgetClass,
X							toplevel,NULL,ZERO);
X    form = XtCreateManagedWidget("popupDayForm",formWidgetClass,shell,
X								NULL,ZERO);
X    dismiss = XtCreateManagedWidget("dismissButton",commandWidgetClass,form,
X								NULL,ZERO);
X    select = XtCreateManagedWidget("selectButton",commandWidgetClass,form,
X								NULL,ZERO);
X    unselect = XtCreateManagedWidget("unselectButton",commandWidgetClass,form,
X								NULL,ZERO);
X    d = createDayFormData(form);
X    d->shell = shell;		/* override default */
X    XtAddCallback(select,"callback",selectProc,d);
X    XtAddCallback(dismiss,"callback",dismissProc,d);
X    XtAddCallback(unselect,"callback",unselectProc,d);
X    XtPopup(shell,XtGrabNone);
X    return(d);
X}
X
X/*	-	-	-	-	-	-	-	-	*/
X/* Event handlers */
X
X/*ARGSUSED*/
X/*
X * textEventProc() : Called whenever the user types in any slot. This
X *	provides a quick check as to whether the appoints have changed.
X *	Note that this does NOT detect, eg., selection pastes, as documented
X *	in the BUGS section of the man page.
X */
Xstatic void
XtextEventProc(w,client_data,event,continue_flag)
XWidget w;
XXtPointer client_data;
XXEvent *event;
XBoolean *continue_flag;
X{
X    DayFormData *d = (DayFormData *)client_data;
X
X    d->changed = True;
X}
X
X/*
X * dismissProc() : Callback for dismiss button - Destroy a dayForm unless
X *	one of it's appoints is being edited.
X */
X/*ARGSUSED*/
XCALLBACK_PROC(dismissProc)
X{
X    DayFormData *d = (DayFormData *)client_data;
X    int i;
X
X    if (d->editing) {
X	XBell(display,0);
X#ifdef USE_ALERT
X	alert("Error: Can't dimiss day while editing it.");
X#else
X	fprintf(stderr,"\007%s: can't dimiss day while editing it\n",program);
X#endif
X	return;
X    }
X    checkpointAppoints(d);
X    if (currentDayFormData == d)
X	currentDayFormData = NULL;
X    XtPopdown(d->shell);
X    XtDestroyWidget(d->shell);
X    for (i=0; i < numDisplayedAppoints; i++)
X	XtFree(d->msgText[i]);
X    XtFree(d->msgText);
X}
X
X/*
X * selectProc() : Callback for select button - Make this dayForm the
X *	current one, resensitizing its widgets.
X */
X/*ARGSUSED*/
XCALLBACK_PROC(selectProc)
X{
X    DayFormData *d = (DayFormData *)client_data;
X
X    checkpointAppoints(d);
X    if (currentDayFormData == d)
X	return;
X    if (currentDayFormData != NULL)
X	XtSetSensitive(currentDayFormData->form,False);
X    XtSetSensitive(d->form,True);
X    currentDayFormData = d;
X}
X
X/*
X * unselectProc() : Callback for unselect button - Desensitize this dayForm's
X *	widgets, and make there be no current dayForm.
X */
X/*ARGSUSED*/
XCALLBACK_PROC(unselectProc)
X{
X    DayFormData *d = (DayFormData *)client_data;
X
X    checkpointAppoints(d);
X    XtSetSensitive(d->form,False);
X    currentDayFormData = NULL;
X}
X
X/*	-	-	-	-	-	-	-	-	*/
X/* Set/reset routines */
X
X/*
X * clearDayFormData() : Clear all the text widgets (slots) and free the
X *	memory used to hold their (original) contents.
X */
Xvoid
XclearDayFormData(d)
XDayFormData *d;
X{
X    Arg args[1];
X    int i;
X
X    XtSetArg(args[0],XtNlabel,"");
X    if (d->date != NULL)
X	XtSetValues(d->date,args,ONE);
X    for (i=0; i < numDisplayedAppoints; i++) {
X	XtSetArg(args[0],XtNstring,"");
X	XtSetValues(d->items[i]->text,args,ONE);
X	XtFree(d->msgText[i]);
X	d->msgText[i] = NULL;
X    }
X}
X
X/*
X * setDayFormData() : Sets all the text widgets and the label and/or
X *	titlebar. Saves these texts in malloc()'d space so we can test
X *	later and see if they've changed. Looks after relabelling items
X *	that had to be moved due to collisions.
X */
Xvoid
XsetDayFormData(d,day,month,year)
XDayFormData *d;
Xint day,month,year;
X{
X    Arg args[2];
X    char text[32];
X    int dow,i,j,n,pos;
X    Boolean exact;
X
X    /*
X     * set the label at the top of the day
X     */
X    dow = computeDOW(day,month,year);
X    if (appResources.bothShown || !appResources.useTitlebar) {
X	sprintf(text,"%s %d %s %d",shortDowStr[dow-1],day,
X						shortMonthStr[month-1],year);
X	XtSetArg(args[0],XtNlabel,text);
X	XtSetValues(d->date,args,ONE);
X    }
X    if (appResources.useTitlebar) {
X	sprintf(text,"Xkal %.2f - %s %d %s %d",XKAL_VERSION,shortDowStr[dow-1],
X					day,shortMonthStr[month-1],year);
X	XStoreName(display,XtWindow(d->shell),text);
X    }
X    /*
X     * clear the saved text strings
X     */
X    for (i=0; i < numDisplayedAppoints; i++) {
X	XtFree(d->msgText[i]);
X	d->msgText[i] = NULL;
X	d->msg[i] = NULL;
X    }
X    /*
X     * get the appoints for today
X     */
X    n = lookupEntry(day,month,year,-1,-1,numDisplayedAppoints,apps,False);
X    if (n < 0) {
X#ifdef USE_ALERT
X	alert("Error: too many entries (>%d) for %s %d %s %d.",
X					numDisplayedAppoints,
X					shortDowStr[dow-1],day,
X					shortMonthStr[month-1],year);
X#else
X	fprintf(stderr,"\007%s: too many entries (>%d) for %s %d %s %d\n",
X					program,numDisplayedAppoints,
X					shortDowStr[dow-1],day,
X					shortMonthStr[month-1],year);
X#endif
X	n = numDisplayedAppoints;
X    }
X    for (i=0; i < n; i++)
X	appFlags[i] = False;
X    /*
X     * set the msgText[]'s for any appoints without conflicts
X     */
X    for (i=0; i < n; i++) {
X	pos = timetopos(apps[i]->hour,apps[i]->mins,&exact);
X	/*
X	 * skip appoints that need to be labelled no matter what
X	 */
X	if (!exact)
X	    continue;
X	/*
X	 * no conflict -> save string and set flag to say it's done
X	 */
X	if (d->msgText[pos] == NULL) {
X	    d->msgText[pos] = XtNewString(apps[i]->text);
X	    d->msg[pos] = apps[i];
X	    appFlags[i] = True;
X	}
X    }
X    /*
X     * move appoints that had conflicts
X     */
X    for (i=0; i < n; i++) {
X	if (!appFlags[i]) {
X	    pos = timetopos(apps[i]->hour,apps[i]->mins,&exact);
X	    /*
X	     * pos can actually be open if we skipped it above
X	     */
X	    if (d->msgText[pos] == NULL) {
X		j = pos;
X	    } else {
X		/*
X	 	 * scan up for empty slot
X	 	 */
X	 	for (j=pos+1; j < numDisplayedAppoints; j++)
X		    if (d->msgText[j] == NULL)
X			break;
X		/*
X		 * scan down if still not placed
X	 	 */
X		if (j == numDisplayedAppoints) {
X		    for (j=pos-1; j >= 0; j--)
X			if (d->msgText[j] == NULL)
X			    break;
X		}
X	    }
X	    /*
X	     * now figure out how to label it and save the new string
X	     */
X	    if (!appResources.rearrangeSilently || !exact) {
X	        if (apps[i]->hour == -1) {
X		    if (j < displayFirstNotePos) {
X			/*
X			 * was note, now not in notes -> label
X			 */
X			d->msgText[j] = XtMalloc(strlen(apps[i]->text)+
X					strlen(appResources.notesLabel)+1);
X			sprintf(d->msgText[j],"[%s] %s",appResources.notesLabel,
X								apps[i]->text);
X		    } else {
X			/*
X			 * was note, still in notes -> no label
X			 */
X			d->msgText[j] = XtNewString(apps[i]->text);
X		    }
X		} else {
X		    /*
X		     * non-note -> label
X		     */
X		    d->msgText[j] = XtMalloc(strlen(apps[i]->text)+9);
X		    sprintf(d->msgText[j],"[%s] %s",
X				timetostr(apps[i]->hour*60+apps[i]->mins),
X				apps[i]->text);
X		}
X	    } else {
X		/*
X		 * user requested no labels
X		 */
X		d->msgText[j] = XtNewString(apps[i]->text);
X	    }
X	    d->msg[j] = apps[i];
X	}
X    }
X    /*
X     * set/clear the actual widgets
X     */
X    for (i=0; i < numDisplayedAppoints; i++) {
X	if (d->msgText[i])
X	    XtSetArg(args[0],XtNstring,d->msgText[i]);
X	else
X	    XtSetArg(args[0],XtNstring,"");
X	if (d->msg[i] && d->msg[i]->system)
X	    XtSetArg(args[1],XtNeditType,XawtextRead);
X	else
X	    XtSetArg(args[1],XtNeditType,XawtextEdit);
X	XtSetValues(d->items[i]->text,args,TWO);
X    }
X    d->day = day;
X    d->month = month;
X    d->year = year;
X}
X
X/*
X * checkpointAppoints() : Transfers the appoints from the text widgets
X *	to the DB, adding or deleting entries as required. Looks after
X *	parsing back the labelling that was possibly added above.
X */
Xvoid
XcheckpointAppoints(d)
XDayFormData *d;
X{
X    Arg args[2];
X    int i,type,h,m,n;
X    char *new,c;
X
X    if (!d->changed)
X	return;
X    XtSetArg(args[0],XtNeditType,&type);
X    XtSetArg(args[1],XtNstring,&new);
X    for (i=0; i < numDisplayedAppoints; i++) {
X	XtGetValues(d->items[i]->text,args,TWO);
X	if (type == XawtextRead)
X	    continue;
X	if (d->msgText[i] && strcmp(d->msgText[i],new) != 0) {
X	    deleteEntry(0,d->year,d->month,d->day,d->msg[i]->hour,
X					d->msg[i]->mins,d->msg[i]->text);
X	    d->msg[i] = NULL;
X	    appointsChanged = True;
X	}
X	if (*new != '\0' && (!d->msgText[i] ||
X				strcmp(d->msgText[i],new) != 0)) {
X	    if (*new == '[') {
X		n = strtotime(new+1);
X		if (n == -1) {
X		    h = m = -1;		/* and leave trash in text */
X		} else {
X		    h = n / 60;
X		    m = n % 60;
X		    new = skipLabel(new);
X		}
X	    } else {
X		postotime(i,&h,&m);
X	    }
X	    d->msg[i] = addEntry(0,d->year,d->month,d->day,h,m,new,False,
X						appResources.defaultLevel);
X	    XtFree(d->msgText[i]);
X	    d->msgText[i] = XtNewString(new);
X	    appointsChanged = True;
X	}
X    }
X    d->changed = False;
X    if (currentDayFormData != NULL)
X	shadeButton(currentDayFormData->buttonData,(GC)NULL,0,0);
X}
X
X/*
X * skipLabels() : Skip over "[...]" in a string.
X */
Xstatic char *
XskipLabel(s)
Xchar *s;
X{
X    if (*s != '[')
X	return(s);
X    while (*s != ']')
X	s += 1;
X    s += 1;
X    while (*s && isspace(*s))
X	s += 1;
X    return(s);
X}
X
X/*	-	-	-	-	-	-	-	-	*/
X/* Various conversion routines (see also util.c) */
X
X/*
X * timetopos(h,m,exactp) : Returns the appropriate place in the DayForm for
X *	the given time. *exactp is set to True if this is exact, False if it
X *	has been rounded (and hence if the appoint should be labelled).
X */
Xint
Xtimetopos(h,m,exactp)
Xint h,m;
XBoolean *exactp;
X{
X    int t;
X
X    if (h == -1) {
X	*exactp = True;
X	return(displayFirstNotePos);
X    }
X    if (m != -1)
X	t = h * 60 + m;
X    else
X	t = h * 60;
X    if (t < displayStartTime || t > displayEndTime) {
X	*exactp = False;
X	return(displayFirstNotePos);
X    } else {
X	*exactp = (t % displayInc == 0);
X	return((t-displayStartTime)/displayInc);
X    }
X}
X
X/*
X * postotime(p,h,m) : Sets *h and *m to a time corresponding to the position
X *	given by p.
X */
Xvoid
Xpostotime(p,h,m)
Xint p;
Xint *h,*m;
X{
X    int t;
X
X    if (p >= displayFirstNotePos) {
X	*h = *m = -1;
X    } else {
X	t = displayStartTime + p * displayInc;
X	*h = t / 60;
X	*m = t % 60;
X    }
X}
X
END_OF_FILE
if test 14611 -ne `wc -c <'day.c'`; then
    echo shar: \"'day.c'\" unpacked with wrong size!
fi
# end of 'day.c'
fi
echo shar: End of archive 2 \(of 5\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 3 4 5 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 5 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

-- 
George Ferguson			ARPA: ferguson@cs.rochester.edu
University of Rochester		UUCP: {decvax,rutgers}!rochester!ferguson
Rochester  NY  14627-0226	VOX:  (716) 275-2527