v01i021: xmille: Mille Bourne for X, Part04/18

Mike Wexler mikew at wyse.wyse.com
Thu Sep 8 12:05:09 AEST 1988


Submitted-by: dana at thumper.bellcore.com
Posting-number: Volume 1, Issue 21
Archive-name: xmille/part04

[Oops!  I screwed up. I left out the control and cards directories
from my prior posting.  Anyway xmille really has 18 parts. -mcw]
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 15)."
# Contents:  cards cards/100.c cards/200.c cards/25.c cards/50.c
#   cards/75.c cards/Makefile cards/_go cards/accident.c cards/ace.c
#   cards/background.h cards/blank.c cards/color.h cards/deck.c
#   cards/display.c cards/end.c cards/extra.c cards/flat.c cards/gas.c
#   cards/go.c cards/makefile cards/out.c cards/out.h cards/puncture.c
#   cards/repairs.c cards/right.c cards/spare.c cards/speed.c
#   cards/stop.c control control/Makefile control/affirm.c
#   control/button.c control/co_class.h control/control.h
#   control/dispatch.c control/init.c control/prompted.c
# Wrapped by mikew at wyse on Wed Sep  7 18:59:23 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test ! -d cards ; then
    echo shar: Creating directory \"cards\"
    mkdir cards
fi
if test -f cards/100.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/100.c\"
else
echo shar: Extracting \"cards/100.c\" \(33 characters\)
sed "s/^X//" >cards/100.c <<'END_OF_cards/100.c'
X# define static
X# include	"_100"
END_OF_cards/100.c
if test 33 -ne `wc -c <cards/100.c`; then
    echo shar: \"cards/100.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/200.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/200.c\"
else
echo shar: Extracting \"cards/200.c\" \(33 characters\)
sed "s/^X//" >cards/200.c <<'END_OF_cards/200.c'
X# define static
X# include	"_200"
END_OF_cards/200.c
if test 33 -ne `wc -c <cards/200.c`; then
    echo shar: \"cards/200.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/25.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/25.c\"
else
echo shar: Extracting \"cards/25.c\" \(55 characters\)
sed "s/^X//" >cards/25.c <<'END_OF_cards/25.c'
X# define static
X# include	"_25"
X# include	"miles_mask"
END_OF_cards/25.c
if test 55 -ne `wc -c <cards/25.c`; then
    echo shar: \"cards/25.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/50.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/50.c\"
else
echo shar: Extracting \"cards/50.c\" \(32 characters\)
sed "s/^X//" >cards/50.c <<'END_OF_cards/50.c'
X# define static
X# include	"_50"
END_OF_cards/50.c
if test 32 -ne `wc -c <cards/50.c`; then
    echo shar: \"cards/50.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/75.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/75.c\"
else
echo shar: Extracting \"cards/75.c\" \(32 characters\)
sed "s/^X//" >cards/75.c <<'END_OF_cards/75.c'
X# define static
X# include	"_75"
END_OF_cards/75.c
if test 32 -ne `wc -c <cards/75.c`; then
    echo shar: \"cards/75.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/Makefile -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/Makefile\"
else
echo shar: Extracting \"cards/Makefile\" \(1124 characters\)
sed "s/^X//" >cards/Makefile <<'END_OF_cards/Makefile'
X.PRECIOUS: cardlib.a
XOFILES=	accident.o repairs.o ace.o\
X	flat.o spare.o puncture.o\
X	out.o gas.o extra.o\
X 	stop.o go.o speed.o end.o right.o\
X	25.o 50.o 75.o 100.o 200.o\
X 	deck.o blank.o
X
Xcardlib.a: $(OFILES)
X#	ar cr $@ $?
X#	ranlib $@
X
Xdisplay: display.o cardlib.a
X	$(CC) -o display display.o cardlib.a -lX
X
Xclean:
X	rm -f $(OFILES) cardlib.a
X
Xaccident.o: accident accident_mask
X	cc -c accident.c
Xrepairs.o: repairs repairs_mask
X	cc -c repairs.c
Xace.o: ace ace_mask
X	cc -c ace.c
X
Xflat.o: flat flat_mask
X	cc -c flat.c
Xspare.o: spare spare_mask
X	cc -c spare.c
Xpuncture.o: puncture puncture_mask
X	cc -c puncture.c
X
Xout.o: out out_mask
X	cc -c out.c
Xgas.o: gas gas_mask
X	cc -c gas.c
Xextra.o: extra extra_mask
X	cc -c extra.c
X
Xstop.o: stop stop_mask
X	cc -c stop.c
Xgo.o: go go_mask
X	cc -c go.c
Xspeed.o: speed speed_mask
X	cc -c speed.c
Xend.o: end end_mask
X	cc -c end.c
Xright.o: right right_mask
X	cc -c right.c
X
X25.o: _25 miles_mask
X	cc -c 25.c
X50.o: _50
X	cc -c 50.c
X75.o: _75
X	cc -c 75.c
X100.o: _100
X	cc -c 100.c
X200.o: _200
X	cc -c 200.c
X
Xdeck.o: deck_mask deck_red deck_blue deck_both
X	cc -c deck.c
X
Xblank.o: blank
X	cc -c blank.c
END_OF_cards/Makefile
if test 1124 -ne `wc -c <cards/Makefile`; then
    echo shar: \"cards/Makefile\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/_go -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/_go\"
