v05i020: Xtartan -- generate a Socttish tartan as background, Part01/01

Dan Heller argv at island.uu.net
Thu Nov 9 07:25:57 AEST 1989


Submitted-by: sci!jimmc at decwrl.dec.com
Posting-number: Volume 5, Issue 20
Archive-name: xtartan/part01



#! /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".  If this archive is complete, you will
##  see the following message at the end:
#		"End of shell archive."
# Contents:  README Imakefile Makefile xtartan.man TIBarclay.h
#   TIBlackW.h TIBrodie.h TIBruce.h TIBuchanan.h TICameron.h
#   TICampbell.h TIChisholm.h TIDuncan.h TIElliot.h TIErskine.h
#   TIFarq.h TIGow.h TIMacArthr.h TIMacAulay.h TIMacBean.h TIMacBeth.h
#   TIMacDuff.h TIMacIver.h TIRainbow1.h TIRainbow2.h TIRobRoy.h
#   TIShepherd.h TIShirt1.h TIStewart.h TIUrquhart.h TIUsa.h
#   TIWallace.h alltartans.h patchlevel.h tartaninfo.h tartcursor.h
#   xtartan.h actions.c color.c draw.c main.c misc.c setrootbg.c
# Wrapped by jimmc at zax on Mon Nov  6 11:45:34 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f README -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"README\"
else
echo shar: Extracting \"README\" \(317 characters\)
sed "s/^X//" >README <<'END_OF_README'
XXtartan is a program to generate a Socttish tartan as a background pixmap
Xfor the root or a new window.  It has been set up to be easy to add new
Xtartans or to puruse the existing tartans.
X
XXtartan is not copyrighted, so you can freely redistribute and modify it.
X
X-Jim McBeath    25.Oct.89
X sci!jimmc at decwrl.dec.com
END_OF_README
if test 317 -ne `wc -c <README`; then
    echo shar: \"README\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f Imakefile -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"Imakefile\"
else
echo shar: Extracting \"Imakefile\" \(190 characters\)
sed "s/^X//" >Imakefile <<'END_OF_Imakefile'
XLOCAL_LIBRARIES = 
X  SYS_LIBRARIES = -lXt -lX11
X
Xall:: xtartan
X
Xalltartansh:;   ls -1 TI*.h | sed -e 's/.*/#include "&"/' > alltartans.h
X
Xdepend::	alltartansh
X
XSimpleProgramTarget(xtartan)
X
END_OF_Imakefile
if test 190 -ne `wc -c <Imakefile`; then
    echo shar: \"Imakefile\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f Makefile -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"Makefile\"
else
echo shar: Extracting \"Makefile\" \(7980 characters\)
sed "s/^X//" >Makefile <<'END_OF_Makefile'
X# Makefile generated by imake - do not edit!
X# $XConsortium: imake.c,v 1.37 88/10/08 20:08: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# X Window System Makefile generated from template file Imake.tmpl
X# $XConsortium: Imake.tmpl,v 1.91 88/10/23 22:37:10 jim Exp $
X#
X# Do not change the body of the imake template file.  Server-specific
X# parameters may be set in the appropriate .macros file; site-specific
X# parameters (but shared by all servers) may be set in site.def.  If you
X# make any changes, you'll need to rebuild the makefiles using
X# "make World" (at best) or "make Makefile; make Makefiles" (at least) in
X# the top level directory.
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.macros to change
X
X# platform:  $XConsortium: Sun.macros,v 1.52 88/10/23 11:00:55 jim Exp $
X# operating system:   SunOS 3.4
X
XBOOTSTRAPCFLAGS =
X             AS = as
X             CC = cc
X            CPP = /lib/cpp
X             LD = ld
X           LINT = lint
X        INSTALL = install
X           TAGS = ctags
X             RM = rm -f
X             MV = mv
X             LN = ln -s
X         RANLIB = ranlib
XRANLIBINSTFLAGS = -t
X             AR = ar clq
X             LS = ls
X       LINTOPTS = -axz
X    LINTLIBFLAG = -C
X           MAKE = make
XSTD_CPP_DEFINES =
X    STD_DEFINES =
X
X###########################################################################
X# site-specific configuration parameters - edit site.def to change
X
X# site:  $XConsortium: site.def,v 1.16 88/10/12 10:30:24 jim Exp $
X
X###########################################################################
X# definitions common to all Makefiles - do not edit
X
X          SHELL =  /bin/sh
X
X        DESTDIR = /u8/X/X11R3
X      USRLIBDIR = $(DESTDIR)/usr/lib
X         BINDIR = $(DESTDIR)/usr/bin/X11
X         INCDIR = $(DESTDIR)/usr/include/X11
X         ADMDIR = $(DESTDIR)/usr/adm
X         LIBDIR = $(USRLIBDIR)/X11
X     LINTLIBDIR = $(USRLIBDIR)/lint
X        FONTDIR = $(LIBDIR)/fonts
X       XINITDIR = $(LIBDIR)/xinit
X         XDMDIR = $(LIBDIR)/xdm
X         UWMDIR = $(LIBDIR)/uwm
X         AWMDIR = $(LIBDIR)/awm
X         TWMDIR = $(LIBDIR)/twm
X        MANPATH = $(DESTDIR)/usr/man
X  MANSOURCEPATH = $(MANPATH)/man
X         MANDIR = $(MANSOURCEPATH)n
X      LIBMANDIR = $(MANSOURCEPATH)3
X    XAPPLOADDIR = $(LIBDIR)/app-defaults
X
X   INSTBINFLAGS = -m 0755
X   INSTUIDFLAGS = -m 4755
X   INSTLIBFLAGS = -m 0664
X   INSTINCFLAGS = -m 0444
X   INSTMANFLAGS = -m 0444
X   INSTAPPFLAGS = -m 0444
X  INSTKMEMFLAGS = -m 4755
X        FCFLAGS = -t
X    CDEBUGFLAGS = -g
X
X        PATHSEP = /
X         DEPEND = $(DEPENDSRC)/makedepend
X          IMAKE = $(IMAKESRC)/imake
X            RGB = $(RGBSRC)/rgb
X             FC = $(BDFTOSNFSRC)/bdftosnf
X      MKFONTDIR = $(MKFONTDIRSRC)/mkfontdir
X      MKDIRHIER = $(SCRIPTSSRC)/mkdirhier.sh
X
X         CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES) $(DEFINES)
X      LINTFLAGS = $(LINTOPTS) $(INCLUDES) $(STD_DEFINES) $(DEFINES) -DLINT
X        LDFLAGS = $(CDEBUGFLAGS) $(SYS_LIBRARIES) $(SYSAUX_LIBRARIES)
X            TOP = /u8/X/X11R3/core.src
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     SCRIPTSSRC = $(UTILSRC)/scripts
X     EXAMPLESRC = $(TOP)/examples
X     CONTRIBSRC = $(TOP)/contrib
X         DOCSRC = $(TOP)/doc
X         RGBSRC = $(TOP)/rgb
X      DEPENDSRC = $(UTILSRC)/makedepend
X       IMAKESRC = $(UTILSRC)/imake
X       IRULESRC = $(UTILSRC)/imake.includes
X        XLIBSRC = $(LIBSRC)/X
X         XMUSRC = $(LIBSRC)/Xmu
X     TOOLKITSRC = $(LIBSRC)/Xt
X     AWIDGETSRC = $(LIBSRC)/Xaw
X     OLDXLIBSRC = $(LIBSRC)/oldX
X    BDFTOSNFSRC = $(FONTSRC)/bdftosnf
X   MKFONTDIRSRC = $(FONTSRC)/mkfontdir
X   EXTENSIONSRC = $(TOP)/extensions
X   EXTENSIONLIB = $(EXTENSIONSRC)/lib/libXext.a
X           XLIB = $(XLIBSRC)/libX11.a
X         XMULIB = $(XMUSRC)/libXmu.a
X        OLDXLIB = $(OLDXLIBSRC)/liboldX.a
X       XTOOLLIB = $(TOOLKITSRC)/libXt.a
X         XAWLIB = $(AWIDGETSRC)/libXaw.a
X       LINTXLIB = $(XLIBSRC)/llib-lX11.ln
X        LINTXMU = $(XMUSRC)/llib-lXmu.ln
X      LINTXTOOL = $(TOOLKITSRC)/llib-lXt.ln
X        LINTXAW = $(AWIDGETSRC)/llib-lXaw.ln
X       INCLUDES = -I$(TOP)
X      MACROFILE = Sun.macros
X   ICONFIGFILES = $(IRULESRC)/Imake.tmpl \
X			$(IRULESRC)/$(MACROFILE) $(IRULESRC)/site.def
X  IMAKE_DEFINES =
X      IMAKE_CMD = $(NEWTOP)$(IMAKE) -TImake.tmpl -I$(NEWTOP)$(IRULESRC) \
X			-s Makefile $(IMAKE_DEFINES)
X         RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \
X			.emacs_* tags TAGS make.log MakeOut
X
X###########################################################################
X# rules:  $XConsortium: Imake.rules,v 1.71 88/10/23 22:46:34 jim Exp $
X
X###########################################################################
X# start of Imakefile
X
XLOCAL_LIBRARIES = 
X  SYS_LIBRARIES = -lXt -lX11
X
X OBJS = actions.o \
X	color.o \
X	draw.o \
X	main.o \
X	misc.o \
X	setrootbg.o
X SRCS = actions.c \
X	color.c \
X	draw.c \
X	main.c \
X	misc.c \
X	setrootbg.c
X
Xall:: xtartan
X
Xalltartansh:;   ls -1 TI*.h | sed -e 's/.*/#include "&"/' > alltartans.h
X
Xdepend::        alltartansh
X
X PROGRAM = xtartan
X
Xall:: xtartan
X
Xxtartan: $(OBJS) $(LOCAL_LIBRARIES)
X	$(RM) $@
X	$(CC) -o $@ $(OBJS) $(LOCAL_LIBRARIES) $(LDFLAGS) $(SYSLAST_LIBRARIES)
X
Xrelink::
X	$(RM) $(PROGRAM)
X	$(MAKE) $(MFLAGS) $(PROGRAM)
X
Xinstall:: xtartan
X	$(INSTALL) -c $(INSTALLFLAGS) xtartan $(BINDIR)
X
Xinstall.man:: xtartan.man
X	$(INSTALL) -c $(INSTMANFLAGS) xtartan.man $(MANDIR)/xtartan.n
X
Xdepend:: $(DEPEND)
X
Xdepend::
X	$(DEPEND) -s "# DO NOT DELETE" -- $(CFLAGS) -- $(SRCS)
X
X$(DEPEND):
X	@echo "making $@"; \
X	cd $(DEPENDSRC); $(MAKE)
X
Xclean::
X	$(RM) $(PROGRAM)
X
X###########################################################################
X# Imake.tmpl common rules for all Makefiles - do not edit
X
Xemptyrule::
X
Xclean::
X	$(RM_CMD) \#*
X
XMakefile:: $(IMAKE)
X
XMakefile:: Imakefile \
X	$(IRULESRC)/Imake.tmpl \
X	$(IRULESRC)/Imake.rules \
X	$(IRULESRC)/site.def \
X	$(IRULESRC)/$(MACROFILE)
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)
X
X$(IMAKE):
X	@echo "making $@"; \
X	cd $(IMAKESRC); $(MAKE) BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS)
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 done"
X
Xinstall.man::
X	@echo "install.man done"
X
XMakefiles::
X
X###########################################################################
X# dependencies generated by makedepend
X
X# DO NOT DELETE
X
Xcolor.o: xtartan.h tartaninfo.h \
X		/usr/include/X11/Intrinsic.h /usr/include/X11/Xlib.h
Xdraw.o: xtartan.h tartaninfo.h alltartans.h \
X		/usr/include/X11/Intrinsic.h /usr/include/X11/Xlib.h
Xmain.o: xtartan.h tartaninfo.h tartcursor.h \
X		/usr/include/X11/Intrinsic.h /usr/include/X11/Xlib.h \
X		/usr/include/X11/Xatom.h /usr/include/X11/StringDefs.h
Xmisc.o: xtartan.h tartaninfo.h \
X		/usr/include/X11/Intrinsic.h /usr/include/X11/Xlib.h
Xsetrootbg.o: xtartan.h \
X		/usr/include/X11/Intrinsic.h /usr/include/X11/Xlib.h \
X		/usr/include/X11/Xatom.h
END_OF_Makefile
if test 7980 -ne `wc -c <Makefile`; then
    echo shar: \"Makefile\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f xtartan.man -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"xtartan.man\"
