v01i062: torch: dialog utilities, Part01/04

Mike Wexler mikew at wyse.wyse.com
Thu Oct 13 04:40:57 AEST 1988


Submitted-by: gary at torch.UUCP (Gary Henderson)
Posting-number: Volume 1, Issue 62
Archive-name: torch/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", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 4)."
# Contents:  README Makefile Xdefaults alert.bitmaps alert.c
#   classname.h
# Wrapped by mikew at wyse on Wed Oct 12 11:38:37 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(2046 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
XHere are the sources to 3 X11 (R2) utility programs: yorn, gs and alert.  
X
XAll three print a message in a window, yorn then waits for the user to click a
Xtick or cross button and returns it as an exit status, gs requests text to
Xtyped by the user, waits for a finished button to be click and returns the
Xtext on stdout and alert simply waits for an ok button to be clicked by the
Xuser. 
X
XThey all use widgets to obtain as pretty user interface if the connection to
Xthe X-server can be established, otherwise terminal text only versions come
Xinto play (useful if they are used in unix start up shell scripts and the
Xserver can't be started for some reason).
X
XThe utilities have been tested on a sun 360 running BSD unix 4.2 (with the
X'-DBSD' flag set in the Makefile) and our own machines running 
XUnisoft unix V.2 (with the '-DUNISOFTV' flag set).
X
XWhen complied (by typing make when in the correct directory and with the
Xcorrect '-D' flag set in the Makefile) a single binary called 'alert' is
Xproduced.  This should be linked to 'yorn' and then linked again to 'gs'.  The
Xbinary decides what utility to act like by its argv[0] argument.  This
Xarrangement stops parts of the X libraries (which aren't small !) from being
Xstored 3 times in 3 separate binaries, thus saving disk space.
X
XWidget application writers may find the file misc.c of interest since this
Xadds a string to pixmap converter to the toolkit so users can specify a
Xbackground bitmap file name to be used (when converted) as a widget's
Xbackground pixmap.
X
XA sample .Xdefaults file is included (for colour servers) that gives some
Xexamples of what can be redefined from such a file.  The file needs to be in
Xyour home directory as .Xdefaults or moved to the
Xfile /usr/lib/X11/app-defaults/Xopentop for it to take effect.
XIt is interesting to see just how many colour servers
Xare broken as regards tiling and stippling alignment when using this file.
X
XAny comments/bug fixs/money, please send them to:
X
X    	gary at torch.co.uk
X
XGary Henderson @ Torch Computers Ltd., Cambridge, UK.
END_OF_FILE
if test 2046 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(397 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X# Makefile for X Windows Version of alert/yorn/gs
X
XOOPT	=-O
X
XCFLAGS	=-DBSD $(OOPT) -I/usr/new/usr/include
XLFLAGS	=-L/usr/new/usr/lib -lXaw -lXt -lX
XBIN	=/usr/new/usr/bin
X
XOFILES	= main.o misc.o alert.o gs.o textmode.o
X
Xalert:	$(OFILES)
X	$(CC) $(OFILES) -o alert $(LFLAGS)
X
Xinstall:
X	rm -f $(BIN)/alert $(BIN)/yorn $(BIN)/gs
X	cp alert $(BIN)
X	ln $(BIN)/alert $(BIN)/yorn
X	ln $(BIN)/alert $(BIN)/gs
END_OF_FILE
if test 397 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'Xdefaults' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Xdefaults'\"
else
echo shar: Extracting \"'Xdefaults'\" \(1153 characters\)
sed "s/^X//" >'Xdefaults' <<'END_OF_FILE'
XXopentop*alertsym:/usr/include/X11/bitmaps/xlogo64
XXopentop*yornsym:/usr/include/X11/bitmaps/woman
XXopentop*alert/yorn.contents.background:Yellow
XXopentop*alert/yorn.contents*foreground:Wheat
XXopentop*alert/yorn*backgroundPixmap.foreground:White
XXopentop*alert/yorn.contents.backgroundPixmap:/usr/include/X11/bitmaps/wingdogs
XXopentop*alert/yorn.contents.text.backgroundPixmap:/usr/include/X11/bitmaps/woman
XXopentop*alert/yorn*backgroundPixmap:/usr/include/X11/bitmaps/scales
XXopentop*alert/yorn.contents.symbol.foreground:Blue
XXopentop*alert/yorn.contents.symbol.backgroundPixmap.foreground:SeaGreen
XXopentop*alert/yorn.contents.symbol.background:Cyan
XXopentop*alert/yorn.contents.ok/yes button*foreground:Red
XXopentop*alert/yorn.contents.ok/yes button.background:IndianRed
XXopentop*alert/yorn.contents.no button*foreground:Green
XXopentop*alert/yorn.contents.no button.background:LimeGreen
XXopentop*alert/yorn.contents.text.foreground:White
XXopentop*alert/yorn.contents.text.background:Magenta
XXopentop*alert/yorn.contents.text.backgroundPixmap.foreground:MediumVioletRed
XXopentop*alert/yorn*background:OrangeRed
XXopentop*alert/yorn*foreground:Orange
END_OF_FILE
if test 1153 -ne `wc -c <'Xdefaults'`; then
    echo shar: \"'Xdefaults'\" unpacked with wrong size!
fi
# end of 'Xdefaults'
fi
if test -f 'alert.bitmaps' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'alert.bitmaps'\"
else
echo shar: Extracting \"'alert.bitmaps'\" \(26317 characters\)
sed "s/^X//" >'alert.bitmaps' <<'END_OF_FILE'
X#define queryform_width 120
X#define queryform_height 114
Xstatic char queryform_bits[] = {
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xe0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xe0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0f,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xf8, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
X   0xff, 0xe7, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x80, 0xff, 0xe7, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xc3, 0xff, 0x03, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xc3, 0xff,
X   0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
X   0xff, 0x81, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0xe0, 0xff, 0x81, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0xff, 0x0f, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0xff,
X   0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
X   0x7f, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0xf8, 0x7f, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0xfc, 0x3f, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0xfc,
X   0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
X   0x1f, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0xfe, 0x1f, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0xf0, 0xff, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0xf0,
X   0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
X   0x07, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x80, 0xff, 0x07, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0x00, 0xc0, 0xff, 0x03, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0x00, 0xc0,
X   0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
X   0x01, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0xe0, 0xff, 0x01, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00,
X   0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f,
X   0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0xc0, 0xff, 0x03, 0xfc, 0x3f, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0xf0, 0xff, 0x0f,
X   0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f,
X   0xfc, 0xff, 0x3f, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0xfe, 0x1f, 0xfe, 0xff, 0x7f, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xf0, 0xff, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0xff, 0xff, 0xff,
X   0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x87,
X   0xff, 0xc3, 0xff, 0xe1, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x80, 0xff, 0x87, 0xff, 0x00, 0xff, 0xe1, 0xff, 0x01, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xc0, 0xff, 0xc3, 0x7f, 0x00, 0xfe, 0xc3, 0xff, 0x03,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xc3, 0x3f, 0x00, 0xfc,
X   0xc3, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xe1,
X   0x1f, 0x00, 0xf8, 0x87, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xe0, 0xff, 0xe1, 0x1f, 0x00, 0xf8, 0x87, 0xff, 0x07, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xf0, 0xff, 0xe0, 0x0f, 0x00, 0xf0, 0x07, 0xff, 0x0f,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xe0, 0x0f, 0x00, 0xf0,
X   0x07, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0xe0,
X   0x0f, 0x00, 0xf0, 0x07, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xf8, 0x7f, 0xe0, 0x0f, 0x00, 0xf0, 0x07, 0xfe, 0x1f, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xfc, 0x3f, 0xc0, 0x07, 0x00, 0xf0, 0x07, 0xfc, 0x3f,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x80, 0x03, 0x00, 0xf0,
X   0x07, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00,
X   0x00, 0x00, 0xf8, 0x07, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xfe, 0x1f, 0x00, 0x00, 0x00, 0xf8, 0x07, 0xf8, 0x7f, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xfc, 0x03, 0xf0, 0xff,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xfc,
X   0x03, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00,
X   0x00, 0x00, 0xff, 0x01, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80,
X   0xff, 0x07, 0x00, 0x00, 0x80, 0xff, 0x01, 0xe0, 0xff, 0x01, 0x00, 0x00,
X   0x00, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x00, 0xc0, 0xff,
X   0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x00, 0xf8, 0xff,
X   0x00, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00,
X   0x00, 0xfc, 0x7f, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0,
X   0xff, 0x01, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00,
X   0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff,
X   0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0xff, 0x07,
X   0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00,
X   0x80, 0xff, 0x01, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf8,
X   0x7f, 0x00, 0x00, 0x80, 0xff, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00,
X   0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0xfc,
X   0x3f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x80, 0x7f, 0x00,
X   0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00,
X   0x80, 0x7f, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xfe,
X   0x1f, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00,
X   0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0xf0,
X   0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x80, 0x7f, 0x00,
X   0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00,
X   0x80, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x80, 0xff,
X   0x07, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00,
X   0x00, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0xc0,
X   0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x80, 0x7f, 0x00,
X   0x00, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00,
X   0x00, 0x3f, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0xe0, 0xff,
X   0x01, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00,
X   0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xff, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00,
X   0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0xf8, 0x7f,
X   0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00,
X   0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00,
X   0xfc, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x80, 0x7f, 0x00,
X   0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00,
X   0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0xfe, 0x1f,
X   0x00, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00,
X   0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00,
X   0xf0, 0xff, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00,
X   0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x80, 0xff, 0x07,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01,
X   0xc0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xc0, 0xff, 0x03, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07,
X   0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
X   0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
X   0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0x07, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0x01};
X
X#define warnform_width 120
X#define warnform_height 114
Xstatic char warnform_bits[] = {
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xe0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xe0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0f,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xf8, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
X   0xff, 0xe7, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x80, 0xff, 0xe7, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xc3, 0xff, 0x03, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xc3, 0xff,
X   0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
X   0xff, 0x81, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0xe0, 0xff, 0x81, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0xff, 0x0f, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0xff,
X   0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
X   0x7f, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0xf8, 0x7f, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0xfc, 0x3f, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0xfc,
X   0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
X   0x1f, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0xfe, 0x1f, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0xf0, 0xff, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0xf0,
X   0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
X   0x07, 0x7e, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x80, 0xff, 0x07, 0xff, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x83, 0xff, 0xc1, 0xff, 0x03, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x83, 0xff, 0xc1,
X   0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
X   0xc1, 0xff, 0x83, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0xe0, 0xff, 0xc1, 0xff, 0x83, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xe0, 0xff, 0x07, 0xff, 0x0f, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xe0, 0xff, 0x07,
X   0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f,
X   0xf0, 0xff, 0x0f, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0xf8, 0x7f, 0xf0, 0xff, 0x0f, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0xf8, 0xff, 0x1f, 0xfc, 0x3f, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0xf8, 0xff, 0x1f,
X   0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f,
X   0xf8, 0xff, 0x1f, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0xfe, 0x1f, 0xf8, 0xff, 0x1f, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0xf8, 0xff, 0x1f, 0xf0, 0xff, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0xf8, 0xff, 0x1f,
X   0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07,
X   0xf8, 0xff, 0x1f, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x80, 0xff, 0x07, 0xf8, 0xff, 0x1f, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0xf8, 0xff, 0x1f, 0xc0, 0xff, 0x03,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0xf8, 0xff, 0x1f,
X   0xc0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01,
X   0xf0, 0xff, 0x0f, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xe0, 0xff, 0x01, 0xf0, 0xff, 0x0f, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0xff, 0x0f,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0xf0, 0xff, 0x0f,
X   0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00,
X   0xe0, 0xff, 0x07, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xf8, 0x7f, 0x00, 0xe0, 0xff, 0x07, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0xe0, 0xff, 0x07, 0x00, 0xfc, 0x3f,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0xe0, 0xff, 0x07,
X   0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00,
X   0xc0, 0xff, 0x03, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xfe, 0x1f, 0x00, 0xc0, 0xff, 0x03, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0xc0, 0xff, 0x03, 0x00, 0xf0, 0xff,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0xc0, 0xff, 0x03,
X   0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00,
X   0x80, 0xff, 0x01, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80,
X   0xff, 0x07, 0x00, 0x80, 0xff, 0x01, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00,
X   0x00, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x80, 0xff, 0x01, 0x00, 0xc0, 0xff,
X   0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x80, 0xff, 0x01,
X   0x00, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00,
X   0x00, 0xff, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0,
X   0xff, 0x01, 0x00, 0x00, 0xff, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00,
X   0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
X   0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00,
X   0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00,
X   0x00, 0x7e, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf8,
X   0x7f, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00,
X   0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfc,
X   0x3f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x7e, 0x00,
X   0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00,
X   0x00, 0x3c, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xfe,
X   0x1f, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00,
X   0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0xf0,
X   0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x18, 0x00,
X   0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x80, 0xff,
X   0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00,
X   0x00, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
X   0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00,
X   0x00, 0x3c, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0xe0, 0xff,
X   0x01, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00,
X   0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x00,
X   0xff, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0x01,
X   0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00,
X   0xc0, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0xf8, 0x7f,
X   0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00,
X   0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x00,
X   0xfc, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03,
X   0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00,
X   0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0xfe, 0x1f,
X   0x00, 0x00, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00,
X   0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
X   0xf0, 0xff, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00,
X   0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x80, 0xff, 0x07,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01,
X   0xc0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xc0, 0xff, 0x03, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07,
X   0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
X   0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
X   0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0x07, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0x01};
X
X#define okform_width 40
X#define okform_height 48
Xstatic char okform_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, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00,
X   0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff,
X   0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff,
X   0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00,
X   0xff, 0xff, 0xff, 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, 0xff,
X   0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff,
X   0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00,
X   0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff,
X   0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 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
X#define tickform_width 40
X#define tickform_height 48
Xstatic char tickform_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, 0xc0, 0x03, 0x00, 0x00, 0x00,
X   0xc0, 0x03, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0xe0, 0x01,
X   0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
X   0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x3c,
X   0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
X   0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00,
X   0x0f, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00,
X   0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00,
X   0xe0, 0x01, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0xf0, 0x00,
X   0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00,
X   0x00, 0x78, 0x00, 0x00, 0x00, 0x0f, 0x3c, 0x00, 0x00, 0x00, 0x0f, 0x3c,
X   0x00, 0x00, 0x00, 0x1e, 0x1e, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x00, 0x00,
X   0x00, 0x3c, 0x0f, 0x00, 0x00, 0x00, 0x3c, 0x0f, 0x00, 0x00, 0x00, 0xf8,
X   0x07, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00,
X   0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00,
X   0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
X
X#define crossform_width 40
X#define crossform_height 48
Xstatic char crossform_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, 0x3c, 0x00, 0xf0, 0x00, 0x00,
X   0x3c, 0x00, 0xf0, 0x00, 0x00, 0x78, 0x00, 0x78, 0x00, 0x00, 0x78, 0x00,
X   0x78, 0x00, 0x00, 0xf0, 0x00, 0x3c, 0x00, 0x00, 0xf0, 0x00, 0x3c, 0x00,
X   0x00, 0xe0, 0x01, 0x1e, 0x00, 0x00, 0xe0, 0x01, 0x1e, 0x00, 0x00, 0xc0,
X   0x03, 0x0f, 0x00, 0x00, 0xc0, 0x03, 0x0f, 0x00, 0x00, 0x80, 0x87, 0x07,
X   0x00, 0x00, 0x80, 0x87, 0x07, 0x00, 0x00, 0x00, 0xcf, 0x03, 0x00, 0x00,
X   0x00, 0xcf, 0x03, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0xfe,
X   0x01, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00,
X   0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00,
X   0xfc, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01,
X   0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0xcf, 0x03, 0x00, 0x00,
X   0x00, 0xcf, 0x03, 0x00, 0x00, 0x80, 0x87, 0x07, 0x00, 0x00, 0x80, 0x87,
X   0x07, 0x00, 0x00, 0xc0, 0x03, 0x0f, 0x00, 0x00, 0xc0, 0x03, 0x0f, 0x00,
X   0x00, 0xe0, 0x01, 0x1e, 0x00, 0x00, 0xe0, 0x01, 0x1e, 0x00, 0x00, 0xf0,
X   0x00, 0x3c, 0x00, 0x00, 0xf0, 0x00, 0x3c, 0x00, 0x00, 0x78, 0x00, 0x78,
X   0x00, 0x00, 0x78, 0x00, 0x78, 0x00, 0x00, 0x3c, 0x00, 0xf0, 0x00, 0x00,
X   0x3c, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
X
END_OF_FILE
if test 26317 -ne `wc -c <'alert.bitmaps'`; then
    echo shar: \"'alert.bitmaps'\" unpacked with wrong size!
fi
# end of 'alert.bitmaps'
fi
if test -f 'alert.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'alert.c'\"
else
echo shar: Extracting \"'alert.c'\" \(19161 characters\)
sed "s/^X//" >'alert.c' <<'END_OF_FILE'
X/*
XCopyright 1988 Torch Computers Ltd.
X
XPermission to use, copy, modify, and otherwise generally do what you like
Xwith this software is hereby granted provided that the above copyright notice
Xappears in all copies.
X
XTorch disclaims all warranties implied or expressed with regard to this
Xsoftware.  In no event shall Torch be liable for any damages arising from
Xthis use of software.
X*/
X
X/********************************************************
X*							*
X*  Title   Yorn, Gs and Alert				*
X*							*
X*  File	   : alert.c					*
X*  Author  : Gary Henderson				*
X*            Mark Howells                               *
X*  Date	   : 27th Sep 1988.				*
X*  Purpose : Create and display the widgets for the 	*
X*   	     yorn and alert boxes.  	    	    	*
X*							*
X*********************************************************/
X
X/*------Include files-----------------------------------*/
X
X#include <stdio.h>
X#include <X11/Xlib.h>
X#include <X11/Xos.h>
X#include <X11/Xutil.h>
X#include <X11/StringDefs.h>
X#include <X11/Intrinsic.h>
X#include <X11/Form.h>
X#include <X11/Core.h>
X#include <X11/Shell.h>
X#include <X11/Label.h>
X#include <X11/Command.h>
X
X#include "alert.bitmaps"
X
X/*------Forward delarations-----------------------------*/
X
Xstatic void Nack();
Xstatic void OkAck();
Xstatic void AlertExposures();
Xstatic void AlertText();
Xstatic Pixmap LoadSymbol ();
Xextern long time ();
X
Xtypedef struct {
X    unsigned int    width, height;
X    Pixmap  	    id;
X    Pixel   	    foreground, background;
X} symbol;
X
X/*------Constants and macros----------------------------*/
X
X#define ALBOX1X		150
X#define ALBOX2X		250
X
X#define CROSS	1
X#define CHECK	0
X#define NOREPLY 100
X
X#ifndef MIN
X#define MIN(a,b) ((a) > (b) ? (b) : (a))
X#endif MIN
X
X#define ALTEXTWIDTH MIN ((sysfont->max_bounds.width * 40), \
X    	    	    	  root_width / 5)
X
X#define ALTEXTHEIGHT 	((sysfont->max_bounds.descent + \
X    	    	    	  sysfont->max_bounds.ascent) * 6)
X
X#define ALONX 	    	((root_width / 5 + rand () % 48))
X
X#define ALONY 	    	((root_height / 5 + rand () % 48))
X
X/*------Exported variables/functions--------------------*/
X
Xint ackreply = CROSS;
XWidget alertwidget;
X
X/*------Imported variables/functions--------------------*/
X
Xextern Widget a_widget;
Xextern XFontStruct *sysfont;
Xextern unsigned int root_width, root_height;
Xextern Display * display;
Xextern Window root_window;
Xextern int screen_number;
Xextern Screen * screen;
Xextern Boolean zoom;
Xextern char *yornsym_name, *alertsym_name, *oksym_name, *ticksym_name,
X    	    *crosssym_name;
Xextern Cursor arrow_cursor;
X
Xextern void ReadWidgetColours ();
X
X/*------Static variables--------------------------------*/
X
Xstatic char *curtext;
Xstatic Widget triangle, button1, button2, textwidget;
Xstatic GC alert_gc, text_gc;
Xstatic symbol warn, query, tick, cross, ok;
Xstatic symbol *triangle_symbol, *button1_symbol, *button2_symbol;
X
X/*
X							*****************
X							*		*
X							*   INITALERT	*
X							*		*
X							*****************
X-------------------------------------------------------------------------
X| Initialise the widgets for the yorn and alert boxes.	    	    	|
X-------------------------------------------------------------------------
X*/
Xvoid InitAlert (geometry)
Xchar * geometry;
X{
X    Widget formwidget;
X    Arg args[10];
X    
X    static XtCallbackRec ackbacks[] = {
X    	{OkAck, NULL},
X    	{NULL, NULL},
X    };
X    
X    static XtCallbackRec nackbacks[] = {
X	{Nack, NULL},
X	{NULL, NULL},
X    };
X    Pixel foreground, background;
X
X#ifdef BSD    
X    (void) srand ((int) time ((long *) 0));
X#endif BSD
X
X#if defined(UNISOFTV) || defined(SYSV)
X    (void) srand ((unsigned int) time ((long *) 0));
X#endif /* UNISOFTV || SYSV */
X
X    alert_gc = XCreateGC (display, root_window, 0L, (XGCValues *) 0);
X    text_gc = XCreateGC (display, root_window, 0L, (XGCValues *) 0);
X    
X    XSetGraphicsExposures (display, alert_gc, False);
X    XSetFillStyle (display, alert_gc, FillStippled);
X
X    XSetGraphicsExposures (display, text_gc, False);
X
X    XtSetArg (args[0], XtNx, ALONX);
X    XtSetArg (args[1], XtNy, ALONY);
X    XtSetArg (args[2], XtNgeometry, geometry);
X    
X    /* An alert (or yorn) box is a popup widget, its exact type depends
X       on the zoom resource option */
X
X    alertwidget = XtCreatePopupShell ("alert/yorn", 
X    	    	    	    	      zoom ? topLevelShellWidgetClass :
X				    	     overrideShellWidgetClass, 
X				      a_widget,
X				      args,
X				      geometry ? 3 : 2);
X				    
X    formwidget= XtCreateManagedWidget ("contents",
X    	    	    	    	      formWidgetClass,
X				      alertwidget,
X				      (ArgList) 0,
X				      0);
X
X   /* Now a label widget for the /\   or    /\ 
X    	    	    	        /  \       /  \
X			       / ?  \     / !  \
X			       ------     ------ 
X      (a label widget has foreground colour that is used for the symbol's
X      other colour) */
X
X    XtSetArg (args[0], XtNhorizDistance, 10);
X    XtSetArg (args[1], XtNvertDistance, 10);
X    XtSetArg (args[2], XtNresizable, False);
X    XtSetArg (args[3], XtNborderWidth, 0);
X    XtSetArg (args[4], XtNlabel, "\0");
X    
X    triangle = XtCreateManagedWidget ("symbol", labelWidgetClass, 
X    	    	    	    	    	formwidget, args, 5);
X
X    query.width = queryform_width;
X    query.height = queryform_height;
X    
X    query.id = LoadSymbol (triangle, 
X    	    	    	   queryform_bits, 
X			   yornsym_name, 
X			   &query.width,
X			   &query.height,
X			   &query.foreground,
X			   &query.background);
X
X    warn.width = warnform_width;
X    warn.height = warnform_height;
X    
X    warn.id  = LoadSymbol (triangle,
X    	    	    	   warnform_bits, 
X			   alertsym_name,
X			   &warn.width,
X			   &warn.height,
X			   &warn.foreground,
X			   &warn.background);
X
X    XtSetArg (args[0], XtNwidth, warn.width > query.width ? 
X    	    	    	    	warn.width : query.width);
X    XtSetArg (args[1], XtNheight, warn.height > query.height ? 
X    	    	    	    	 warn.height : query.height);
X
X    XtSetValues (triangle, args, 2);
X    
X    XtAddEventHandler (triangle, 
X    	    	      StructureNotifyMask | ExposureMask,
X		      True,
X		      AlertExposures,
X		      (caddr_t) 0);
X
X    /* Now a widget for the text.  Use a label widget (because it has a
X       foreground colour) and format the text ourselves. */
X
X    XtSetArg (args[0], XtNborderWidth, 0);
X    XtSetArg (args[1], XtNwidth, ALTEXTWIDTH);
X    XtSetArg (args[2], XtNheight, ALTEXTHEIGHT);
X    XtSetArg (args[3], XtNresizable, True);
X    XtSetArg (args[4], XtNhorizDistance, 5);
X    XtSetArg (args[5], XtNvertDistance, 1);
X    XtSetArg (args[6], XtNfromHoriz, triangle);
X    XtSetArg (args[7], XtNlabel, "\0");
X    
X    textwidget= XtCreateManagedWidget ("text", labelWidgetClass, 
X    	    	    	    	    	formwidget, args, 8);
X
X    ReadWidgetColours (textwidget, &foreground, &background);
X
X    XSetForeground (display, text_gc, foreground);
X    XSetBackground (display, text_gc, background);
X    XSetFont (display, text_gc, sysfont->fid);
X    
X    XtAddEventHandler (textwidget, 
X    	    	      StructureNotifyMask | ExposureMask,
X		      True,
X		      AlertText,
X		      (caddr_t) &curtext);
X
X    /* And finally (Esther) two command buttons */
X
X    XtSetArg (args[0], XtNhorizDistance, ALBOX1X);
X    XtSetArg (args[1], XtNvertDistance, 1);
X    XtSetArg (args[2], XtNresizable, True);
X    XtSetArg (args[3], XtNfromVert, textwidget);
X    XtSetArg (args[4], XtNcallback, ackbacks);
X    XtSetArg (args[5], XtNlabel, "\0");
X   
X    button1 = XtCreateManagedWidget("ok/yes button",
X    	    	    	    	    commandWidgetClass,
X				    formwidget,
X				    args,
X				    6);
X				 
X    ok.width = okform_width;
X    ok.height = okform_height;
X    
X    ok.id = LoadSymbol (button1, 
X    	    	        okform_bits, 
X		        oksym_name, 
X		        &ok.width, 
X		        &ok.height,
X		        &ok.foreground,
X		        &ok.background);
X			 
X    tick.width = tickform_width;
X    tick.height = tickform_height;
X    
X    tick.id = LoadSymbol (button1, 
X    	    	    	  tickform_bits, 
X			  ticksym_name, 
X			  &tick.width,
X			  &tick.height,
X			  &tick.foreground,
X			  &tick.background);
X
X    XtSetArg (args[0], XtNwidth, ok.width > tick.width ? 
X    	    	    	    	 ok.width : tick.width);
X    XtSetArg (args[1], XtNheight, ok.height > tick.height ? 
X    	    	    	    	  ok.height : tick.height);
X
X    XtSetValues (button1, args, 2);
X    
X    XtAddEventHandler (button1, 
X    	    	      StructureNotifyMask | LeaveWindowMask | ExposureMask,
X		      True,
X		      AlertExposures,
X		      (caddr_t) 1);
X
X    XtSetArg (args[0], XtNhorizDistance, ALBOX2X);
X    XtSetArg (args[1], XtNvertDistance, 1);
X    XtSetArg (args[2], XtNresizable, True);
X    XtSetArg (args[3], XtNfromVert, textwidget);
X    XtSetArg (args[4], XtNcallback, nackbacks);
X    XtSetArg (args[5], XtNlabel, "\0");
X   
X    button2 = XtCreateManagedWidget("no button",
X    	    	    	    	    commandWidgetClass,
X				    formwidget,
X				    args,
X				    6);
X    
X    cross.height = crossform_height;
X    cross.width = crossform_width;
X    
X    cross.id = LoadSymbol (button2,
X    	    	    	   crossform_bits,
X			   crosssym_name,
X			   &cross.width,
X			   &cross.height,
X			   &cross.foreground,
X			   &cross.background);
X    
X    XtSetArg (args[0], XtNwidth, cross.width);
X    XtSetArg (args[1], XtNheight, cross.height);
X
X    XtSetValues (button2, args, 2);
X    
X    XtAddEventHandler (button2,
X    	    	      StructureNotifyMask | LeaveWindowMask | ExposureMask,
X		      True,
X		      AlertExposures,
X		      (caddr_t) 2);
X
X    XtRealizeWidget (alertwidget);
X}
X/*
X							*****************
X							*		*
X							*     OKACK	*
X							*     NACK	*
X							*****************
X-------------------------------------------------------------------------
X| One of the buttons has been pressed by the user.  	    	    	|
X-------------------------------------------------------------------------
X*/
X
X/*ARGSUSED*/
Xstatic void OkAck (widget, client_data, call_data)
XWidget widget;
Xcaddr_t client_data,call_data;
X{
X    ackreply = CHECK;
X    XtPopdown (alertwidget);
X}
X
X/*ARGSUSED*/
Xstatic void Nack (widget, client_data, call_data)
XWidget widget;
Xcaddr_t client_data,call_data;
X{
X    ackreply = CROSS;
X    XtPopdown (alertwidget);
X}
X
X/*
X							*****************
X							*		*
X							*    ALERT	*
X							*		*
X							*****************
X-------------------------------------------------------------------------
X| Popup an alert box and wait for the user to click the acknowlegde 	|
X| button.   	    	    	    	    	    	    	    	|
X-------------------------------------------------------------------------
X*/
Xvoid Alert (text)
Xchar *text;
X{
X    XEvent xevent;
X    
X    ackreply = NOREPLY;
X    DrawAlert (&warn, &ok, (symbol *) 0, text);
X    
X    while (ackreply == NOREPLY)
X    {
X        XtNextEvent (&xevent);
X	XtDispatchEvent (&xevent);
X    }
X
X    exit (0);
X}
X
X/*
X							*****************
X							*		*
X							*     YORN	*
X							*		*
X							*****************
X-------------------------------------------------------------------------
X| Popup a yorn box and wait for the user to click in the tick or cross	|
X| button and return the answer to the calling program.	    	    	|
X-------------------------------------------------------------------------
X*/
X
Xvoid Yorn (text)
Xchar *text;
X{
X    XEvent xevent;
X
X    ackreply = NOREPLY;
X    DrawAlert (&query, &tick, &cross, text);
X
X    while (ackreply == NOREPLY)
X    {
X        XtNextEvent (&xevent);
X	XtDispatchEvent (&xevent);
X    }
X
X    exit (ackreply);
X}
X
X/*
X							*****************
X							*		*
X							*   DRAWALERT	*
X							*		*
X							*****************
X-------------------------------------------------------------------------
X| Note what symbols to use and how many buttons to show, then actually	|
X| popup the widget. 	    	    	    	    	    	    	|
X-------------------------------------------------------------------------
X*/
XDrawAlert (tri_symbol, first_button, second_button, text)
Xsymbol *tri_symbol, *first_button, *second_button;
Xchar *text;
X{
X    if (second_button)
X       	XtMapWidget (button2);
X    else
X       	XtUnmapWidget (button2);
X
X    triangle_symbol = tri_symbol;
X    button1_symbol = first_button;
X    button2_symbol = second_button;
X    curtext = text;
X
X    XtPopup (alertwidget, XtGrabNone);
X    
X    XDefineCursor (display, XtWindow (alertwidget), arrow_cursor);
X
X    XFlush (display);
X}
X
X/*
X							*****************
X							*		*
X							* ALERTEXPOSURES*
X							*		*
X							*****************
X-------------------------------------------------------------------------
X| Exposure and reconfigure event processing for widgets containing  	|
X| symbols.  Redraws the symbols when necessary.	    	    	    	|
X-------------------------------------------------------------------------
X*/
Xstatic void AlertExposures (widget, which1, event)
XWidget widget;
Xcaddr_t which1;
XXEvent *event;
X{
X    XRectangle rect;
X    Arg args[2];
X    int width;
X    int height;
X    symbol *sym;
X    
X    if (!XtIsRealized (widget))
X	return;
X
X    XtSetArg (args[0], XtNwidth, &width);
X    XtSetArg (args[1], XtNheight, &height);
X
X    XtGetValues (widget, args, 2);
X
X    switch (event->type)
X    {
X	case  Expose:	rect.x = event->xexpose.x;
X			rect.y = event->xexpose.y;
X			rect.width = event->xexpose.width;
X			rect.height = event->xexpose.height;
X			break;
X	
X	case  GraphicsExpose:	
X	    	    	rect.x = event->xgraphicsexpose.x;
X			rect.y = event->xgraphicsexpose.y;
X			rect.width = event->xgraphicsexpose.width;
X			rect.height = event->xgraphicsexpose.height;
X			break;
X	
X	case  ConfigureNotify: 
X	    	    	XClearWindow (display, XtWindow (widget));
X			
X			/* Deliberate fall through ... */
X	
X	case  LeaveNotify:   
X	    	    	rect.x = 0;
X			rect.y = 0;
X			rect.width = width;
X			rect.height = height;
X			break;
X        default: 
X	    	    	return;
X    }
X    
X    XSetClipRectangles (display, alert_gc, 0, 0, &rect, 1, Unsorted);
X
X    switch ((int) which1)
X    {
X    	case 0:	    	sym = triangle_symbol;
X	    	    	break;
X
X    	case 1:	    	sym = button1_symbol;
X	    	    	break;
X
X    	case 2:	    	sym = button2_symbol;
X	    	    	break;
X
X	default:    	return;
X    }
X
X    if (sym == (symbol *) 0)
X    	return;
X	
X    XSetForeground (display, alert_gc, sym->foreground);
X    XSetBackground (display, alert_gc, sym->background);
X    XSetStipple (display, alert_gc, sym->id);
X    XSetTSOrigin (display, 
X    	    	  alert_gc, 
X		  (width - (int) sym->width) / 2,
X		  (height - (int) sym->height) / 2);
X    	    	    
X    XFillRectangle (display,
X    	    	    XtWindow (widget),
X		    alert_gc,
X		    (width - (int) sym->width) / 2,
X		    (height - (int) sym->height) / 2,
X		    sym->width,
X		    sym->height);
X}
X
X/*
X							*****************
X							*		*
X							*   ALERTTEXT	*
X							*		*
X							*****************
X-------------------------------------------------------------------------
X| Draw the alert or yorn text in the text widget.  Format (word wrap)	|
X| the text to best fit the curent widget size.	    	    	    	| 
X-------------------------------------------------------------------------
X*/
Xstatic void AlertText (widget, str, event)
XWidget widget;
Xcaddr_t str;
XXEvent *event;
X{
X    register char *text = *(char **) str;
X    register pos, ppos, slen, textx, texty;
X    int text_width;
X    
X    XRectangle rect;
X    Arg args[2];
X    int width, height;
X
X    XtSetArg (args[0], XtNwidth, &width);
X    XtSetArg (args[1], XtNheight, &height);
X    XtGetValues (widget, args, 2);
X
X    pos   = 0;			/* position of next 'space' in string */
X    ppos  = 0;			/* previous of a 'space' in string */
X    slen  = strlen (text);	/* length of string   */
X    textx = 10;		    	/* Current x position, (indent 1st line) */
X    texty = 10;		    	/* Current y position */
X
X    /* Work out clip rectangle */
X
X    switch (event->type) 
X    {
X    	case Expose:	rect.x = event->xexpose.x;
X		    	rect.y = event->xexpose.y;
X		    	rect.width = event->xexpose.width;
X		    	rect.height = event->xexpose.height;
X		    	break;
X
X    	case GraphicsExpose:
X	    	    	rect.x = event->xgraphicsexpose.x;
X		    	rect.y = event->xgraphicsexpose.y;
X		    	rect.width = event->xgraphicsexpose.width;
X		    	rect.height = event->xgraphicsexpose.height;
X		    	break;
X
X    	case ConfigureNotify:
X                    	XClearWindow (display, XtWindow(widget));
X	    	    	rect.x = 0;
X		    	rect.y = 0;
X		    	rect.width = width;
X		    	rect.height = height;
X		    	break;
X
X    	default:    	return;
X    }
X
X    XSetClipRectangles (display, text_gc, 0, 0, &rect, 1, Unsorted);
X    
X    while (pos < slen)
X    {
X    	/* Wrap lines at spaces if possible */
X
X      	while (pos < slen)
X            if (*(text + pos++) == ' ')
X            	break;
X
X      	text_width = XTextWidth (sysfont, text + ppos,pos - ppos);
X
X    	/* If this would run over end when printed, wrap!! */
X
X      	if (textx + text_width >= width)
X      	{
X            texty += sysfont->ascent + sysfont->descent;
X            textx = 10;
X      	}
X
X    	/* print sub-string */
X
X    	/* If this would still run over end when printed, draw a char at a time */
X
X      	if (textx + text_width >= width)
X      	{
X            while ((textx + XTextWidth(sysfont,text + ppos,1) <= width) && 
X	    	    ppos <= pos)
X            {
X            	XDrawString (display,
X                             XtWindow (widget),
X                             text_gc,
X                             textx,
X		             texty + sysfont->ascent,
X                             text + ppos,
X                             1);
X            	
X		textx += XTextWidth (sysfont,text + ppos,1);
X            	ppos ++;
X            }
X      	}
X      	else
X        {
X            XDrawString (display,
X		    	 XtWindow (widget),
X		    	 text_gc,
X		    	 textx,
X		    	 texty + sysfont->ascent,
X		    	 text + ppos,
X		    	 pos - ppos);
X
X            textx += text_width;
X
X            /* Update ppos */
X
X            ppos = pos;
X	}
X    }
X}
X
X/*
X							*****************
X							*		*
X							*   LOADSYMBOL	*
X							*		*
X							*****************
X-------------------------------------------------------------------------
X| Download a bitmap to the server to use as one of the symbols for the	|
X| yorn or alert boxes.	    	    	    	    	    	    	|
X| Returns the pixmap XID, two colours (the pixel values) to use when	|
X| drawing the symbol and modifies the width and height values if a  	|
X| different bitmap (from a file) has been used.	    	    	    	|
X-------------------------------------------------------------------------
X*/
Xstatic Pixmap LoadSymbol (widget, bits, name, width, height, fore, back)
XWidget widget;
Xchar *bits, *name;
Xunsigned int *width, *height;
XPixel *fore, *back;
X{
X    Pixmap pixmap;
X    unsigned int wid, hei;
X    
X    ReadWidgetColours (widget, fore, back);
X    
X    /* If a name of an alternative bitmap file has been supplied, try to
X       read it.  If that fails for any reason, or no name is given, download
X       the default bitmap */
X       
X    if (name)
X    	if (XReadBitmapFile (display, 
X	    	    	     root_window,
X 			     name,
X			     &wid,
X			     &hei,
X			     &pixmap,
X			     (int *) 0, 
X			     (int *) 0) == BitmapSuccess)
X    	{
X	    *width = wid;
X	    *height = hei;
X
X	    return pixmap;
X	}
X
X    return XCreateBitmapFromData (display, root_window, bits, *width, *height);
X}
END_OF_FILE
if test 19161 -ne `wc -c <'alert.c'`; then
    echo shar: \"'alert.c'\" unpacked with wrong size!
fi
# end of 'alert.c'
fi
if test -f 'classname.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'classname.h'\"
else
echo shar: Extracting \"'classname.h'\" \(417 characters\)
sed "s/^X//" >'classname.h' <<'END_OF_FILE'
X/*
XCopyright 1988 Torch Computers Ltd.
X
XPermission to use, copy, modify, and otherwise generally do what you like
Xwith this software is hereby granted provided that the above copyright notice
Xappears in all copies.
X
XTorch disclaims all warranties implied or expressed with regard to this
Xsoftware.  In no event shall Torch be liable for any damages arising from
Xthis use of software.
X*/
X
X#define CLASSNAME "Xopentop"
END_OF_FILE
if test 417 -ne `wc -c <'classname.h'`; then
    echo shar: \"'classname.h'\" unpacked with wrong size!
fi
# end of 'classname.h'
fi
echo shar: End of archive 1 \(of 4\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 4 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
Moderator of comp.sources.x



More information about the Comp.sources.x mailing list