else
echo shar: Extracting \"cards/_go\" \(12259 characters\)
sed "s/^X//" >cards/_go <<'END_OF_cards/_go'
X#define go_width 100
X#define go_height 150
Xstatic char go_bits[] = {
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0xf0, 0x03, 0x00, 0x00, 0xe0, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0x08, 0x04, 0x00, 0x00, 0xf8,
X   0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0x04, 0x08, 0x00, 0x00,
X   0xfc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x08, 0x00,
X   0x00, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x08,
X   0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04,
X   0x08, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00,
X   0x04, 0x08, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
X   0x00, 0x04, 0x08, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x20, 0x00, 0x04, 0x08, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x20, 0x00, 0x04, 0x08, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x20, 0x70, 0x04, 0x08, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x20, 0x40, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0x04, 0x08, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x04, 0x08, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0x08, 0x04, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0xf0, 0x03,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x07, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x07, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x07,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
X   0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
X   0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x03,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
X   0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
END_OF_cards/_go
if test 12259 -ne `wc -c <cards/_go`; then
    echo shar: \"cards/_go\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/accident.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/accident.c\"
else
echo shar: Extracting \"cards/accident.c\" \(66 characters\)
sed "s/^X//" >cards/accident.c <<'END_OF_cards/accident.c'
X# define static 
X# include "_accident"
X# include "accident_mask"
X
END_OF_cards/accident.c
if test 66 -ne `wc -c <cards/accident.c`; then
    echo shar: \"cards/accident.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/ace.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/ace.c\"
else
echo shar: Extracting \"cards/ace.c\" \(54 characters\)
sed "s/^X//" >cards/ace.c <<'END_OF_cards/ace.c'
X# define static
X# include	"_ace"
X# include	"ace_mask"
END_OF_cards/ace.c
if test 54 -ne `wc -c <cards/ace.c`; then
    echo shar: \"cards/ace.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/background.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/background.h\"
else
echo shar: Extracting \"cards/background.h\" \(72 characters\)
sed "s/^X//" >cards/background.h <<'END_OF_cards/background.h'
X# include	"fill"
X
X# define	HEIGHT	fill_height
X# define	WIDTH	fill_width
END_OF_cards/background.h
if test 72 -ne `wc -c <cards/background.h`; then
    echo shar: \"cards/background.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/blank.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/blank.c\"
else
echo shar: Extracting \"cards/blank.c\" \(35 characters\)
sed "s/^X//" >cards/blank.c <<'END_OF_cards/blank.c'
X# define static
X# include	"_blank"
END_OF_cards/blank.c
if test 35 -ne `wc -c <cards/blank.c`; then
    echo shar: \"cards/blank.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/color.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/color.h\"
else
echo shar: Extracting \"cards/color.h\" \(212 characters\)
sed "s/^X//" >cards/color.h <<'END_OF_cards/color.h'
X/*
X * color.h
X *
X * definitions for standard colors
X */
X
X# define BLACK_COLOR	0
X# define WHITE_COLOR	1
X# define RED_COLOR	2
X# define GREEN_COLOR	3
X# define GREY_COLOR	4
X# define BLUE_COLOR	5
X# define NUM_COLOR	6
END_OF_cards/color.h
if test 212 -ne `wc -c <cards/color.h`; then
    echo shar: \"cards/color.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/deck.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/deck.c\"
else
echo shar: Extracting \"cards/deck.c\" \(102 characters\)
sed "s/^X//" >cards/deck.c <<'END_OF_cards/deck.c'
X# define	static
X# include	"deck_mask"
X# include	"deck_red"
X# include	"deck_blue"
X#include	"deck_both"
END_OF_cards/deck.c
if test 102 -ne `wc -c <cards/deck.c`; then
    echo shar: \"cards/deck.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/display.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/display.c\"
else
echo shar: Extracting \"cards/display.c\" \(3934 characters\)
sed "s/^X//" >cards/display.c <<'END_OF_cards/display.c'
X# include	<X/Xlib.h>
X# include	"background.h"
X# include	"color.h"
X
Xstruct color {
X	char	*name;
X	int	pixel;
X};
X
Xstruct color colorMap[NUM_COLOR] = {
X	"black",	0,
X	"white",	0,
X	"red",		0,
X	"green",	0,
X	"light gray",	0,
X	"blue",		0,
X};
X
Xstruct card_init {
X	short	*bits;
X	short	*mask;
X	int	color;
X};
X
Xextern short	go_bits[], go_mask_bits[];
Xextern short	stop_bits[], stop_mask_bits[];
Xextern short	right_bits[], right_mask_bits[];
Xextern short	speed_bits[], speed_mask_bits[];
Xextern short	end_bits[], end_mask_bits[];
Xextern short	accident_bits[], accident_mask_bits[];
Xextern short	repairs_bits[], repairs_mask_bits[];
Xextern short	ace_bits[], ace_mask_bits[];
Xextern short	flat_bits[], flat_mask_bits[];
Xextern short	spare_bits[], spare_mask_bits[];
Xextern short	puncture_bits[], puncture_mask_bits[];
Xextern short	out_bits[], out_mask_bits[];
Xextern short	gas_bits[], gas_mask_bits[];
Xextern short	extra_bits[], extra_mask_bits[];
Xextern short	miles_mask_bits[];
Xextern short	_25_bits[], _50_bits[], _75_bits[], _100_bits[], _200_bits[];
X
Xstruct card_init card_inits[] = {
X{
X	go_bits,
X	go_mask_bits,
X	GREEN_COLOR,
X},
X{
X	stop_bits,
X	stop_mask_bits,
X	RED_COLOR,
X},
X{
X	right_bits,
X	right_mask_bits,
X	RED_COLOR,
X},
X{
X	speed_bits,
X	speed_mask_bits,
X	RED_COLOR,
X},
X{
X	end_bits,
X	end_mask_bits,
X	GREEN_COLOR,
X},
X{
X	accident_bits,
X	accident_mask_bits,
X	RED_COLOR,
X},
X{
X	repairs_bits,
X	repairs_mask_bits,
X	GREEN_COLOR,
X},
X{
X	ace_bits,
X	ace_mask_bits,
X	BLUE_COLOR,
X},
X{
X	flat_bits,
X	flat_mask_bits,
X	RED_COLOR,
X},
X{
X	spare_bits,
X	spare_mask_bits,
X	GREEN_COLOR,
X},
X{
X	puncture_bits,
X	puncture_mask_bits,
X	BLUE_COLOR,
X},
X{
X	out_bits,
X	out_mask_bits,
X	RED_COLOR,
X},
X{
X	gas_bits,
X	gas_mask_bits,
X	GREEN_COLOR,
X},
X{
X	extra_bits,
X	extra_mask_bits,
X	BLUE_COLOR,
X},
X{
X	_25_bits,
X	miles_mask_bits,
X	BLUE_COLOR,
X},
X{
X	_50_bits,
X	miles_mask_bits,
X	BLUE_COLOR,
X},
X{
X	_75_bits,
X	miles_mask_bits,
X	BLUE_COLOR,
X},
X{
X	_100_bits,
X	miles_mask_bits,
X	BLUE_COLOR,
X},
X{
X	_200_bits,
X	miles_mask_bits,
X	BLUE_COLOR,
X},
X};
X
X# define NUM_CARDS	(sizeof (card_inits) / sizeof (card_inits[0]))
X
Xstruct plane {
X	Bitmap	bits;
X	int	pixel;
X};
X
Xstruct card {
X	int	nPlanes;
X	struct plane	planes[5];
X};
X
Xstruct card cards[NUM_CARDS];
X
XWindow	w;
X
X# define WINDOW_WIDTH	1000
X# define WINDOW_HEIGHT	700
X
Xmain ()
X{
X	Color	hardware_color, exact_color;
X	XEvent	rep;
X	Bitmap	fill;
X	Pixmap	background;
X	Pixmap	border;
X	int	i;
X
X	XOpenDisplay ("");
X	for (i = 0; i < NUM_COLOR; i++) {
X		XGetColor (colorMap[i].name, &hardware_color, &exact_color);
X		colorMap[i].pixel = hardware_color.pixel;
X	}
X	fill = XStoreBitmap (WIDTH, HEIGHT, fill_bits);
X	for (i = 0; i < NUM_CARDS; i++) {
X		cards[i].planes[2].bits = XStoreBitmap (WIDTH, HEIGHT, card_inits[i].bits);
X		cards[i].planes[2].pixel = colorMap[card_inits[i].color].pixel;
X		cards[i].planes[1].bits = XStoreBitmap (WIDTH, HEIGHT, card_inits[i].mask);
X		cards[i].planes[1].pixel = colorMap[BLACK_COLOR].pixel;
X		cards[i].planes[0].bits = fill;
X		cards[i].planes[0].pixel = colorMap[WHITE_COLOR].pixel;
X		cards[i].nPlanes = 3;
X	}
X	background = XMakePixmap (0, colorMap[GREY_COLOR].pixel, colorMap[WHITE_COLOR].pixel);
X	border = XMakePixmap (0, colorMap[WHITE_COLOR].pixel, colorMap[GREY_COLOR].pixel);
X	w = XCreateWindow (RootWindow, 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, 1,
X		WhitePixmap, background);
X	XMapWindow (w);
X	XSelectInput (w, ExposeWindow);
X	displayAll ();
X	for (;;) {
X		XNextEvent (&rep);
X		switch (rep.type) {
X		case ExposeWindow:
X			displayAll ();
X			break;
X		}
X	}
X}
X
XdisplayAll ()
X{
X	struct card	*card;
X	int		x, y;
X	int		i;
X
X	x = 10;
X	y = 10;
X	for (i = 0; i < NUM_CARDS; i++) {
X		displayOne (&cards[i], x, y);
X		x += WIDTH + 20;
X		if (x + WIDTH > WINDOW_WIDTH) {
X			x = 10;
X			y += HEIGHT + 20;
X		}
X	}
X	XFlush ();
X}
X
XdisplayOne (card, x, y)
Xstruct card	*card;
Xint		x, y;
X{
X	int	i;
X
X	for (i = 0; i < card->nPlanes; i++) {
X		XPixFill (w, x, y, WIDTH, HEIGHT,
X			card->planes[i].pixel, card->planes[i].bits, GXcopy, AllPlanes);
X	}
X}
END_OF_cards/display.c
if test 3934 -ne `wc -c <cards/display.c`; then
    echo shar: \"cards/display.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/end.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/end.c\"
else
echo shar: Extracting \"cards/end.c\" \(54 characters\)
sed "s/^X//" >cards/end.c <<'END_OF_cards/end.c'
X# define static
X# include "_end"
X# include "end_mask"
END_OF_cards/end.c
if test 54 -ne `wc -c <cards/end.c`; then
    echo shar: \"cards/end.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/extra.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/extra.c\"
else
echo shar: Extracting \"cards/extra.c\" \(58 characters\)
sed "s/^X//" >cards/extra.c <<'END_OF_cards/extra.c'
X# define static
X# include	"_extra"
X# include	"extra_mask"
END_OF_cards/extra.c
if test 58 -ne `wc -c <cards/extra.c`; then
    echo shar: \"cards/extra.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/flat.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/flat.c\"
else
echo shar: Extracting \"cards/flat.c\" \(56 characters\)
sed "s/^X//" >cards/flat.c <<'END_OF_cards/flat.c'
X# define static
X# include	"_flat"
X# include	"flat_mask"
END_OF_cards/flat.c
if test 56 -ne `wc -c <cards/flat.c`; then
    echo shar: \"cards/flat.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/gas.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/gas.c\"
else
echo shar: Extracting \"cards/gas.c\" \(54 characters\)
sed "s/^X//" >cards/gas.c <<'END_OF_cards/gas.c'
X# define static
X# include	"_gas"
X# include	"gas_mask"
END_OF_cards/gas.c
if test 54 -ne `wc -c <cards/gas.c`; then
    echo shar: \"cards/gas.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/go.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/go.c\"
else
echo shar: Extracting \"cards/go.c\" \(52 characters\)
sed "s/^X//" >cards/go.c <<'END_OF_cards/go.c'
X# define static
X# include	"_go"
X# include	"go_mask"
END_OF_cards/go.c
if test 52 -ne `wc -c <cards/go.c`; then
    echo shar: \"cards/go.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/makefile -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/makefile\"
else
echo shar: Extracting \"cards/makefile\" \(810 characters\)
sed "s/^X//" >cards/makefile <<'END_OF_cards/makefile'
XOFILES=	accident.o repairs.o ace.o\
X	flat.o spare.o puncture.o\
X	out.o gas.o extra.o\
X 	stop.o go.o speed.o end.o right.o\
X	25.o 50.o 75.o 100.o 200.o\
X 	deck.o blank.o
X
Xcardlib.a: $(OFILES)
X	ar cr $@ $?
X	ranlib $@
X
Xdisplay: display.o cardlib.a
X	$(CC) -o display display.o cardlib.a -lX
X
Xclean:
X	rm -f $(OFILES) cardlib.a
X
Xaccident.o: _accident accident_mask
Xrepairs.o: _repairs repairs_mask
Xace.o: _ace ace_mask
X
Xflat.o: _flat flat_mask
Xspare.o: _spare spare_mask
Xpuncture.o: _puncture puncture_mask
X
Xout.o: _out out_mask
Xgas.o: _gas gas_mask
Xextra.o: _extra extra_mask
X
Xstop.o: _stop stop_mask
Xgo.o: _go go_mask
Xspeed.o: _speed speed_mask
Xend.o: _end end_mask
Xright.o: _right right_mask
X
X25.o: _25 miles_mask
X50.o: _50
X75.o: _75
X100.o: _100
X200.o: _200
X
Xdeck.o: deck_mask deck_red deck_blue
X
Xblank.o: _blank
END_OF_cards/makefile
if test 810 -ne `wc -c <cards/makefile`; then
    echo shar: \"cards/makefile\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/out.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/out.c\"
else
echo shar: Extracting \"cards/out.c\" \(54 characters\)
sed "s/^X//" >cards/out.c <<'END_OF_cards/out.c'
X# define static
X# include "_out"
X# include "out_mask"
END_OF_cards/out.c
if test 54 -ne `wc -c <cards/out.c`; then
    echo shar: \"cards/out.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/out.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/out.h\"
else
echo shar: Extracting \"cards/out.h\" \(53 characters\)
sed "s/^X//" >cards/out.h <<'END_OF_cards/out.h'
X# define static
X# include "out"
X# include "out_mask"
END_OF_cards/out.h
if test 53 -ne `wc -c <cards/out.h`; then
    echo shar: \"cards/out.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/puncture.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/puncture.c\"
else
echo shar: Extracting \"cards/puncture.c\" \(65 characters\)
sed "s/^X//" >cards/puncture.c <<'END_OF_cards/puncture.c'
X# define static
X# include 	"_puncture"
X# include	"puncture_mask"
END_OF_cards/puncture.c
if test 65 -ne `wc -c <cards/puncture.c`; then
    echo shar: \"cards/puncture.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/repairs.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/repairs.c\"
else
echo shar: Extracting \"cards/repairs.c\" \(62 characters\)
sed "s/^X//" >cards/repairs.c <<'END_OF_cards/repairs.c'
X# define static
X# include	"_repairs"
X# include	"repairs_mask"
END_OF_cards/repairs.c
if test 62 -ne `wc -c <cards/repairs.c`; then
    echo shar: \"cards/repairs.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/right.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/right.c\"
else
echo shar: Extracting \"cards/right.c\" \(58 characters\)
sed "s/^X//" >cards/right.c <<'END_OF_cards/right.c'
X# define static
X# include	"_right"
X# include	"right_mask"
END_OF_cards/right.c
if test 58 -ne `wc -c <cards/right.c`; then
    echo shar: \"cards/right.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/spare.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/spare.c\"
else
echo shar: Extracting \"cards/spare.c\" \(58 characters\)
sed "s/^X//" >cards/spare.c <<'END_OF_cards/spare.c'
X# define static
X# include	"_spare"
X# include	"spare_mask"
END_OF_cards/spare.c
if test 58 -ne `wc -c <cards/spare.c`; then
    echo shar: \"cards/spare.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/speed.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/speed.c\"
else
echo shar: Extracting \"cards/speed.c\" \(58 characters\)
sed "s/^X//" >cards/speed.c <<'END_OF_cards/speed.c'
X# define static
X# include "_speed"
X# include "speed_mask"
END_OF_cards/speed.c
if test 58 -ne `wc -c <cards/speed.c`; then
    echo shar: \"cards/speed.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cards/stop.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"cards/stop.c\"
else
echo shar: Extracting \"cards/stop.c\" \(56 characters\)
sed "s/^X//" >cards/stop.c <<'END_OF_cards/stop.c'
X# define static
X# include	"_stop"
X# include	"stop_mask"
END_OF_cards/stop.c
if test 56 -ne `wc -c <cards/stop.c`; then
    echo shar: \"cards/stop.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test ! -d control ; then
    echo shar: Creating directory \"control\"
    mkdir control
fi
if test -f control/Makefile -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"control/Makefile\"
else
echo shar: Extracting \"control/Makefile\" \(362 characters\)
sed "s/^X//" >control/Makefile <<'END_OF_control/Makefile'
X.PRECIOUS: control.a
XHDRS =	control.h co_class.h
XCFLAGS = -g -I/usr/local/pkg/X11/include
X
XOFILES =	button.o scrollbar.o init.o affirm.o dispatch.o prompted.o
X
XSRCCOMMON =	button.c scrollbar.c init.c affirm.c dispatch.c prompted.c
X
Xcontrol.a : $(OFILES)
X	ar cr $@ $?
X	ranlib $@
X
Xcontrol.o : $(OFILES)
X	$(LD) -r -o $@ $(OFILES)
X
Xclean:
X	rm -f $(OFILES) control.a
END_OF_control/Makefile
if test 362 -ne `wc -c <control/Makefile`; then
    echo shar: \"control/Makefile\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f control/affirm.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"control/affirm.c\"
else
echo shar: Extracting \"control/affirm.c\" \(2668 characters\)
sed "s/^X//" >control/affirm.c <<'END_OF_control/affirm.c'
X/*
X * affirm.c
X *
X * affirm an action (yes/no)
X */
X
X# include	<X11/Xlib.h>
X# include	"control.h"
X# include	"co_class.h"
X# include	<sys/time.h>
X# include	<assert.h>
X
X/*
X *	affirm window on screen
X */
X
X# define AFFIRM_Y	350
X# define AFFIRM_X	200
X# define AFFIRM_HP	50	/* padding */
X# define MIN_AFFIRM_W	(CANCEL_X + 80)
X# define LABEL_Y	25
X
X# define OK_X		(10)
X# define OK_Y		(AFFIRM_HP)
X# define CANCEL_X	(OK_X + 100)
X# define CANCEL_Y	(OK_Y)
X
X# define TEXT_OFF	5
X
Xextern int	co_inited;
Xstatic char	*label;
Xstatic int	affirm_h, affirm_w, label_x;
Xstatic Window	affirm, ok, cancel;
Xextern	GC	co_fore_gc;
Xstatic int	OKstate, CANCELstate;
X
Xint
Xco_affirm(title, parent)
Xchar	*title;
XWindow	parent;
X{
X	XEvent		rep;
X	int		state, affirm_x;
X	int		label_w;
X	int		co_OKstate (), co_CANCELstate (), co_affirmEvent (), CmanageButton ();
X	int		mask;
X
X	if (!co_inited)
X		co_init();
X	label = title;
X	label_w = XTextWidth(co_font, label, strlen(label));
X
X	if (MIN_AFFIRM_W+10 >= label_w)
X		affirm_w = MIN_AFFIRM_W+10;
X	else
X		affirm_w = label_w + 10;
X
X	OKstate = 0;
X	CANCELstate = 0;
X	label_x = affirm_w / 2 - label_w / 2;
X	affirm_h = CANCEL_Y + 60;
X	affirm_x = AFFIRM_X - affirm_w/2;
X	affirm = XCreateSimpleWindow (dpy, parent, affirm_x, AFFIRM_Y,
X			affirm_w, affirm_h, 1, co_border, co_background);
X	
X	ok = CmapButton (affirm, OK_X, OK_Y, co_OK, co_OKstate);
X	cancel = CmapButton (affirm, CANCEL_X, CANCEL_Y, co_CANCEL, co_CANCELstate);
X	bindEvent (affirm, ExposureMask, co_affirmEvent);
X	bindEvent (ok, ExposureMask|ButtonPressMask|ButtonReleaseMask|
X			Button1MotionMask|Button2MotionMask|Button3MotionMask|LeaveWindowMask, CmanageButton);
X	bindEvent (cancel, ExposureMask|ButtonPressMask|ButtonReleaseMask|
X			Button1MotionMask|Button2MotionMask|Button3MotionMask|LeaveWindowMask,
X			CmanageButton);
X	XMapWindow (dpy, affirm);
X
X	while (!OKstate && !CANCELstate) {
X		dispatch ();
X	}
X
X	unbindEvent (affirm, ExposureMask);
X	unbindEvent (ok, ExposureMask|ButtonPressMask|ButtonReleaseMask|
X			Button1MotionMask|Button2MotionMask|Button3MotionMask|LeaveWindowMask);
X	unbindEvent (cancel, ExposureMask|ButtonPressMask|ButtonReleaseMask|
X			Button1MotionMask|Button2MotionMask|Button3MotionMask|LeaveWindowMask);
X	XUnmapWindow (dpy, affirm);
X	CunmapButton (cancel);
X	CunmapButton (ok);
X	XDestroyWindow (dpy, affirm);
X	if (CANCELstate)
X		return 0;
X	if (OKstate)
X		return 1;
X}
X
Xco_affirmEvent (rep)
XXEvent	*rep;
X{
X	switch (rep->type) {
X	case Expose:
X		redisplayLabel ();
X	}
X}
X
Xco_OKstate (n)
X{
X	OKstate = 1;
X}
X
Xco_CANCELstate (n)
X{
X	CANCELstate = 1;
X}
X
Xstatic
XredisplayLabel ()
X{
X	XDrawImageString (dpy, affirm, co_fore_gc, label_x, LABEL_Y,
X			  label, strlen (label));
X	XFlush (dpy);
X}
END_OF_control/affirm.c
if test 2668 -ne `wc -c <control/affirm.c`; then
    echo shar: \"control/affirm.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f control/button.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"control/button.c\"
else
echo shar: Extracting \"control/button.c\" \(4279 characters\)
sed "s/^X//" >control/button.c <<'END_OF_control/button.c'
X/*
X *	button.c
X */
X
X# include	<X11/Xlib.h>
X# include	<X11/Xutil.h>
X# include	"control.h"
X
Xextern	Display	*dpy;
X
Xstruct button {
X	Button	button;
X	int	width, height;
X	int	x, y;
X	GC	gc;
X	long	backcolor;
X	int	borderwidth;
X	int	npoints;
X	XPoint	*points;
X	char	*text;
X};
X
Xstruct perwindow {
X	struct button	*b;
X	Window		wd;
X	int		(*notify)();
X	int		state;
X};
X
Xstatic XContext	assocContext;
Xstatic XContext	perwindowContext;
Xstatic int		nextButton;
X
XButton
XCcreateButton (text, width, gc, font, backcolor, borderwidth)
Xchar		*text;
Xint		width;
XGC		gc;
XXFontStruct	*font;
Xlong		backcolor;
Xint		borderwidth;
X{
X	char		*malloc ();
X	struct button	*b;
X	int		round, off;
X	int		hround;
X	int		twidth;
X	int		height;
X	
X	if (!assocContext)
X		assocContext = XUniqueContext();
X	b = (struct button *) malloc (sizeof (struct button));
X	b->button = nextButton;
X	XSaveContext (dpy, assocContext, nextButton++, (char *) b);
X	height = font->ascent + font->descent;
X	twidth = XTextWidth (font, text, strlen(text));
X	if (width <= 0)
X		b->width = twidth + font->max_bounds.width * 2;
X	else
X		b->width = width;
X	b->height = height * 2;
X	b->x = b->width / 2 - twidth / 2;
X	b->y = height + font->descent/*/2*/;
X	b->text = text;
X	b->gc = gc;
X	b->backcolor = backcolor;
X	b->borderwidth = borderwidth;
X	b->npoints = 9;
X	b->points = (XPoint *) malloc (sizeof (XPoint) * 9);
X
X	round = b->height / 8;
X	off = borderwidth;
X
X	b->points[0].x = round;
X	b->points[0].y = 0;
X
X	b->points[1].x = (b->width - off) - round;
X	b->points[1].y = 0;
X
X	b->points[2].x = (b->width - off);
X	b->points[2].y = round;
X
X	b->points[3].x = (b->width - off);
X	b->points[3].y = (b->height - off) - round;
X
X	b->points[4].x = (b->width - off) - round;
X	b->points[4].y = (b->height - off);
X
X	b->points[5].x = round;
X	b->points[5].y = (b->height - off);
X
X	b->points[6].x = 0;
X	b->points[6].y = (b->height - off) - round;
X
X	b->points[7].x = 0;
X	b->points[7].y = round;
X
X	b->points[8].x = round;
X	b->points[8].y = 0;
X
X	return b->button;
X}
X
XWindow
XCmapButton (parent, x, y, button, notify)
XWindow	parent;
Xint	x, y;
XButton	button;
Xint	(*notify)();
X{
X	struct button		*b;
X	struct perwindow	*p;
X	Window			w;
X
X	if( XFindContext (dpy, assocContext, button, &b) )
X		return 0;
X	
X	w = XCreateSimpleWindow (dpy, parent, x, y, b->width, b->height,
X		0, 0, b->backcolor);
X	if (!w)
X		return 0;
X	XMapWindow (dpy, w);
X	if (!perwindowContext)
X		perwindowContext = XUniqueContext();
X	p = (struct perwindow *) malloc (sizeof (struct perwindow));
X	XSaveContext (dpy, perwindowContext, w, (char *) p);
X	p->b = b;
X	p->wd = w;
X	p->notify = notify;
X	p->state = 0;
X	buttonOff (w, b, p);
X	return w;
X}
X
XCunmapButton (w)
XWindow	w;
X{
X	struct button	*b;
X	struct perwindow	*p;
X
X	if( XFindContext (dpy, perwindowContext, w, &p) )
X		return 0;
X	XDeleteContext (dpy, perwindowContext, w);
X	free (p);
X	XDestroyWindow (dpy, w);
X	return 1;
X}
X
XCmanageButton (rep)
XXAnyEvent	*rep;
X{
X	struct perwindow	*p;
X	struct button		*b;
X	XMotionEvent		*me;
X	Window			w;
X
X	w = rep->window;
X	if( XFindContext (dpy, perwindowContext, w, &p) )
X		return 0;
X	b = p->b;
X	switch (rep->type) {
X	case Expose:
X		if (p->state)
X			buttonOn (w, b, p);
X		else
X			buttonOff (w, b, p);
X		break;
X	case ButtonPress:
X		buttonOn (w, b, p);
X		p->state = 1;
X		break;
X	case ButtonRelease:
X		if (p->state)
X			p->notify (w);
X		p->state = 0;
X		break;
X	case MotionNotify:
X		me = (XMotionEvent *) rep;
X		if (me->x < 0 || me->x > b->width ||
X		    me->y < 0 || me->y > b->height)
X		if (p->state) {
X			buttonOff (w, b, p);
X			p->state = 0;
X		}
X		break;
X	case LeaveNotify:
X		if (p->state) {
X			buttonOff (w, b, p);
X			p->state = 0;
X		}
X		break;
X	}
X}
X
XCredrawButton (w)
XWindow		w;
X{
X	struct perwindow	*p;
X	struct button		*b;
X
X	if( XFindContext (dpy, perwindowContext, w, &p) )
X		return 0;
X	b = p->b;
X	buttonOff (w, b, p);
X}
X
Xstatic
XbuttonOn (w, b)
XWindow	w;
Xstruct button	*b;
X{
X	XFillPolygon (dpy, w, b->gc, b->points, b->npoints, Complex, CoordModeOrigin);
X	buttonText (w, b, b->gc);
X}
X	
Xstatic
XbuttonOff (w, b)
XWindow	w;
Xstruct button	*b;
X{
X	XClearArea (dpy, w, 0, 0, b->width, b->height, False);
X	XDrawLines (dpy, w, b->gc, b->points, b->npoints, CoordModeOrigin);
X	buttonText (w, b, b->gc);
X}
X
Xstatic
XbuttonText (w, b, gc)
XWindow	w;
Xstruct button	*b;
XGC	gc;
X{
X	XDrawImageString (dpy, w, gc, b->x, b->y, b->text, strlen (b->text));
X}
END_OF_control/button.c
if test 4279 -ne `wc -c <control/button.c`; then
    echo shar: \"control/button.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f control/co_class.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"control/co_class.h\"
else
echo shar: Extracting \"control/co_class.h\" \(292 characters\)
sed "s/^X//" >control/co_class.h <<'END_OF_control/co_class.h'
X/*
X *	object classes used by co routines - private to co!
X */
X
Xextern Button		co_OK, co_CANCEL, co_NEW;
Xextern Scrollbar	co_SCROLL_LEFT_GUI, co_SCROLL_BOTTOM_GUI, co_SCROLL_LEFT_MENU;
Xextern XFontStruct	*co_font;
Xextern int		co_fore, co_back, co_background, co_border;
Xextern Display		*dpy;
X
END_OF_control/co_class.h
if test 292 -ne `wc -c <control/co_class.h`; then
    echo shar: \"control/co_class.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f control/control.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"control/control.h\"
else
echo shar: Extracting \"control/control.h\" \(849 characters\)
sed "s/^X//" >control/control.h <<'END_OF_control/control.h'
X/*
X *	control.h
X *
X *	defines for control manager
X */
X
X# define CONTROL_BUTTON	0		/* named button */
X# define CONTROL_SCROLL	1		/* scroll bar */
X# define CONTROL_RADIO	2		/* radio buttons */
X# define CONTROL_CHECK	3		/* check boxes */
X# define CONTROL_SIZE	4		/* resize box */
X# define CONTROL_EDIT	5		/* text edit box */
X
Xtypedef int	Button;
X
Xtypedef int	Check;
X
Xtypedef int	Editbox;
X
X# define EDIT_VOID	0
X# define EDIT_RETURN	1
X
Xtypedef int	Scrollbar;
X
X# define SCROLL_LEFT	0
X# define SCROLL_TOP	1
X# define SCROLL_RIGHT	2
X# define SCROLL_BOTTOM	3
X
X# define SCROLLWIDTH	25
X
X# define SCROLL_UP_BUTTON	-1
X# define SCROLL_DOWN_BUTTON	-2
X# define SCROLL_UP_AREA		-3
X# define SCROLL_DOWN_AREA	-4
X# define SCROLL_BUTTON_RELEASE	-5
X
X# define SCROLL_EVENTS	(ButtonPressed|ButtonReleased|ExposeWindow| \
X			 RightDownMotion|LeftDownMotion|MiddleDownMotion)
END_OF_control/control.h
if test 849 -ne `wc -c <control/control.h`; then
    echo shar: \"control/control.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f control/dispatch.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"control/dispatch.c\"