else
echo shar: Extracting \"xtartan.man\" \(5978 characters\)
sed "s/^X//" >xtartan.man <<'END_OF_xtartan.man'
X.TH XTARTAN 1 "25 October 1989" "X Version 11"
X
X.SH NAME
Xxtartan \- draw various tartans as window backgrounds
X
X.SH SYNOPSIS
X.B xtartan
X[-draw] [-list] [-print] [-version]
X[-r] [-s scale] [-t tartanname] [-w linewidth] [-x "fromcolor tocolor"]
X
X.SH DESCRIPTION
X.I Xtartan
Xgenerates a pixmap containing a Scottish tartan and sets it as the background
Xof a new window (or the root window if -r is used).
X
X.SH OPTIONS
X.TP
X.B -draw
XDraw the tartan as a window background (the default action).
X.TP
X.B -list
XPrint out a list of all of the available tartans.
X.TP
X.B -print
XPrint out the color and stripe size information about the specified tartan.
X.TP
X.B -version
XPrint out the version number of the xtartan program.
X.TP
X.B -r
XDisplay on the root window instead of creating a new window.
X.TP
X.B -s
XScale up the width of the stripes in the tartan by the specified integer
X(default 2).
X.TP
X.B -w
XScale up with width of the lines drawn by the specified integer.
X.TP
X.B -t
XUse the specified tartan.
XIf not specified, the MacBeth tartan is used.
X.TP
X.B -x
XTranslate colors in the tartan from "fromcolor" to "tocolor".
XYou can specify multiple color pairs.
XNote that all of the color names are a single string, so you will have
Xto use quoting from your shell.
XThe colors must match the colors as defined in the tartan;
Xthese can be printed out using the -print command line option.
XThe -x switch allows you to view tartans in modified colors.
X.TP
X.B "Xt switches"
XIn addition to the above switches, any of the standard top-level switches
Xfor the Xt toolkit can be specified (such as -display).
X
X.SH RESOURCES
X.LP
XIn addition to standard Xt toolkit resources, xtartan looks for the following:
X.TP
X.B action
XType String, class Action.
XSpecifies the action to take; one of "draw", "print", "list", or "version".
XSetting the action to one of these is equivalent to specifying the command
Xline options of the same name.
X.TP
X.B colorTranslations
XType String, class ColorTranslations.
XSpecifies color name pairs to do translations on.
XEquivalent to the "-x" command line option.
X.TP
X.B lineWidth
XType Int, class LineWidth.
XSpecifies the line width factor.
XEquivalent to the "-w" command line option.
X.TP
X.B scale
XType Int, class Scale.
XSpecifies the scale factor.
XEquivalent to the "-s" command line option.
X.TP
X.B tartan
XType String, class Tartan.
XSpecifies the name of the tartan to use.
XEquivalent to the "-t" command line option.
X.TP
X.B useRoot
XType Boolean, class UseRoot.
XIf true, set the background of the root window instead of
Xopening a new window.
XEquivalent to the "-r" command line option.
X
X.SH INTERACTIVE OPTIONS
X.LP
XWhile xtartan is running, you can change tartans, scale, and linewidth by
Xentering keyboard command characters (except when -r is used).
XThe actions defined in xtartan are listed below, followed by the
Xdefault translation bindings.
X.TP
X.B "exit()"
XCauses xtartan to exit.
X.TP
X.B "help()"
XPrints out a list of what the standard translation binding do.
X.TP
X.B "info()"
XPrints out the current tartan name, scale, and line width.
X.TP
X.B "lineWidth(new)"
XChanges the line width multiplier.
XThe argument is a numeric string optionally preceded by a "+" or
X"-" character.
XIf there is no sign character, then the new number is used directly as
Xthe new line width.
XIf there is a leading sign, then the new number is either added or
Xsubtracted from the current value, and the result is used as the new
Xline width.
X.TP
X.B "name()"
XPrints out the name of the current tartan.
X.TP
X.B "next()"
XSwitches the current tartan to the next in the list.
X.TP
X.B "previous()"
XSwitches the current tartan to the previous in the list.
X.TP
X.B "scale(new)"
XChanges the scale multiplier.
XThe argument is a numeric string and is interpreted in the same
Xwas as for the lineWidth action.
X
X.LP
XThe standard translation bindings are:
X.br
X.DS
XCtrl<Key>C : exit()\\n\\
X   :<Key>? : help()\\n\\
X   :<Key>h : help()\\n\\
X   :<Key>n : next()\\n\\
X   :<Key>N : next() name()\\n\\
X   :<Key>p : previous()\\n\\
X   :<Key>P : previous() name()\\n\\
X   :<Key>q : exit()\\n\\
X   :<Key>t : info()\\n\\
X   :<Key>* : scale(+1)\\n\\
X   :<Key>/ : scale(-1)\\n\\
X   :<Key>+ : lineWidth(+1)\\n\\
X   :<Key>- : lineWidth(-1)\\n\\
X   :<Key>= : scale() lineWidth()
X.DE
X
X.SH ADDING TARTANS
X.LP
XIf you have the source to xtartan, it is very easy to add more tartans.
XEach tartan is defined in an include file by the name of TIxxx.h,
Xwhere xxx is the name of the tartan (possibly abbreviated).
XThe format of the include file is defined in the file tartaninfo.h.
XLook at the file TIMacBeth.h to see what the exact format of a TIxxx.h
Xfile should be, then create your TIxxx.h file in that format.
X.LP
XAfter making the new TIxxx.h file (or copying in a new one from elsewhere),
Xsimply do a 'make depend'.
XThis will recreate the file alltartans.h, which lists all of the TIxxx.h
Xfiles.
XDoing a 'make' after this will rebuild xtartan with the new tartan information.
X
X.SH BUGS
X.LP
XWhen using line widths greater than one, there are often alignment problems
Xwhen abutting the tartan tiles, and you can see a line delimiting the
Xedge of the background pixmap where the tartan lines do not match properly.
X.sp
XStrange patterns can be caused by using line widths which are large
Xcompared to the width of the color stripes in the tartan.
X.sp
XYou must specify a height and width resource (such as "xtartan*width:300")
Xin your resource file or the toolkit will exit with an error about a
Xzero width or height window.
X.sp
XNot all of the "tartans" are actual tartans; some are random patterns to
Xtest out the various drawing capabilities of the program.
X.sp
XIt should be possible to read tartan information at run-time from a file,
Xas can be done with bitmaps.
X
X.SH COPYRIGHT
XThis software is not copyrighted.
XXtartan has not been sanctioned by any Scottish authority;
Xno guarantee is placed on the accuracy of the tartans it produces.
X
X.SH AUTHOR
XJim McBeath
X.br
XSilicon Compiler Systems, San Jose, California
X.br
Xsci!jimmc at decwrl.dec.com
END_OF_xtartan.man
if test 5978 -ne `wc -c <xtartan.man`; then
    echo shar: \"xtartan.man\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIBarclay.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIBarclay.h\"
else
echo shar: Extracting \"TIBarclay.h\" \(183 characters\)
sed "s/^X//" >TIBarclay.h <<'END_OF_TIBarclay.h'
X/* Barclay tartan
X */
X{
X	"Barclay",
X	"Black",
X	{ SYM,
X		{ "White", 2, 0 },
X		{ "Yellow", 12, 0 },
X		{ "Black", 12, 0 },
X		{ "Yellow", 2, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIBarclay.h
if test 183 -ne `wc -c <TIBarclay.h`; then
    echo shar: \"TIBarclay.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIBlackW.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIBlackW.h\"
else
echo shar: Extracting \"TIBlackW.h\" \(546 characters\)
sed "s/^X//" >TIBlackW.h <<'END_OF_TIBlackW.h'
X/* Black Watch tartan
X */
X{
X	"Black_Watch",
X	"Black",
X	{ SYM,
X		{ "Black", 2, 0 },
X		{ "MediumSeaGreen", 10, 0 },
X		{ "Black", 8, 0 },
X		{ "Navy", 4, 0 },
X		{ "Black", 1, 0 },
X		{ "Navy", 1, 0 },
X		{ "Black", 1, 0 },
X		{ "Navy", 7, 0 },
X		{ "Black", 1, 0 },
X		{ "Navy", 1, 0 },
X		{ "Black", 1, 0 },
X		{ "Navy", 4, 0 },
X		{ "Black", 8, 0 },
X		{ "MediumSeaGreen", 10, 0 },
X		{ "Black", 2, 0 },
X		{ "MediumSeaGreen", 10, 0 },
X		{ "Black", 8, 0 },
X		{ "Navy", 9, 0 },
X		{ "Black", 1, 0 },
X		{ "Navy", 1, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIBlackW.h
if test 546 -ne `wc -c <TIBlackW.h`; then
    echo shar: \"TIBlackW.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIBrodie.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIBrodie.h\"
else
echo shar: Extracting \"TIBrodie.h\" \(215 characters\)
sed "s/^X//" >TIBrodie.h <<'END_OF_TIBrodie.h'
X/* Brodie tartan
X */
X{
X	"Brodie",
X	"Red",
X	{ SYM,
X		{ "Black", 2, 0 },
X		{ "Red", 14, 0 },
X		{ "Black", 6, 0 },
X		{ "Yellow", 2, 0 },
X		{ "Black", 6, 0 },
X		{ "Red", 2, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIBrodie.h
if test 215 -ne `wc -c <TIBrodie.h`; then
    echo shar: \"TIBrodie.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIBruce.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIBruce.h\"
else
echo shar: Extracting \"TIBruce.h\" \(223 characters\)
sed "s/^X//" >TIBruce.h <<'END_OF_TIBruce.h'
X/* Bruce tartan
X */
X{
X	"Bruce",
X	"Red",
X	{ SYM,
X		{ "Yellow", 2, 0 },
X		{ "Red", 10, 0 },
X		{ "ForestGreen", 3, 0 },
X		{ "Red", 3, 0 },
X		{ "ForestGreen", 8, 0 },
X		{ "Red", 2, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIBruce.h
if test 223 -ne `wc -c <TIBruce.h`; then
    echo shar: \"TIBruce.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIBuchanan.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIBuchanan.h\"
else
echo shar: Extracting \"TIBuchanan.h\" \(359 characters\)
sed "s/^X//" >TIBuchanan.h <<'END_OF_TIBuchanan.h'
X/* Buchanan tartan
X */
X{
X	"Buchanan",
X	"Yellow",
X	{ 0,
X		{ "Black", 5, 0 },
X		{ "Red", 5, 0 },
X		{ "Yellow", 1, 0 },
X		{ "Red", 5, 0 },
X		{ "Black", 5, 0 },
X		{ "ForestGreen", 5, 0 },
X		{ "Black", 3, 0 },
X		{ "ForestGreen", 5, 0 },
X		{ "Black", 5, 0 },
X		{ "Yellow", 5, 0 },
X		{ "Black", 1, 0 },
X		{ "Yellow", 5, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIBuchanan.h
if test 359 -ne `wc -c <TIBuchanan.h`; then
    echo shar: \"TIBuchanan.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TICameron.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TICameron.h\"
else
echo shar: Extracting \"TICameron.h\" \(227 characters\)
sed "s/^X//" >TICameron.h <<'END_OF_TICameron.h'
X/* Cameron tartan
X */
X{
X	"Cameron",
X	"Red",
X	{ SYM,
X		{ "Yellow", 1, 0 },
X		{ "Red", 11, 0 },
X		{ "ForestGreen", 5, 0 },
X		{ "Red", 2, 0 },
X		{ "ForestGreen", 5, 0 },
X		{ "Red", 2, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TICameron.h
if test 227 -ne `wc -c <TICameron.h`; then
    echo shar: \"TICameron.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TICampbell.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TICampbell.h\"
else
echo shar: Extracting \"TICampbell.h\" \(866 characters\)
sed "s/^X//" >TICampbell.h <<'END_OF_TICampbell.h'
X/* Campbell tartans
X */
X{
X	"Campbell_of_Argyll",
X	"SteelBlue",
X	{ SYM,
X		{ "SteelBlue", 6, 0 },
X		{ "Black", 1, 0 },
X		{ "SteelBlue", 1, 0 },
X		{ "Black", 1, 0 },
X		{ "SteelBlue", 1, 0 },
X		{ "Black", 5, 0 },
X		{ "Goldenrod", 5, 0 },
X		{ "Black", 1, 0 },
X		{ "Goldenrod", 5, 0 },
X		{ "Black", 5, 0 },
X		{ "SteelBlue", 6, 0 },
X		{ "Black", 1, 0 },
X		{ "SteelBlue", 1, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X{
X	"Campbell_of_Breadalbane",
X	"Black",
X	{ SYM,
X		{ "Black", 5, 0 },
X		{ "ForestGreen", 7, 0 },
X		{ "Yellow", 2, 0 },
X		{ "ForestGreen", 7, 0 },
X		{ "Black", 7, 0 },
X		{ "MidnightBlue", 7, 0 },
X		{ "Black", 2, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X{
X	"Campbell_of_Cawdor",
X	"Black",
X	{ SYM,
X		{ "SteelBlue", 2, 0 },
X		{ "Black", 1, 0 },
X		{ "ForestGreen", 7, 0 },
X		{ "Black", 7, 0 },
X		{ "Navy", 8, 0 },
X		{ "Red", 2, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TICampbell.h
if test 866 -ne `wc -c <TICampbell.h`; then
    echo shar: \"TICampbell.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIChisholm.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIChisholm.h\"
else
echo shar: Extracting \"TIChisholm.h\" \(203 characters\)
sed "s/^X//" >TIChisholm.h <<'END_OF_TIChisholm.h'
X/* Chisholm tartan
X */
X{
X	"Chisholm",
X	"Red",
X	{ SYM,
X		{ "Red", 2, 0 },
X		{ "Yellow", 1, 0 },
X		{ "Red", 13, 0 },
X		{ "ForestGreen", 14, 0 },
X		{ "Red", 1, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIChisholm.h
if test 203 -ne `wc -c <TIChisholm.h`; then
    echo shar: \"TIChisholm.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIDuncan.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIDuncan.h\"
else
echo shar: Extracting \"TIDuncan.h\" \(229 characters\)
sed "s/^X//" >TIDuncan.h <<'END_OF_TIDuncan.h'
X/* Duncan tartan
X */
X{
X	"Duncan",
X	"Black",
X	{ SYM,
X		{ "Red", 2, 0 },
X		{ "Black", 9, 0 },
X		{ "ForestGreen", 9, 0 },
X		{ "White", 2, 0 },
X		{ "ForestGreen", 9, 0 },
X		{ "Black", 2, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIDuncan.h
if test 229 -ne `wc -c <TIDuncan.h`; then
    echo shar: \"TIDuncan.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIElliot.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIElliot.h\"
else
echo shar: Extracting \"TIElliot.h\" \(192 characters\)
sed "s/^X//" >TIElliot.h <<'END_OF_TIElliot.h'
X/* Elliot tartan
X */
X{
X	"Elliot",
X	"MediumBlue",
X	{ SYM,
X		{ "MediumBlue", 30, 0 },
X		{ "Black", 10, 0 },
X		{ "MediumBlue", 5, 0 },
X		{ "Red", 2, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIElliot.h
if test 192 -ne `wc -c <TIElliot.h`; then
    echo shar: \"TIElliot.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIErskine.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIErskine.h\"
else
echo shar: Extracting \"TIErskine.h\" \(227 characters\)
sed "s/^X//" >TIErskine.h <<'END_OF_TIErskine.h'
X/* Erskine tartan
X */
X{
X	"Erskine",
X	"Red",
X	{ SYM,
X		{ "Red", 2, 0 },
X		{ "Black", 1, 0 },
X		{ "Red", 10, 0 },
X		{ "ForestGreen", 10, 0 },
X		{ "Red", 1, 0 },
X		{ "ForestGreen", 2, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIErskine.h
if test 227 -ne `wc -c <TIErskine.h`; then
    echo shar: \"TIErskine.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIFarq.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIFarq.h\"
else
echo shar: Extracting \"TIFarq.h\" \(218 characters\)
sed "s/^X//" >TIFarq.h <<'END_OF_TIFarq.h'
X/* Farquharson tartan
X */
X{
X	"Farquharson",
X	"ForestGreen",
X	{ SYM,
X		{ "Yellow", 1, 0 },
X		{ "ForestGreen", 6, 0 },
X		{ "Black", 6, 0 },
X		{ "Navy", 7, 0 },
X		{ "Red", 1, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIFarq.h
if test 218 -ne `wc -c <TIFarq.h`; then
    echo shar: \"TIFarq.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIGow.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIGow.h\"
else
echo shar: Extracting \"TIGow.h\" \(194 characters\)
sed "s/^X//" >TIGow.h <<'END_OF_TIGow.h'
X/* Gow tartan
X */
X{
X	"Gow",
X	"Red",
X	{ SYM,
X		{ "Red", 12, 0 },
X		{ "ForestGreen", 12, 0 },
X		{ "Red", 2, 0 },
X		{ "Black", 12, 0 },
X		{ "Red", 12, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIGow.h
if test 194 -ne `wc -c <TIGow.h`; then
    echo shar: \"TIGow.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIMacArthr.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIMacArthr.h\"
else
echo shar: Extracting \"TIMacArthr.h\" \(237 characters\)
sed "s/^X//" >TIMacArthr.h <<'END_OF_TIMacArthr.h'
X/* MacArthur tartan
X */
X{
X	"MacArthur",
X	"ForestGreen",
X	{ SYM,
X		{ "DarkGreen", 13, 0 },
X		{ "ForestGreen", 3, NOP },
X		{ "DarkGreen", 3, 0 },
X		{ "ForestGreen", 11, NOP },
X		{ "Yellow", 1, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIMacArthr.h
if test 237 -ne `wc -c <TIMacArthr.h`; then
    echo shar: \"TIMacArthr.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIMacAulay.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIMacAulay.h\"
else
echo shar: Extracting \"TIMacAulay.h\" \(230 characters\)
sed "s/^X//" >TIMacAulay.h <<'END_OF_TIMacAulay.h'
X/* MacAulay tartan
X */
X{
X	"MacAulay",
X	"Red",
X	{ SYM,
X		{ "Black", 1, 0 },
X		{ "Red", 14, 0 },
X		{ "ForestGreen", 5, 0 },
X		{ "Red", 3, 0 },
X		{ "ForestGreen", 7, 0 },
X		{ "White", 1, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIMacAulay.h
if test 230 -ne `wc -c <TIMacAulay.h`; then
    echo shar: \"TIMacAulay.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIMacBean.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIMacBean.h\"
else
echo shar: Extracting \"TIMacBean.h\" \(470 characters\)
sed "s/^X//" >TIMacBean.h <<'END_OF_TIMacBean.h'
X/* MacBean tartan
X */
X{
X	"MacBean",
X	"Red",
X	{ SYM,
X		{ "Red", 21, NOP },	/* background stripe */
X		{ "White", 1, 0 },
X		{ "Black", 1, 0 },
X		{ "ForestGreen", 1, 0 },
X		{ "White", 1, 0 },
X		{ "Black", 1, 0 },
X		{ "White", 1, 0 },
X		{ "ForestGreen", 5, 0 },
X		{ "White", 1, 0 },
X		{ "Red", 3, NOP },	/* background */
X		{ "ForestGreen", 1, 0 },
X		{ "Red", 3, NOP },	/* background */
X		{ "White", 1, 0 },
X		{ "ForestGreen", 2, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIMacBean.h
if test 470 -ne `wc -c <TIMacBean.h`; then
    echo shar: \"TIMacBean.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIMacBeth.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIMacBeth.h\"
else
echo shar: Extracting \"TIMacBeth.h\" \(369 characters\)
sed "s/^X//" >TIMacBeth.h <<'END_OF_TIMacBeth.h'
X/* MacBeth tartan
X */
X{
X	"MacBeth",
X	"Blue",
X	{ SYM,
X		{ "Blue", 30, NOP },	/* background stripe */
X		{ "Yellow", 2, 0 },
X		{ "Black", 4, 0 },
X		{ "White", 1, 0 },
X		{ "Black", 1, 0 },
X		{ "White", 1, 0 },
X		{ "Black", 1, 0 },
X		{ "Green", 6, 0 },
X		{ "Red", 4, 0 },
X		{ "Black", 2, 0 },
X		{ "Red", 4, 0 },
X		{ "White", 1, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIMacBeth.h
if test 369 -ne `wc -c <TIMacBeth.h`; then
    echo shar: \"TIMacBeth.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIMacDuff.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIMacDuff.h\"
else
echo shar: Extracting \"TIMacDuff.h\" \(310 characters\)
sed "s/^X//" >TIMacDuff.h <<'END_OF_TIMacDuff.h'
X/* MacDuff tartan
X */
X{
X	"MacDuff",
X	"Red",
X	{ SYM,
X		{ "Red", 13, NOP },	/* background stripe */
X		{ "MediumBlue", 3, 0 },
X		{ "Black", 5, 0 },
X		{ "ForestGreen", 5, 0 },
X		{ "Red", 4, NOP },	/* background */
X		{ "Black", 1, 0 },
X		{ "Red", 4, NOP },	/* background */
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIMacDuff.h
if test 310 -ne `wc -c <TIMacDuff.h`; then
    echo shar: \"TIMacDuff.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIMacIver.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIMacIver.h\"
else
echo shar: Extracting \"TIMacIver.h\" \(196 characters\)
sed "s/^X//" >TIMacIver.h <<'END_OF_TIMacIver.h'
X/* MacIver tartan
X */
X{
X	"MacIver",
X	"Red",
X	{ SYM,
X		{ "Black", 16, 0 },
X		{ "Red", 2, 0 },
X		{ "Black", 2, 0 },
X		{ "Red", 12, 0 },
X		{ "White", 1, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIMacIver.h
if test 196 -ne `wc -c <TIMacIver.h`; then
    echo shar: \"TIMacIver.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIRainbow1.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIRainbow1.h\"
else
echo shar: Extracting \"TIRainbow1.h\" \(276 characters\)
sed "s/^X//" >TIRainbow1.h <<'END_OF_TIRainbow1.h'
X/* A symmetrical rainbow pattern
X */
X{
X	"Rainbow1",
X	"White",
X	{ 0,
X		{ "Black", 4, 0 },
X		{ "Red", 4, 0 },
X		{ "Green", 4, 0 },
X		{ "Blue", 4, 0 },
X		{ "Yellow", 4, 0 },
X		{ "Magenta", 4, 0 },
X		{ "Cyan", 4, 0 },
X		{ "White", 4, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIRainbow1.h
if test 276 -ne `wc -c <TIRainbow1.h`; then
    echo shar: \"TIRainbow1.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIRainbow2.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIRainbow2.h\"
else
echo shar: Extracting \"TIRainbow2.h\" \(471 characters\)
sed "s/^X//" >TIRainbow2.h <<'END_OF_TIRainbow2.h'
X/* An asymmetrical ranbow pattern
X */
X{
X	"Rainbow2",
X	"White",
X	{ 0,
X		{ "Black", 4, 0 },
X		{ "Red", 4, 0 },
X		{ "Green", 4, 0 },
X		{ "Blue", 4, 0 },
X		{ "Yellow", 4, 0 },
X		{ "Magenta", 4, 0 },
X		{ "Cyan", 4, 0 },
X		{ "White", 4, 0 },
X		{ 0 }
X	},
X	{ 0,
X		{ "LightGrey", 4, 0 },
X		{ "Coral", 4, 0 },
X		{ "ForestGreen", 4, 0 },
X		{ "SlateBlue", 4, 0 },
X		{ "Goldenrod", 4, 0 },
X		{ "Maroon", 4, 0 },
X		{ "Turquoise", 4, 0 },
X		{ "Wheat", 4, 0 },
X		{ 0 }
X	},
X},
X
X/* end */
END_OF_TIRainbow2.h
if test 471 -ne `wc -c <TIRainbow2.h`; then
    echo shar: \"TIRainbow2.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIRobRoy.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIRobRoy.h\"
else
echo shar: Extracting \"TIRobRoy.h\" \(134 characters\)
sed "s/^X//" >TIRobRoy.h <<'END_OF_TIRobRoy.h'
X/* RobRoy tartan
X */
X{
X	"Rob_Roy",
X	"Black",
X	{ SYM,
X		{ "Black", 8, 0 },
X		{ "Red", 8, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIRobRoy.h
if test 134 -ne `wc -c <TIRobRoy.h`; then
    echo shar: \"TIRobRoy.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIShepherd.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIShepherd.h\"
else
echo shar: Extracting \"TIShepherd.h\" \(139 characters\)
sed "s/^X//" >TIShepherd.h <<'END_OF_TIShepherd.h'
X/* Shepherd tartan
X */
X{
X	"Shepherd",
X	"Black",
X	{ SYM,
X		{ "Black", 1, 0 },
X		{ "White", 1, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIShepherd.h
if test 139 -ne `wc -c <TIShepherd.h`; then
    echo shar: \"TIShepherd.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIShirt1.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIShirt1.h\"
else
echo shar: Extracting \"TIShirt1.h\" \(518 characters\)
sed "s/^X//" >TIShirt1.h <<'END_OF_TIShirt1.h'
X/* This one was from a randon shirt...
X */
X{
X	"Shirt1",
X	"Sienna",
X	{ 0,
X		{ "Sienna", 35, 0 },	/* bottom to top */
X		{ "Black", 8, 0 },
X		{ "White", 1, 0 },
X		{ "Black", 8, 0 },
X		{ "White", 1, 0 },
X		{ "LightGrey", 8, 0 },
X		{ "White", 1, 0 },
X		{ "LightGrey", 8, 0 },
X		{ 0 }
X	},
X    	{ 0,
X		{ "Sienna", 35, 0 },	/* left to right */
X		{ "LightBlue", 8, 0 },
X		{ "White", 1, 0 },
X		{ "LightGrey", 8, 0 },
X		{ "White", 1, 0 },
X		{ "Black", 8, 0 },
X		{ "White", 1, 0 },
X		{ "Maroon", 8, 0 },
X		{ 0 }
X	},
X},
X
X/* end */
END_OF_TIShirt1.h
if test 518 -ne `wc -c <TIShirt1.h`; then
    echo shar: \"TIShirt1.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIStewart.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIStewart.h\"
else
echo shar: Extracting \"TIStewart.h\" \(1227 characters\)
sed "s/^X//" >TIStewart.h <<'END_OF_TIStewart.h'
X/* Stewart tartans
X */
X{
X	"Stewart_Dress",
X	"White",
X	{ SYM,
X		{ "White", 18, NOP },	/* background stripe */
X		{ "Blue", 1, 0 },
X		{ "Black", 4, 0 },
X		{ "Yellow", 1, 0 },
X		{ "Black", 1, 0 },
X		{ "White", 1, 0 },
X		{ "Black", 1, 0 },
X		{ "ForestGreen", 3, 0 },
X		{ "Red", 2, 0 },
X		{ "Black", 1, 0 },
X		{ "Red", 1, 0 },
X		{ "White", 1, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X{
X	"Stewart_Hunting",
X	"ForestGreen",
X	{ 0,
X		{ "Red", 1, 0 },
X		{ "ForestGreen", 7, NOP },
X		{ "DarkGreen", 3, 0 },
X		{ "ForestGreen", 1, NOP },
X		{ "DarkGreen", 3, 0 },
X		{ "ForestGreen", 1, NOP },
X		{ "DarkGreen", 3, 0 },
X		{ "ForestGreen", 1, NOP },
X		{ "DarkGreen", 3, 0 },
X		{ "ForestGreen", 7, NOP },
X		{ "Yellow", 1, 0 },
X		{ "ForestGreen", 7, NOP },
X		{ "DarkGreen", 7, 0 },
X		{ "ForestGreen", 1, NOP },
X		{ "DarkGreen", 7, 0 },
X		{ "ForestGreen", 7, NOP },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X{
X	"Stewart_Royal",
X	"Red",
X	{ SYM,
X		{ "Red", 18, NOP },	/* background stripe */
X		{ "Navy", 1, 0 },
X		{ "Black", 4, 0 },
X		{ "Yellow", 1, 0 },
X		{ "Black", 1, 0 },
X		{ "White", 1, 0 },
X		{ "Black", 1, 0 },
X		{ "ForestGreen", 3, 0 },
X		{ "Red", 2, 0 },
X		{ "Black", 1, 0 },
X		{ "Red", 1, 0 },
X		{ "White", 1, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIStewart.h
if test 1227 -ne `wc -c <TIStewart.h`; then
    echo shar: \"TIStewart.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIUrquhart.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIUrquhart.h\"
else
echo shar: Extracting \"TIUrquhart.h\" \(312 characters\)
sed "s/^X//" >TIUrquhart.h <<'END_OF_TIUrquhart.h'
X/* Urquhart tartan
X */
X{
X	"Urquhart",
X	"ForestGreen",
X	{ SYM,
X		{ "Black", 1, 0 },
X		{ "ForestGreen", 8, NOP },	/* Background */
X		{ "Black", 8, 0 },
X		{ "Navy", 1, 0 },
X		{ "Black", 1, 0 },
X		{ "Navy", 1, 0 },
X		{ "Black", 1, 0 },
X		{ "Navy", 3, 0 },
X		{ "Red", 2, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIUrquhart.h
if test 312 -ne `wc -c <TIUrquhart.h`; then
    echo shar: \"TIUrquhart.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIUsa.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIUsa.h\"
else
echo shar: Extracting \"TIUsa.h\" \(260 characters\)
sed "s/^X//" >TIUsa.h <<'END_OF_TIUsa.h'
X/* Red, White, and Blue, with Yellow fringe
X */
X{
X	"Usa",
X	"White",
X	{ 0,
X		{ "Red", 4, 0 },
X		{ "White", 4, 0 },
X		{ "Blue", 4, 0 },
X		{ 0 }
X	},
X	{ 0,
X		{ "Red", 2, 0 },
X		{ "White", 2, 0 },
X		{ "Blue", 2, 0 },
X		{ "Yellow", 2, 0 },
X		{ 0 }
X	},
X},
X
X/* end */
END_OF_TIUsa.h
if test 260 -ne `wc -c <TIUsa.h`; then
    echo shar: \"TIUsa.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f TIWallace.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"TIWallace.h\"
else
echo shar: Extracting \"TIWallace.h\" \(180 characters\)
sed "s/^X//" >TIWallace.h <<'END_OF_TIWallace.h'
X/* Wallace tartan
X */
X{
X	"Wallace",
X	"Black",
X	{ SYM,
X		{ "Black", 1, 0 },
X		{ "Red", 12, 0 },
X		{ "Black", 12, 0 },
X		{ "Yellow", 1, 0 },
X		{ 0 }
X	},
X	{ HVSAME,
X	},
X},
X
X/* end */
END_OF_TIWallace.h
if test 180 -ne `wc -c <TIWallace.h`; then
    echo shar: \"TIWallace.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f alltartans.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"alltartans.h\"
else
echo shar: Extracting \"alltartans.h\" \(634 characters\)
sed "s/^X//" >alltartans.h <<'END_OF_alltartans.h'
X#include "TIBarclay.h"
X#include "TIBlackW.h"
X#include "TIBrodie.h"
X#include "TIBruce.h"
X#include "TIBuchanan.h"
X#include "TICameron.h"
X#include "TICampbell.h"
X#include "TIChisholm.h"
X#include "TIDuncan.h"
X#include "TIElliot.h"
X#include "TIErskine.h"
X#include "TIFarq.h"
X#include "TIGow.h"
X#include "TIMacArthr.h"
X#include "TIMacAulay.h"
X#include "TIMacBean.h"
X#include "TIMacBeth.h"
X#include "TIMacDuff.h"
X#include "TIMacIver.h"
X#include "TIRainbow1.h"
X#include "TIRainbow2.h"
X#include "TIRobRoy.h"
X#include "TIShepherd.h"
X#include "TIShirt1.h"
X#include "TIStewart.h"
X#include "TIUrquhart.h"
X#include "TIUsa.h"
X#include "TIWallace.h"
END_OF_alltartans.h
if test 634 -ne `wc -c <alltartans.h`; then
    echo shar: \"alltartans.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f patchlevel.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"patchlevel.h\"
else
echo shar: Extracting \"patchlevel.h\" \(110 characters\)
sed "s/^X//" >patchlevel.h <<'END_OF_patchlevel.h'
X/* patchlevel.h - to conform to comp.sources.x protocol
X */
X
X#define VERSION "xtartan version 1.0"
X
X/* end */
END_OF_patchlevel.h
if test 110 -ne `wc -c <patchlevel.h`; then
    echo shar: \"patchlevel.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tartaninfo.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tartaninfo.h\"
else
echo shar: Extracting \"tartaninfo.h\" \(1627 characters\)
sed "s/^X//" >tartaninfo.h <<'END_OF_tartaninfo.h'
X/* tartaninfo.h
X *
X * 11.Jan.88  jimmc  Extracted from xtartan.c
X * 13.Jan.88  Remove numstripes field in Sinfo, use null color name instead
X */
X
X#define MAXSTRIPES 30
X
X/* fill styles */
X#define VSTRIPE (1<<10)
X#define HSTRIPE (1<<11)
X#define SOLID 1		/* solid rectangle */
X#define RLINES 2	/* lines in same direction as stripes */
X#define HLINES 3	/* horizontal lines */
X#define VLINES 4	/* vertical lines */
X#define NOP 5		/* draw nothing */
X#define ALINES 6	/* angled lines (lower left to upper right) */
X
X/* stripe group flags */
X#define HVSAME (1<<0)	/* vertical stripes are same as horizontal */
X#define SYM (1<<1)	/* symmetreical stripe pattern */
X
Xtypedef struct _s1info {	/* info about one stripe */
X	char *color;		/* name of color of the stripe */
X				/* (null indicates end of a list of stripes) */
X	int width;		/* width of the stripe */
X	int style;		/* style of the stripe */
X	int pixel;		/* pixel value for stripe color */
X				/*   (filled at run time) */
X} S1info;
X
Xtypedef struct _sinfo {		/* info about a set of stripes */
X	int flags;		/* flags about the stripe group */
X	S1info slist[MAXSTRIPES];	/* info about each stripe */
X		/* end of the list is specified by a stripe with a null
X		 * color name. */
X} Sinfo;
X
Xtypedef struct _tartaninfo {
X	char *name;		/* name of the tartan */
X	char *bgcolor;		/* name of background color */
X	Sinfo hstripes;		/* info about horizontal stripes */
X				/* stripes listed from bottom to top */
X	Sinfo vstripes;		/* info about vertical stripes */
X				/* stripes listed from left to right */
X	int bgpixel;		/* pixel value of bg color (filled at run) */
X} TartanInfo;
X
X/* end */
END_OF_tartaninfo.h
if test 1627 -ne `wc -c <tartaninfo.h`; then
    echo shar: \"tartaninfo.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tartcursor.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tartcursor.h\"
else
echo shar: Extracting \"tartcursor.h\" \(687 characters\)
sed "s/^X//" >tartcursor.h <<'END_OF_tartcursor.h'
X#define tartcursor_width 16
X#define tartcursor_height 16
X#define tartcursor_x_hot 7
X#define tartcursor_y_hot 7
Xstatic char tartcursor_bits[] = {
X   0x14, 0x45, 0x08, 0x22, 0x14, 0x45, 0x5d, 0x77, 0xbe, 0xef, 0x5d, 0x77,
X   0x14, 0x45, 0x08, 0x22, 0x14, 0x45, 0x5d, 0x77, 0xbe, 0xef, 0x5d, 0x77,
X   0x14, 0x45, 0x08, 0x22, 0xbe, 0xef, 0x08, 0x22};
X
X#define tartmask_width 16
X#define tartmask_height 16
X#define tartmask_x_hot -1
X#define tartmask_y_hot -1
Xstatic char tartmask_bits[] = {
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
END_OF_tartcursor.h
if test 687 -ne `wc -c <tartcursor.h`; then
    echo shar: \"tartcursor.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f xtartan.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"xtartan.h\"
else
echo shar: Extracting \"xtartan.h\" \(353 characters\)
sed "s/^X//" >xtartan.h <<'END_OF_xtartan.h'
X/* xtartan.h - general include stuff
X *
X *  7.Jan.88  jimmc  Initial definition (X10)
X * 24.Oct.89  jimmc  Convert to X11, Xt; general restructuring
X */
X
X#ifndef XTARTAN_H
X#define XTARTAN_H
X
Xextern Display *dpy;
Xextern Screen *screen;
Xextern Drawable drw;
Xextern GC gc;
Xextern Colormap colormap;
Xextern Window win, rootwin;
X
X#endif XTARTAN_H
X
X/* end */
END_OF_xtartan.h
if test 353 -ne `wc -c <xtartan.h`; then
    echo shar: \"xtartan.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f actions.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"actions.c\"
else
echo shar: Extracting \"actions.c\" \(2804 characters\)
sed "s/^X//" >actions.c <<'END_OF_actions.c'
X/* actions.c - translation table stuff and action routines for xtartan
X *
X * 25.Oct.89  jimmc  Initial definition
X */
X
X#include <X11/Intrinsic.h>
X#include <stdio.h>
X#include "xtartan.h"
X
Xextern int TartanTabSize;
Xextern XtAppContext appctx;
Xextern int TartanIndex;
X
Xchar *TartanName;
X
Xstatic void
XHelp(w,xev,argv,argcp)
XWidget w;
XXEvent *xev;
XString *argv;
Xint *argcp;
X{
X	docharhelp();
X}
X
Xstatic void
XNext(w,xev,argv,argcp)
XWidget w;
XXEvent *xev;
XString *argv;
Xint *argcp;
X{
X	if (++TartanIndex>=TartanTabSize) TartanIndex=0;
X	setTartan(TartanIndex);
X}
X
Xstatic void
XPrevious(w,xev,argv,argcp)
XWidget w;
XXEvent *xev;
XString *argv;
Xint *argcp;
X{
X	if (--TartanIndex<0) TartanIndex=TartanTabSize-1;
X	setTartan(TartanIndex);
X}
X
Xstatic void
XName(w,xev,argv,argcp)
XWidget w;
XXEvent *xev;
XString *argv;
Xint *argcp;
X{
X	printf("%s\n", TartanName);
X}
X
Xstatic void
XDoExit(w,xev,argv,argcp)
XWidget w;
XXEvent *xev;
XString *argv;
Xint *argcp;
X{
X	exit(0);
X}
X
Xstatic void
XInfo(w,xev,argv,argcp)
XWidget w;
XXEvent *xev;
XString *argv;
Xint *argcp;
X{
X	printf("%s scale=%d linewidth=%d\n",TartanName,getScale(),getWidth());
X}
X
Xstatic void
XScale(w,xev,argv,argcp)
XWidget w;
XXEvent *xev;
XString *argv;
Xint *argcp;
X{
X	if (*argcp>0)
X		changeScale(argv[0]);
X	else
X		changeScale("2");		/* default */
X}
X
Xstatic void
XLineWidth(w,xev,argv,argcp)
XWidget w;
XXEvent *xev;
XString *argv;
Xint *argcp;
X{
X	if (*argcp>0)
X		changeWidth(argv[0]);
X	else
X		changeWidth("1");	/* default */
X}
X
Xdocharhelp()
X{
X	printf("Default bindings:\n");
X	printf("h or ?   this help message\n");
X	printf("n  circulate through tartans (next)\n");
X	printf("N  like n but also print names of tartans\n");
X	printf("p  circulate through tartans in reverse (previous)\n");
X	printf("P  like p but also print names of tartans\n");
X	printf("q or ^C  quit\n");
X	printf("t  print name and sizes of current tartan\n");
X	printf("*  increase scale factor by 1\n");
X	printf("/  decrease scale factor by 1\n");
X	printf("+  increase line width by 1\n");
X	printf("-  decrease line width by 1\n");
X}
X
XXtActionsRec actions[] = {
X	{"exit",	DoExit },
X	{"help",	Help },
X	{"info",	Info },
X	{"lineWidth",	LineWidth },
X	{"name",	Name },
X	{"next",	Next },
X	{"previous",	Previous },
X	{"scale",	Scale },
X};
X
Xstatic String transTab = "\
X	 :<Key>? : help()\n\
X      Ctrl<Key>C : exit()\n\
X	 :<Key>h : help()\n\
X	 :<Key>n : next()\n\
X	 :<Key>N : next() name()\n\
X	 :<Key>p : previous()\n\
X	 :<Key>P : previous() name()\n\
X	 :<Key>q : exit()\n\
X	 :<Key>t : info()\n\
X	 :<Key>* : scale(+1)\n\
X	 :<Key>/ : scale(-1)\n\
X	 :<Key>+ : lineWidth(+1)\n\
X	 :<Key>- : lineWidth(-1)\n\
X	 :<Key>= : scale() lineWidth()";
X
Xinit_translations(w)
XWidget w;
X{
X	XtTranslations tt;
X
X	XtAppAddActions(appctx,actions,XtNumber(actions));
X	tt = XtParseTranslationTable(transTab);
X	XtAugmentTranslations(w,tt);
X}
X
X/* end */
END_OF_actions.c
if test 2804 -ne `wc -c <actions.c`; then
    echo shar: \"actions.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f color.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"color.c\"
else
echo shar: Extracting \"color.c\" \(2382 characters\)
sed "s/^X//" >color.c <<'END_OF_color.c'
X/* color.c - functions dealing with colors
X *
X *  7.Jan.88  jimmc  Initial definition (X10)
X * 24.Oct.89  jimmc  Convert to X11, Xt; general restructuring
X */
X
X#include <X11/Intrinsic.h>
X#include <X11/StringDefs.h>
X#include <stdio.h>
X#include <ctype.h>
X#include "xtartan.h"
X#include "tartaninfo.h"
X
X#define MAXCOLORS 200
X
Xtypedef struct _cinfo {		/* info about one color */
X	char *name;
X	int pixel;
X} Cinfo;
X
Xtypedef struct _ctrans {
X	char *from;
X	char *to;
X} Ctrans;
X
Xextern char *malloc();
X
XCtrans *colortrans;	/* for color translations */
Xint numtrans;
X
XCinfo colors[MAXCOLORS] = { 0 };
Xint colorcount = 0;
X
Xinit_colors(xstr,bg)
Xchar *xstr;
Xchar *bg;
X{
X	int i;
X	int n;
X	char *p;
X	char *nxstr;
X	int f;
X
X	for (i=0; i<MAXCOLORS; i++)
X		colors[i].pixel = -1;
X
X	if (bg)
X		setBackground(c_pixel(bg));
X
X	numtrans = 0;
X	if (!xstr)
X		return;
X	n = 0;
X	for (p=xstr;*p;) {
X		while (*p && isspace(*p)) p++;
X		if (*p) {
X			n++;
X			while (*p && !isspace(*p)) p++;
X		}
X	}
X	nxstr = malloc(strlen(xstr)+1);
X	if (!nxstr) Fatal("can't allocate memory");
X	strcpy(nxstr,xstr);
X	colortrans = (Ctrans *)malloc(sizeof(Ctrans)*((n+1)/2));
X	if (!colortrans) Fatal("can't allocate memory");
X	p = nxstr;
X	f = 0;
X	while (*p) {
X		while (*p && isspace(*p)) p++;
X		if (*p) {
X			if (f==0) {
X				colortrans[numtrans].from = p;
X				f = 1;
X			} else {
X				colortrans[numtrans].to = p;
X				f =0;
X				numtrans++;
X			}
X			while (*p && !isspace(*p)) p++;
X			if (*p) *p++ = 0;
X		}
X	}
X}
X
Xchar *
Xtranslate_color(oldname)
Xchar *oldname;
X{
X	int i;
X
X	for (i=0; i<numtrans; i++) {
X		if (strcmp(oldname,colortrans[i].from)==0) {
X			return(colortrans[i].to);
X		}
X	}
X	return oldname;
X}
X
Xint			/* returns the pixel value */
Xc_pixel(color)
Xchar *color;
X{
X	int i;
X
X	for (i=0; i<colorcount; i++) {
X		if (strcmp(color,colors[i].name)==0)
X			return colors[i].pixel;
X	}
X	if (colorcount>=MAXCOLORS)
X		Fatal("too many colors allocated (max=%d)",MAXCOLORS);
X	colors[colorcount].name = color;
X	c_init(colors+colorcount);
X	colorcount++;
X	return colors[colorcount-1].pixel;
X}
X
Xc_init(cinf)
XCinfo *cinf;
X{
X	int t;
X	XColor xdef, sdef;
X
X	if (cinf->pixel>=0) return;	/* already set */
X	t = XLookupColor(dpy,colormap,cinf->name,&xdef,&sdef);
X	if (t==0) Fatal("error getting definition for color %s", cinf->name);
X	t = XAllocColor(dpy,colormap,&xdef);
X	if (t==0) Fatal("can't allocate color %s", cinf->name);
X	cinf->pixel = xdef.pixel;
X}
X
X/* end */
END_OF_color.c
if test 2382 -ne `wc -c <color.c`; then
    echo shar: \"color.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f draw.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"draw.c\"
else
echo shar: Extracting \"draw.c\" \(6355 characters\)
sed "s/^X//" >draw.c <<'END_OF_draw.c'
X/* draw.c - the routines which actually do the tartan drawing
X *
X *  7.Jan.88  jimmc  Initial definition (X10)
X * 24.Oct.89  jimmc  Convert to X11, Xt; general restructuring
X */
X
X#include <X11/Intrinsic.h>
X#include <stdio.h>
X#include "xtartan.h"
X#include "tartaninfo.h"
X
Xextern int TartanIndex;
X
Xstatic int scale;
Xstatic int lwidth;
Xstatic int drwheight;
Xstatic int BGPixel = -1;
X
X/* The Tartan data */
XTartanInfo TartanTab[] = {
X#include "alltartans.h"
X};
Xint TartanTabSize = sizeof(TartanTab)/sizeof(TartanTab[0]);
X
XsetBackground(n)
Xint n;
X{
X	BGPixel = n;
X}
X
XsetScaleWidth(s,w)
Xint s,w;
X{
X	scale = s;
X	lwidth = w;
X}
X
XchangeScale(s)
Xchar *s;
X{
X	int newscale;
X
X	if (s[0]=='+')
X		newscale = scale + atoi(s+1);
X	else if (s[0]=='-')
X		newscale = scale - atoi(s+1);
X	else
X		newscale = atoi(s);
X	if (newscale<=0) {
X		Bell();
X		return;
X	}
X	scale = newscale;
X	redraw();
X	
X}
X
Xint getScale() { return scale; }
X
XchangeWidth(s)
Xchar *s;
X{
X	int newlwidth;
X
X	if (s[0]=='+')
X		newlwidth = lwidth + atoi(s+1);
X	else if (s[0]=='-')
X		newlwidth = lwidth - atoi(s+1);
X	else
X		newlwidth = atoi(s);
X	if (newlwidth<=0) {
X		Bell();
X		return;
X	}
X	lwidth = newlwidth;
X	redraw();
X	
X}
X
Xint getWidth() { return lwidth; }
X
XDrawTartan(rx,ry,rw,rh)		/* draws the currently selected tartan */
Xint rx,ry,rw,rh;	/* region to draw in */
X{
X	TartanInfo *ti;
X	Sinfo *si;
X
X	ti = TartanTab+TartanIndex;
X	FillBox(rx,ry,rw,rh,((BGPixel>=0)?BGPixel:(ti->bgpixel)),SOLID);
X	/* fill region with background */
X	si = &(ti->hstripes);	/* do the horizontal stripes */
X	FillStripes(ry,rh,rx,rw,si,0);
X	si = &(ti->vstripes);	/* do the vertical stripes */
X	if (si->flags & HVSAME)
X		si = &(ti->hstripes);	/* vertical same as horizontal */
X	FillStripes(rx,rw,ry,rh,si,1);
X}
X
XFillStripes(org,size,othorg,othsize,si,vflag)
Xint org,size;		/* origin and size in direction of interest */
Xint othorg, othsize;	/* origin and size in the other direction */
XSinfo *si;		/* the stripe info */
Xint vflag;		/* set for vertical stripes, clear for horizontal */
X{
X	int corg;		/* current x or y origin */
X	int n;
X	int delta;
X	S1info *s1i;
X	int sw;
X	int sflag;
X
X	corg = 0;		/* start at the top/left of the screen */
X	n = 0;			/* start with the first stripe */
X	delta = 1;
X	sflag = vflag?HSTRIPE:VSTRIPE;
X	while (corg<org+size) {	/* repeat the pattern */
X		s1i = si->slist+n;
X		sw = s1i->width*scale;
X		if (corg+sw>=org) {
X			if (vflag) {
X				FillBox(corg,othorg,sw,othsize,
X				    s1i->pixel, s1i->style|sflag);
X			} else {
X				FillBox(othorg,corg,othsize,sw,
X				    s1i->pixel, s1i->style|sflag);
X			}
X			/* fill the area with the proper pattern */
X		}
X		corg += sw;
X		n += delta;
X		if (n<0) {	/* from counting backwards */
X			n = 1;
X			delta = 1;
X		}
X		else if (!si->slist[n].color) {	/* if at the end... */
X			if (si->flags & SYM) {
X				n -= 2;
X				delta = -1;
X			}
X			else n=0;	/* wrap on overflow */
X		}
X	}
X}
X
XFillBox(x,y,w,h,pixel,style)
Xint x,y;	/* origin of box, (0,0) is lower left */
Xint w,h;	/* size of box */
Xint pixel;	/* pixel value to use */
Xint style;	/* what style to draw in */
X{
X	int nstyle;
X	int offset;
X	int d;
X	int cx, cy;
X	int x0,y0,x1,y1;
X	int lw;
X	int q=0;
X
X	XSetForeground(dpy,gc,pixel);
X	y = drwheight-h-y;	/* change to X screen coords */
X	offset = (style&HSTRIPE)?1:0;
X	if (offset)
X		w+=lwidth;
X	nstyle = style & ~(HSTRIPE|VSTRIPE);
X	if (!nstyle)
X		nstyle = ALINES;	/* default style */
X	switch (nstyle) {
X	case RLINES:	/* same direction as length of stripe */
X		nstyle = (style&HSTRIPE)?HLINES:VLINES;
X		break;
X	case NOP:
X		return;		/* no nothing */
X	default:
X		break;
X	}
X	switch (nstyle) {
X	case SOLID:
X		XFillRectangle(dpy,drw,gc,x,y,w,h);
X		break;
X	case HLINES:
X		cy = (y+lwidth-1)/lwidth;
X		cy -= offset^(cy&1);
X		cy *= lwidth;
X		XSetLineAttributes(dpy,gc,lwidth==1?0:lwidth,0,0,0);
X		for (; cy<y+h; cy+=2*lwidth) {
X			XDrawLine(dpy,drw,gc,x,cy,x+w-1,cy);
X		}
X		break;
X	case VLINES:
X		cx = (x+lwidth-1)/lwidth;
X		cx -= offset^(cx&1);
X		cx *= lwidth;
X		XSetLineAttributes(dpy,gc,lwidth==1?0:lwidth,0,0,0);
X		for (; cx<x+w; cx+=2*lwidth) {
X			XDrawLine(dpy,drw,gc,cx,y,cx,y+h-1);
X		}
X		break;
X	case ALINES:
X		cx = (x+y+lwidth-1)/lwidth;
X		d = -(offset^(cx&1));
X		d *= lwidth;
X		d += lwidth-1-((x+y+lwidth-1)%lwidth);
X		lw = (int)(0.8*((float)(lwidth)));
X		XSetLineAttributes(dpy,gc,lw<=1?0:lw,0,0,0);
X		for (; d<w+h-1; d+=2*lwidth) {
X			if (d<w) {
X				x0 = x+d;
X				y0 = y;
X			} else {
X				x0 = x+(w-q);
X				y0 = y+d-(w-q);
X			}
X			if (d<h) {
X				x1 = x;
X				y1 = y+d;
X			} else {
X				x1 = x+d-(h-q);
X				y1 = y+(h-q);
X			}
X			XDrawLine(dpy,drw,gc,x0,y0,x1,y1);
X		}
X		break;
X	default:
X		break;	/* should never get here */
X	}
X}
X
XtartanSize(si)
XSinfo *si;
X{
X	S1info *s1i;
X	int w;
X
X	s1i = si->slist;
X	w = 0;
X	while (s1i->color) {
X		w += s1i->width*scale;
X		s1i++;
X	}
X	if (si->flags & SYM) {
X		w *= 2;
X		s1i--;		/* back up to last entry */
X		w -= s1i->width*scale;	/* it doesn't get doubled */
X		s1i = si->slist;	/* first entry */
X		w -= s1i->width*scale;	/* it doesn't get doubled */
X	}
X	return w;
X}
X
X/* the redraw function creates a pixmap, draws the tartan into it, and
X * makes that the window background pixmap.
X * When we draw into a pixmap, we have to draw a larger area and then
X * use the inside of it to avoid edge effects on the line drawing.
X * The constant K indicates how much larger the area is.
X */
Xredraw()
X{
X#define K 20	/* kludge factor */
X	int w,h;
X	int d;
X	TartanInfo *ti;
X	Sinfo *si;
X	Pixmap newpix;
X	Pixmap newpixK;
X	Pixmap oldpix;
X
X	d = DefaultDepthOfScreen(screen);
X	ti = TartanTab+TartanIndex;
X	si = &(ti->hstripes);	/* do the horizontal stripes */
X	h = tartanSize(si);
X	si = &(ti->vstripes);	/* do vertical stripes */
X	if (si->flags & HVSAME)
X		w = h;
X	else
X		w = tartanSize(si);
X	newpix = XCreatePixmap(dpy,win,w,h,d);
X	if (!newpix) {
X		Warn("error creating new pixmap");
X		return;
X	}
X	newpixK = XCreatePixmap(dpy,win,w+K,h+K,d);
X	if (!newpix) {
X		Warn("error creating new pixmap");
X		return;
X	}
X	drwheight = h+K;
X	oldpix = drw;
X	drw = newpixK;
X	DrawTartan(0,0,w+K,h+K);
X	XSetFunction(dpy,gc,GXcopy);
X	XSetPlaneMask(dpy,gc,AllPlanes);
X	XCopyArea(dpy,newpixK,newpix,gc,K/2,K/2,w+K,h+K,0,0);
X		/* copy center portion into new pixmap */
X	XSetWindowBackgroundPixmap(dpy,win,newpix);
X	XClearWindow(dpy,win);		/* put up the new background */
X	XFreePixmap(dpy,newpixK);
X	if (oldpix)
X		XFreePixmap(dpy,oldpix);
X	drw = newpix;	/* for possible use by setrootbg */
X}
X
X/* end */
END_OF_draw.c
if test 6355 -ne `wc -c <draw.c`; then
    echo shar: \"draw.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f main.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"main.c\"
else
echo shar: Extracting \"main.c\" \(5313 characters\)
sed "s/^X//" >main.c <<'END_OF_main.c'
X/* main.c - main module for xtartan
X *
X *  7.Jan.88  jimmc  Initial definition (X10)
X * 24.Oct.89  jimmc  Convert to X11, Xt; general restructuring
X */
X
X#include <X11/Intrinsic.h>
X#include <X11/StringDefs.h>
X#include <X11/Xatom.h>
X#include <stdio.h>
X#include "xtartan.h"
X#include "patchlevel.h"
X
X#define DEFWIDTH 200
X#define DEFHEIGHT 200
X
Xextern char *rindex();
X
Xchar *Progname;
XDisplay *dpy;
XScreen *screen;
XDrawable drw;
XGC gc;
XColormap colormap;
XWindow win, rootwin;
XXtAppContext appctx;
X
X#include "tartcursor.h"	/* define our cursor */
X
Xstatic char *version=VERSION;	/* from patchlevel.h */
X
Xtypedef struct rinfo {
X	Bool useroot;
X	int scale;
X	int lwidth;
X	char *tartanname;
X	char *action;
X	char *ctrans;
X} RInfo, *RInfoPtr;
XRInfo Rdata;
X
Xstatic XrmOptionDescRec options[] = {
X	{"-draw",	"action",	XrmoptionNoArg,  "draw"},
X	{"-list",	"action",	XrmoptionNoArg,  "list"},
X	{"-print",	"action",	XrmoptionNoArg,  "print"},
X	{"-version",	"action",	XrmoptionNoArg,  "version"},
X	{"-r",		"useRoot",	XrmoptionNoArg,  "TRUE" },
X	{"-s",		"scale",	XrmoptionSepArg, NULL },
X	{"-t",		"tartan",	XrmoptionSepArg, NULL },
X	{"-w",		"lineWidth",	XrmoptionSepArg, NULL },
X	{"-x",		"colorTranslations", XrmoptionSepArg, NULL },
X};
X
Xstatic XtResource resources[] = {
X	{"action", "Action", XtRString, sizeof(String),
X		XtOffset(RInfoPtr,action), XtRString, "draw"},
X	{"colorTranslations", "ColorTranslations", XtRString, sizeof(String),
X		XtOffset(RInfoPtr,ctrans), XtRString, NULL},
X	{"lineWidth", "LineWidth", XtRInt,    sizeof(int),
X		XtOffset(RInfoPtr,lwidth), XtRImmediate, (caddr_t)1},
X	{"scale", "Scale", XtRInt,    sizeof(int),
X		XtOffset(RInfoPtr,scale), XtRImmediate, (caddr_t)2},
X	{"tartan", "Tartan", XtRString, sizeof(String),
X		XtOffset(RInfoPtr,tartanname), XtRString, "MacBeth"},
X	{"useRoot", "UseRoot", XtRBool, sizeof(Bool),
X		XtOffset(RInfoPtr,useroot), XtRBool, 0},
X};
X
Xmain(argc,argv)
Xint argc;
Xchar *argv[];
X{
X	int i;
X	Widget top;
X	char buf[1000];
X	Arg args[3];
X	int width, height;
X
X	Progname = rindex(argv[0],'/');
X	if (Progname) Progname++; 
X	else Progname=argv[0];
X
X	top = XtInitialize(Progname,"XTartan",options,XtNumber(options),
X		&argc,argv);
X	if (argc!=1) Usage(1);
X	dpy = XtDisplay(top);
X	appctx = XtWidgetToApplicationContext(top);
X
X#if 0	/* width and height seem to start off as very large numbers... */
X	/* set height and width to be non-zero */
X	XtSetArg(args[0], XtNwidth, &width);
X	XtSetArg(args[1], XtNheight, &height);
X	XtGetValues(top, args, (Cardinal)2);
X	if (width == 0) width = DEFWIDTH;
X	if (height == 0) height = DEFHEIGHT;
X	XtSetArg(args[0], XtNwidth, width);
X	XtSetArg(args[1], XtNheight, height);
X	XtSetValues(top, args, (Cardinal)2);
X#endif
X
X	XtGetApplicationResources(top,&Rdata,resources,XtNumber(resources),
X		NULL,0);
X
X	init_translations(top);
X
X	init_colors(Rdata.ctrans,NULL);
X
X	setTartanName(Rdata.tartanname);
X	setScaleWidth(Rdata.scale,Rdata.lwidth);
X
X	if (strcmp(Rdata.action,"version")==0) {
X		printf("%s\n",version);
X		exit(0);
X	}
X
X	if (strcmp(Rdata.action,"list")==0) {
X		ListTartans();
X		exit(0);
X	}
X
X	i = findTartan(Rdata.tartanname);
X	if (i<0) {	/* not a known tartan */
X		ListTartans();
X		exit(1);
X	}
X
X	if (strcmp(Rdata.action,"print")==0) {
X		PrintTartan(i);
X		exit(0);
X	}
X
X	if (strcmp(Rdata.action,"draw")!=0) {
X		Fatal("Bad action %s",Rdata.action);
X	}
X
X	sprintf(buf,"%s %s",Progname,Rdata.tartanname);
X	init_display(top,buf,Rdata.useroot);
X
X	setTartan(i);	/* put in the background */
X
X	if (Rdata.useroot) {
X		setrootbg();
X	} else {
X		/* for non-root window, let user enter commands */
X		XtAppMainLoop(appctx);
X		/* NOTREACHED */
X	}
X	XCloseDisplay(dpy);
X	exit(0);
X}
X
Xinit_display(top,winname,rflag)
XWidget top;
Xchar *winname;
Xint rflag;
X{
X	int x,y,w,h;
X	Pixmap bm,mbm;
X	Cursor tart_cursor;
X	XColor fgc, bgc;
X
X
X	screen = DefaultScreenOfDisplay(dpy);
X	colormap = DefaultColormapOfScreen(screen);
X	gc = DefaultGCOfScreen(screen);
X	rootwin = DefaultRootWindow(dpy);
X	if (rflag) {
X		win = rootwin;
X		return;
X	}
X	XtSetMappedWhenManaged(top,0);
X	XtRealizeWidget(top);
X	win = XtWindow(top);
X	XStoreName(dpy,win,winname);
X	bm = XCreateBitmapFromData(dpy,win,tartcursor_bits,
X			tartcursor_width,tartcursor_height);
X	mbm = XCreateBitmapFromData(dpy,win,tartmask_bits,
X			tartmask_width,tartmask_height);
X	fgc.pixel = BlackPixelOfScreen(screen);
X	bgc.pixel = WhitePixelOfScreen(screen);
X	XQueryColor(dpy,colormap,&fgc);
X	XQueryColor(dpy,colormap,&bgc);
X	tart_cursor = XCreatePixmapCursor(dpy,bm,mbm,&fgc,&bgc,
X			tartcursor_x_hot,tartcursor_y_hot);
X	if (!tart_cursor) Warn("can't make cursor");
X	else XDefineCursor(dpy,win,tart_cursor);
X	XtMapWidget(top);
X	XtSetMappedWhenManaged(top,1);
X}
X
XUsage(x)
Xint x;		/* exit code (-1 means return) */
X{
X	printf("usage: %s  [-draw] [-list] [-print] [std Xt args]\n\
X[-r] [-s scale] [-t tartanname] [-w linewidth] [-x \"f1 t1 f2 t2...\"]\n",
X	    Progname);
X	printf("-draw     draw the specified tartan (default)\n");
X	printf("-list     print a list of available tartans\n");
X	printf("-print    print out info about the specified tartan\n");
X	printf("-r  use root window\n");
X	printf("-s  provide an expansion scale factor\n");
X	printf("-t  specify the tartan name to use\n");
X	printf("-w  provide a line width factor\n");
X	printf("-x  provide list of color translations as single string\n");
X	if (x<0) return;
X	exit(x);
X}
X
X/* end */
END_OF_main.c
if test 5313 -ne `wc -c <main.c`; then
    echo shar: \"main.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f misc.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"misc.c\"
else
echo shar: Extracting \"misc.c\" \(2814 characters\)
sed "s/^X//" >misc.c <<'END_OF_misc.c'
X/* misc.c - miscellaneous functions for xtartan
X *
X *  7.Jan.88  jimmc  Initial definition (X10)
X * 24.Oct.89  jimmc  Convert to X11, Xt; general restructuring
X */
X
X#include <X11/Intrinsic.h>
X#include <stdio.h>
X#include <varargs.h>
X#include "xtartan.h"
X#include "tartaninfo.h"
X
X
Xextern char *translate_color();
X
Xextern char *Progname;
Xextern TartanInfo TartanTab[];
Xextern int TartanTabSize;
X
Xchar *TartanName;
Xint TartanIndex;
X
XBell()
X{
X	XBell(dpy,0);
X}
X
X/* VARARGS1 - like printf */
XWarn(va_alist)     /* print message */
Xva_dcl
X{
X	va_list pvar;
X	char *fmt;
X
X	va_start(pvar);
X	fmt = va_arg(pvar,char *);
X	fprintf(stderr,"%s: ",Progname);
X	vfprintf(stderr,fmt,pvar);
X	fprintf(stderr,"\n");
X	va_end(pvar);
X}
X
X/* VARARGS1 - like printf */
XFatal(va_alist)     /* print message and exit */
Xva_dcl
X{
X	va_list pvar;
X	char *fmt;
X
X	va_start(pvar);
X	fmt = va_arg(pvar,char *);
X	fprintf(stderr,"%s: ",Progname);
X	vfprintf(stderr,fmt,pvar);
X	fprintf(stderr,"\n");
X	va_end(pvar);
X	exit(1);
X}
X
Xint		/* returns index or -1 if not found */
XfindTartan(name)
Xchar *name;
X{
X	int i;
X
X	for (i=0; i<TartanTabSize; i++) {
X		if (strcmp(TartanTab[i].name,TartanName)==0)
X			return i;
X	}
X	return -1;
X}
X
XsetTartanName(s)
Xchar *s;
X{
X	TartanName = s;
X}
X
XsetTartan(n)
Xint n;
X{
X	char tbuf[1000];
X	TartanInfo *ti;
X
X	if (n<0 || n>=TartanTabSize) {
X		Bell();
X		return;
X	}
X	TartanIndex = n;
X	TartanName = TartanTab[TartanIndex].name;
X	ti = TartanTab + TartanIndex;
X	ti->bgpixel = c_pixel(translate_color(ti->bgcolor));
X	setTartColors(&(ti->hstripes));
X	setTartColors(&(ti->vstripes));
X	sprintf(tbuf,"%s %s",Progname,TartanName);
X	XStoreName(dpy,win,tbuf);
X	redraw();
X}
X
XsetTartColors(sinf)
XSinfo *sinf;
X{
X	int i;
X	char *colorname;
X
X	if (sinf->flags & HVSAME) return;
X	for (i=0; sinf->slist[i].color; i++) {
X		colorname = sinf->slist[i].color;
X		colorname = translate_color(colorname);
X		sinf->slist[i].pixel = c_pixel(colorname);
X	}
X}
X
XListTartans()
X{
X	int i,l,d;
X
X	printf("Known tartans are:\n");
X	l = 0;
X	for (i=0; i<TartanTabSize; i++) {
X		d = strlen(TartanTab[i].name)+1;
X		if (l+d>=80) {
X			printf("\n");
X			l = 0;
X		}
X		printf(" %s",TartanTab[i].name);
X		l += d;
X	}
X	printf("\n");
X}
X
XPrintTartan(n)
Xint n;
X{
X	TartanInfo *ti;
X
X	ti = TartanTab+n;
X	printf("Name: %s\n", ti->name);
X	printf("Background color: %s\n", ti->bgcolor);
X	PrintStripes(&(ti->hstripes),"Horizontal");
X	PrintStripes(&(ti->vstripes),"Vertical");
X}
X
XPrintStripes(si,dirname)
XSinfo *si;
Xchar *dirname;
X{
X	int flags;
X	S1info *s1i;
X	int i;
X
X	flags = si->flags;
X	if (flags & HVSAME) {
X		printf("Vertical and Horizontal stripes are the same\n");
X		return;
X	}
X	printf("%s stripes%s:\n", dirname,
X	    (flags&SYM)?" (symmetrical pattern)":"");
X	for (i=0; si->slist[i].color; i++) {
X		s1i = si->slist+i;
X		printf("%s, %d, %X\n", s1i->color, s1i->width, s1i->style);
X	}
X}
X
X/* end */
END_OF_misc.c
if test 2814 -ne `wc -c <misc.c`; then
    echo shar: \"misc.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f setrootbg.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"setrootbg.c\"
else
echo shar: Extracting \"setrootbg.c\" \(1097 characters\)
sed "s/^X//" >setrootbg.c <<'END_OF_setrootbg.c'
X/* setrootbg.c - makes the current root background permanent
X *
X * 24.Oct.89  jimmc  Initial definition (borrowed from xsetroot)
X */
X
X#include <X11/Xlib.h>
X#include <X11/Xatom.h>
X#include "xtartan.h"	/* pick up externs */
X
X#define Dynamic 1
X
Xsetrootbg() {
X	Atom prop,type;
X	int format;
X	unsigned long length,after;
X	unsigned char *data;
X
X	/* for root window, get rid of old root pixmap and colors
X	 * and save new pixmap and colors.
X	 * (this code borrowed from xsetroot)
X	 */
X	if (DefaultVisualOfScreen(screen)->class & Dynamic) {
X		prop = XInternAtom(dpy,"_XSETROOT_ID",False);
X		XGetWindowProperty(dpy,rootwin,prop,0L,1L,True,
X			AnyPropertyType,
X			&type,&format,&length,&after,&data);
X		if ((type == XA_PIXMAP) && (format == 32) &&
X		    (length == 1) && (after == 0))
X			XKillClient(dpy, *((Pixmap *)data));
X				/* zap old colors */
X		else if (type != None)
X			Warn("_XSETROOT_ID property is garbage");
X		/* save colors used in pixmap */
X		XChangeProperty(dpy,rootwin,prop,XA_PIXMAP,32,
X			PropModeReplace,(unsigned char *)&drw,1);
X		XSetCloseDownMode(dpy, RetainPermanent);
X	}
X}
X
X/* end */
END_OF_setrootbg.c
if test 1097 -ne `wc -c <setrootbg.c`; then
    echo shar: \"setrootbg.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0



More information about the Comp.sources.x mailing list