else
echo shar: Extracting \"control/dispatch.c\" \(2627 characters\)
sed "s/^X//" >control/dispatch.c <<'END_OF_control/dispatch.c'
X/*
X * dispatch.c
X *
X * pass out X events to appropriate recipiants
X */
X
X# include	<X11/Xlib.h>
X
Xstruct eventGroup {
X	struct eventGroup	*prev;
X	Window			w;
X	unsigned long		e;
X	int			(*f)();
X};
X
Xint	eventToMask[] = {
X	0,
X	0,
X	KeyPressMask,
X	KeyReleaseMask,
X	ButtonPressMask,
X	ButtonReleaseMask,
X	PointerMotionMask | Button1MotionMask | Button2MotionMask
X		| Button3MotionMask | Button4MotionMask | Button5MotionMask
X		| ButtonMotionMask,
X	EnterWindowMask,
X	LeaveWindowMask,
X	FocusChangeMask,
X	FocusChangeMask,
X	KeymapStateMask,
X	ExposureMask,
X			0,
X	VisibilityChangeMask,
X	SubstructureNotifyMask,
X	StructureNotifyMask | SubstructureNotifyMask,
X	StructureNotifyMask | SubstructureNotifyMask,
X	StructureNotifyMask | SubstructureNotifyMask,
X	SubstructureRedirectMask,
X	StructureNotifyMask | SubstructureNotifyMask,
X	StructureNotifyMask | SubstructureNotifyMask,
X	SubstructureRedirectMask,
X	StructureNotifyMask | SubstructureNotifyMask,
X	ResizeRedirectMask,
X	StructureNotifyMask | SubstructureNotifyMask,
X	SubstructureRedirectMask,
X	PropertyChangeMask,
X			0,
X			0,
X			0,
X	ColormapChangeMask,
X	OwnerGrabButtonMask,
X			0,
X			0
X};
X
X
Xstruct eventGroup	*eventStack, *allocGroup();
Xextern	Display		*dpy;
X
XbindEvent (window, eventMask, func)
XWindow		window;
Xunsigned long	eventMask;
Xint		(*func)();
X{
X	struct eventGroup	*g;
X	unsigned long		allEvents;
X
X	g = allocGroup ();
X	g->w = window;
X	g->e = eventMask;
X	g->f = func;
X	g->prev = eventStack;
X	eventStack = g;
X	allEvents = 0;
X	for (g = eventStack; g; g = g->prev)
X		if (g->w == window)
X			allEvents |= g->e;
X	XSelectInput (dpy, window, allEvents);
X}
X
XunbindEvent (window, eventMask)
XWindow		window;
Xunsigned long	eventMask;
X{
X	struct eventGroup	*g, *n, *p;
X	unsigned long		t;
X	unsigned long		remainingEvents;
X
X	n = 0;
X	remainingEvents = 0;
X	for (g = eventStack; g; g = p) {
X		p = g->prev;
X		if (g->w == window) {
X 			if (g->e & eventMask) {
X				t = eventMask;
X				eventMask &= ~g->e;
X				g->e &= ~t;
X			}
X			remainingEvents |= g->e;
X			if (g->e == 0) {
X				if (n)
X					n->prev = p;
X				else
X					eventStack = p;
X				freeGroup (g);
X			}
X		}
X	}
X	XSelectInput (dpy, window, remainingEvents);
X}
X
XsendEvent (rep)
XXAnyEvent	*rep;
X{
X	struct eventGroup	*g;
X	int	type;
X	
X	type = eventToMask[rep->type];
X	for (g = eventStack; g; g = g->prev) {
X		if (rep->window == g->w && (type & g->e)) {
X			g->f (rep);
X			return;
X		}
X	}
X}
X
Xdispatch ()
X{
X	XEvent	event;
X
X	XNextEvent (dpy, &event);
X	sendEvent (&event);
X}
X
Xstatic struct eventGroup *
XallocGroup ()
X{
X	char	*malloc ();
X
X	return (struct eventGroup *) malloc (sizeof (struct eventGroup));
X}
X
XfreeGroup (g)
Xstruct eventGroup	*g;
X{
X	free ((char *) g);
X}
END_OF_control/dispatch.c
if test 2627 -ne `wc -c <control/dispatch.c`; then
    echo shar: \"control/dispatch.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f control/init.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"control/init.c\"
else
echo shar: Extracting \"control/init.c\" \(1746 characters\)
sed "s/^X//" >control/init.c <<'END_OF_control/init.c'
X/*
X * init.c
X */
X
X# include	<X11/Xlib.h>
X# include	"control.h"
X# include	<assert.h>
X# include	"co_class.h"
X# include	<stdio.h>
X
XButton		co_OK, co_CANCEL, co_NEW;
XButton		co_QUIT, co_SAVE;
XScrollbar	co_SCROLL_LEFT_MENU, co_SCROLL_BOTTOM_MENU;
XXFontStruct	*co_font;
Xint		co_fore, co_back, co_background, co_border;
Xint		co_inited;
XGC		co_fore_gc, co_back_gc;
Xextern Display	*dpy;
X
Xco_init ()
X{
X	XColor	hard_def, exact_def;
X	int	screen;
X	Colormap	def_cm;
X	XGCValues	xcv;
X	
X	screen = DefaultScreen(dpy);
X	def_cm = DefaultColormap(dpy, screen);
X	
X/*	ui_getcolors (&co_fore, &co_back, &co_fore, &co_back); */
X#ifdef COLOR
X	XAllocNamedColor (dpy, def_cm, "black", &hard_def, &exact_def);
X	co_fore = co_border = hard_def.pixel;
X	XAllocNamedColor (dpy, def_cm, "white", &hard_def, &exact_def);
X	co_back = co_background = hard_def.pixel;
X#else
X	co_fore = co_border = BlackPixel(dpy, screen);
X	co_back = co_background = WhitePixel(dpy, screen);
X#endif
X	co_font = XLoadQueryFont (dpy, "timrom12b");
X	assert (co_font);
X
X	xcv.font = co_font->fid;
X	xcv.foreground = co_fore;
X	xcv.background = co_back;
X	co_fore_gc = XCreateGC(dpy, RootWindow(dpy, screen),
X			       GCBackground | GCForeground | GCFont, &xcv);
X	
X	xcv.foreground = co_back;
X	xcv.background = co_fore;
X	co_back_gc = XCreateGC(dpy, RootWindow(dpy, screen),
X			       GCBackground | GCForeground | GCFont, &xcv);
X	
X	co_OK = CcreateButton ("OK", 75, co_fore_gc, co_font, co_back, 1);
X	co_CANCEL = CcreateButton ("NO", 75, co_fore_gc, co_font, co_back, 1);
X	co_NEW = CcreateButton ("NEW", 75, co_fore_gc, co_font, co_back, 1);
X	co_QUIT = CcreateButton ("QUIT", 75, co_fore_gc, co_font, co_back, 1);
X	co_SAVE = CcreateButton ("SAVE", 75, co_fore_gc, co_font, co_back, 1);
X	co_inited = 1;
X	return 0;
X}
END_OF_control/init.c
if test 1746 -ne `wc -c <control/init.c`; then
    echo shar: \"control/init.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f control/prompted.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"control/prompted.c\"
else
echo shar: Extracting \"control/prompted.c\" \(4268 characters\)
sed "s/^X//" >control/prompted.c <<'END_OF_control/prompted.c'
X/*
X * prompted.c
X *
X * get a string of text
X */
X
X# include	<X11/Xlib.h>
X# include	"control.h"
X# include	"co_class.h"
X# include	<sys/time.h>
X# include	<assert.h>
X
X/*
X *	prompted window on screen
X */
X
X# define PROMPTED_Y	350
X# define PROMPTED_HP	50	/* padding */
X# define MIN_PROMPTED_W	(TEXTBOX_X + TEXTBOX_W + 20)
X# define TEXTBOX_X	(10)
X# define TEXTBOX_Y	(PROMPTED_HP)
X# define TEXTBOX_W	150
X# define TEXTBOX_VP	(10)
X# define LABEL_Y	25
X
X# define OK_X		(10)
X# define OK_Y		(PROMPTED_HP * 2)
X
X# define TEXT_OFF	5
X
Xextern int	co_inited;
Xextern	GC	co_fore_gc, co_back_gc;
Xstatic char	*label;
Xstatic int	prompted_h, prompted_w, label_x;
Xstatic Window	prompted, textbox, ok;
Xstatic char	returnbuffer[256];
Xstatic char	*retpointer;
X
Xstatic int	prompted_done;
X
Xchar *
Xco_prompted(title, parent)
Xchar *title;
XWindow	parent;
X{
X	XAnyEvent	rep;
X	int		state, prompted_x;
X	int		label_w;
X	int		co_OKstate (), co_promptedEvent (), CmanageButton (), textbox_event ();
X	int		mask;
X	int		height;
X
X	if (!co_inited)
X		co_init();
X	label = title;
X	label_w = XTextWidth(co_font, label, strlen(label));
X	height = co_font->ascent;/* + co_font->descent;*/
X	
X	if (MIN_PROMPTED_W+10 >= label_w)
X		prompted_w = MIN_PROMPTED_W+10;
X	else
X		prompted_w = label_w + 10;
X
X	label_x = prompted_w / 2 - label_w / 2;
X	prompted_h = OK_Y + 60;
X	prompted_x = 512 - prompted_w/2;
X	prompted = XCreateSimpleWindow (dpy, parent,
X					prompted_x, PROMPTED_Y,
X					prompted_w, prompted_h, 1, co_border,
X					co_background);
X	
X	ok = CmapButton (prompted, OK_X, OK_Y, co_OK, co_OKstate);
X	textbox = XCreateSimpleWindow (dpy, prompted, TEXTBOX_X, TEXTBOX_Y,
X				       TEXTBOX_W, height + TEXTBOX_VP * 2,
X				       1, co_border, co_background);
X	bindEvent (prompted, ExposureMask, co_promptedEvent);
X	bindEvent (ok, ExposureMask|ButtonPressMask|ButtonReleaseMask|
X		   Button1MotionMask|Button2MotionMask|Button3MotionMask|LeaveWindowMask,
X			CmanageButton);
X	bindEvent (textbox, ExposureMask|KeyPressMask, textbox_event);
X	bindEvent (prompted, KeyPressMask, textbox_event);
X	XMapWindow (dpy, textbox);
X	XMapWindow (dpy, prompted);
X
X	prompted_done = 0;
X	retpointer = returnbuffer;
X	*retpointer = '\0';
X	while (!prompted_done) {
X		dispatch ();
X	}
X	
X	unbindEvent (prompted, ExposureMask);
X	unbindEvent (textbox, ExposureMask|KeyPressMask);
X	unbindEvent (prompted, KeyPressMask);
X	unbindEvent (ok, ExposureMask|ButtonPressMask|ButtonReleaseMask|
X		     Button1MotionMask|Button2MotionMask|Button3MotionMask|LeaveWindowMask);
X	XUnmapWindow (dpy, prompted);
X	CunmapButton (ok);
X	XDestroyWindow (dpy, textbox);
X	XDestroyWindow (dpy, prompted);
X	*retpointer = '\0';
X	return returnbuffer;
X}
X
Xstatic
Xco_promptedEvent (rep)
XXAnyEvent	*rep;
X{
X	switch (rep->type) {
X	case Expose:
X		redisplayLabel ();
X	}
X}
X
Xstatic
Xco_OKstate (n)
X{
X	prompted_done = 1;
X}
X
Xstatic
XredisplayLabel ()
X{
X	XDrawImageString (dpy, prompted, co_fore_gc, label_x, LABEL_Y, label, strlen (label));
X	XFlush (dpy);
X}
X
Xstatic
Xtextbox_event (rep)
XXAnyEvent	*rep;
X{
X	char	buffer[20], *pbuf;
X	int	count ;
X
X	pbuf = buffer;
X	switch (rep->type) {
X	case Expose:
X		redisplayText ();
X		break;
X	case KeyPress:
X		count = XLookupString (rep, pbuf, 20, 0, 0);
X		
X		while (!prompted_done && count--) {
X			handle_char (*pbuf++);
X		}
X		break;
X	}
X}
X
Xstatic
Xhandle_char (c)
X{
X	switch (c) {
X	case '\n':
X	case '\r':
X		*retpointer = '\0';
X		prompted_done = 1;
X		break;
X	case '\b':
X	case '\0177':
X		if (retpointer > returnbuffer) {
X			c = *--retpointer;
X			*retpointer = '\0';
X			draw_char (compute_width (returnbuffer), c, 0);
X		}
X		break;
X	case '\030':
X	case '\025':
X		draw_string (returnbuffer, 0);
X		retpointer = returnbuffer;
X		*retpointer = '\0';
X		break;
X	default:
X		*retpointer = '\0';
X		draw_char (compute_width (returnbuffer), c, 1);
X		*retpointer++ = c;
X		*retpointer = '\0';
X		break;
X	}
X}
X
Xstatic
Xcompute_width (string)
Xchar	*string;
X{
X	return XTextWidth (co_font, string, strlen(string));
X}
X
Xstatic
Xdraw_char (pos, ch, on)
X{
X	GC	my;
X
X	my = on ? co_fore_gc : co_back_gc;
X	XDrawImageString (dpy, textbox, my, pos, TEXTBOX_VP, &ch, 1);
X}
X
Xstatic
Xdraw_string (string, on)
Xchar	*string;
X{
X	GC	my;
X
X	my = on ? co_fore_gc : co_back_gc;
X	XDrawImageString (dpy, textbox, my, 0, TEXTBOX_VP, string, strlen(string));
X}
X
Xstatic
XredisplayText ()
X{
X	draw_string (returnbuffer, 1);
X}
END_OF_control/prompted.c
if test 4268 -ne `wc -c <control/prompted.c`; then
    echo shar: \"control/prompted.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of archive 1 \(of 15\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 15 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330



More information about the Comp.sources.x mailing list