home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
x
/
volume8
/
chaos
/
part03
< prev
next >
Wrap
Internet Message Format
|
1990-08-20
|
58KB
Path: uunet!cs.utexas.edu!sun-barr!newstop!sun!uunet.UU.NET
From: balr!panasun!ken@uunet.UU.NET (Ken Marks (x2425))
Newsgroups: comp.sources.x
Subject: v08i079: chaos, Part03/10
Message-ID: <140957@sun.Eng.Sun.COM>
Date: 20 Aug 90 18:03:42 GMT
Sender: news@sun.Eng.Sun.COM
Lines: 4147
Approved: argv@sun.com
Submitted-by: balr!panasun!ken@uunet.UU.NET (Ken Marks (x2425))
Posting-number: Volume 8, Issue 79
Archive-name: chaos/part03
#! /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 3 (of 10)."
# Contents: fonts/push-norm.bdf master/master.c widgets/Palette.c
# Wrapped by ken@panasun on Mon Jul 30 14:59:48 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'fonts/push-norm.bdf' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'fonts/push-norm.bdf'\"
else
echo shar: Extracting \"'fonts/push-norm.bdf'\" \(18706 characters\)
sed "s/^X//" >'fonts/push-norm.bdf' <<'END_OF_FILE'
XSTARTFONT 2.1
XFONT push-norm
XSIZE 16 75 75
XFONTBOUNDINGBOX 9 22 0 -7
XSTARTPROPERTIES 3
XFONT_ASCENT 15
XFONT_DESCENT 7
XDEFAULT_CHAR 32
XENDPROPERTIES
XCHARS 99
XSTARTCHAR H1c
XENCODING 28
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
X0380
X0F80
X1E00
X3800
X7000
X6000
XE000
XC000
XC000
XC000
XC000
XC000
XC000
XC000
XC000
XE000
X6000
X7000
X3800
X1E00
X0F80
X0380
XENDCHAR
XSTARTCHAR H1d
XENCODING 29
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XE000
XF800
X3C00
X0E00
X0700
X0300
X0380
X0180
X0180
X0180
X0180
X0180
X0180
X0180
X0180
X0380
X0300
X0700
X0E00
X3C00
XF800
XE000
XENDCHAR
XSTARTCHAR H1e
XENCODING 30
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 0 0 15
XBITMAP
XENDCHAR
XSTARTCHAR H1f
XENCODING 31
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 7 9 0 1
XBITMAP
X20
X30
X38
XFC
XFE
XFC
X38
X30
X20
XENDCHAR
XSTARTCHAR H20
XENCODING 32
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H21
XENCODING 33
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X1800
X1800
X1800
X1800
X1800
X1800
X1800
X0000
X1800
X1800
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H22
XENCODING 34
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3600
X3600
X3600
X3600
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H23
XENCODING 35
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X1B00
X1B00
X1B00
X7F80
X3600
X3600
XFF00
X6C00
X6C00
X6C00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H24
XENCODING 36
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0800
X3E00
X6B00
X6B00
X6B00
X3800
X0E00
X6B00
X6B00
X6B00
X3E00
X0800
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H25
XENCODING 37
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X7600
X9600
X9C00
XEC00
X1800
X1800
X3700
X3900
X6900
X6E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H26
XENCODING 38
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3800
X6C00
X6C00
X3800
X3000
X7B00
XDE00
XCC00
XDC00
X7700
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H27
XENCODING 39
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0C00
X0C00
X1800
X3000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H28
XENCODING 40
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0600
X0C00
X1800
X1800
X3000
X3000
X3000
X3000
X3000
X1800
X1800
X0C00
X0600
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H29
XENCODING 41
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X3000
X1800
X0C00
X0C00
X0600
X0600
X0600
X0600
X0600
X0C00
X0C00
X1800
X3000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H2a
XENCODING 42
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X1800
X5A00
X7E00
X3C00
X7E00
X5A00
X1800
X0000
X0000
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H2b
XENCODING 43
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X1800
X1800
X1800
XFF00
XFF00
X1800
X1800
X1800
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H2c
XENCODING 44
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X1800
X1800
X0800
X1000
X2000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H2d
XENCODING 45
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X7F00
X7F00
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H2e
XENCODING 46
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X1800
X1800
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H2f
XENCODING 47
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0300
X0600
X0600
X0C00
X0C00
X1800
X1800
X3000
X3000
X6000
X6000
XC000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H30
XENCODING 48
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3E00
X6300
X6700
X6700
X6B00
X6B00
X7300
X7300
X6300
X3E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H31
XENCODING 49
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0C00
X1C00
X3C00
X0C00
X0C00
X0C00
X0C00
X0C00
X0C00
X3F00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H32
XENCODING 50
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3E00
X6300
X6300
X0300
X0600
X0C00
X1800
X3000
X6100
X7F00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H33
XENCODING 51
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3E00
X6300
X6300
X0300
X1E00
X0700
X0300
X6300
X6300
X3E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H34
XENCODING 52
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0200
X0600
X0E00
X1E00
X3600
X6600
XC600
XFF00
X0600
X0600
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H35
XENCODING 53
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X7F00
X6000
X6000
X7E00
X0300
X0300
X0300
X6300
X6300
X3E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H36
XENCODING 54
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3E00
X6300
X6000
X6000
X7E00
X6300
X6300
X6300
X6300
X3E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H37
XENCODING 55
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X7F00
X4300
X4300
X0600
X0600
X0C00
X0C00
X1800
X1800
X1800
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H38
XENCODING 56
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3E00
X6300
X6300
X6300
X3E00
X6300
X6300
X6300
X6300
X3E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H39
XENCODING 57
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3E00
X6300
X6300
X6300
X6300
X3F00
X0300
X0300
X6300
X3E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H3a
XENCODING 58
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X1800
X1800
X0000
X0000
X0000
X1800
X1800
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H3b
XENCODING 59
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X1800
X1800
X0000
X0000
X0000
X1800
X1800
X0800
X1000
X2000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H3c
XENCODING 60
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0300
X0600
X0C00
X1800
X3000
X6000
X3000
X1800
X0C00
X0600
X0300
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H3d
XENCODING 61
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X7F00
X7F00
X0000
X0000
X7F00
X7F00
X0000
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H3e
XENCODING 62
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X6000
X3000
X1800
X0C00
X0600
X0300
X0600
X0C00
X1800
X3000
X6000
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H3f
XENCODING 63
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3E00
X6300
X6300
X0300
X0600
X0C00
X0C00
X0000
X0C00
X0C00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H40
XENCODING 64
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X1C00
X3600
X6300
X6F00
X6B00
X6B00
X6E00
X6000
X3300
X1E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H41
XENCODING 65
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0800
X1C00
X1C00
X3600
X3600
X3600
X6300
X7F00
X6300
X6300
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H42
XENCODING 66
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X7C00
X6600
X6600
X6600
X7C00
X6600
X6300
X6300
X6300
X7E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H43
XENCODING 67
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3E00
X6300
X6300
X6000
X6000
X6000
X6000
X6300
X6300
X3E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H44
XENCODING 68
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X7C00
X6600
X6300
X6300
X6300
X6300
X6300
X6300
X6600
X7C00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H45
XENCODING 69
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X7F00
X6000
X6000
X6000
X7E00
X6000
X6000
X6000
X6000
X7F00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H46
XENCODING 70
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X7F00
X6000
X6000
X6000
X7E00
X6000
X6000
X6000
X6000
X6000
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H47
XENCODING 71
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3E00
X6300
X6300
X6000
X6000
X6700
X6300
X6300
X6700
X3D00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H48
XENCODING 72
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X6300
X6300
X6300
X6300
X7F00
X6300
X6300
X6300
X6300
X6300
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H49
XENCODING 73
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X7E00
X1800
X1800
X1800
X1800
X1800
X1800
X1800
X1800
X7E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H4a
XENCODING 74
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X1F00
X0600
X0600
X0600
X0600
X0600
X0600
X6600
X6600
X3C00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H4b
XENCODING 75
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X6300
X6600
X6C00
X7800
X7C00
X6C00
X6600
X6600
X6300
X6300
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H4c
XENCODING 76
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X6000
X6000
X6000
X6000
X6000
X6000
X6000
X6000
X6000
X7F00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H4d
XENCODING 77
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
XC300
XC300
XE700
XE700
XFF00
XDB00
XDB00
XC300
XC300
XC300
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H4e
XENCODING 78
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X6300
X6300
X7300
X7300
X7B00
X6B00
X6F00
X6700
X6700
X6300
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H4f
XENCODING 79
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3E00
X6300
X6300
X6300
X6300
X6300
X6300
X6300
X6300
X3E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H50
XENCODING 80
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X7E00
X6300
X6300
X6300
X6300
X7E00
X6000
X6000
X6000
X6000
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H51
XENCODING 81
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3E00
X6300
X6300
X6300
X6300
X6300
X6300
X6300
X6300
X3E00
X1800
X0C00
X0700
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H52
XENCODING 82
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X7E00
X6300
X6300
X6300
X7E00
X6C00
X6600
X6600
X6300
X6300
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H53
XENCODING 83
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3E00
X6300
X6300
X3000
X1C00
X0600
X0300
X6300
X6300
X3E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H54
XENCODING 84
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
XFF00
X1800
X1800
X1800
X1800
X1800
X1800
X1800
X1800
X1800
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H55
XENCODING 85
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X6300
X6300
X6300
X6300
X6300
X6300
X6300
X6300
X6300
X3E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H56
XENCODING 86
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X6300
X6300
X6300
X3600
X3600
X3600
X1C00
X1C00
X0800
X0800
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H57
XENCODING 87
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
XC180
XC980
XC980
XDD80
X5D00
X7700
X7700
X3600
X2200
X2200
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H58
XENCODING 88
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X6300
X6300
X3600
X3600
X1C00
X1C00
X3600
X3600
X6300
X6300
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H59
XENCODING 89
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
XC300
XC300
X6600
X6600
X3C00
X1800
X1800
X1800
X1800
X1800
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H5a
XENCODING 90
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X7F00
X0300
X0300
X0600
X0C00
X1800
X3000
X6000
X6000
X7F00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H5b
XENCODING 91
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X3E00
X3000
X3000
X3000
X3000
X3000
X3000
X3000
X3000
X3000
X3000
X3000
X3E00
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H5c
XENCODING 92
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
XC000
X6000
X6000
X3000
X3000
X1800
X1800
X0C00
X0C00
X0600
X0600
X0300
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H5d
XENCODING 93
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X3E00
X0600
X0600
X0600
X0600
X0600
X0600
X0600
X0600
X0600
X0600
X0600
X3E00
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H5e
XENCODING 94
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0800
X1C00
X3600
X6300
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H5f
XENCODING 95
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H60
XENCODING 96
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3000
X3000
X1800
X0C00
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H61
XENCODING 97
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X3C00
X6600
X0600
X3E00
X6600
X6600
X3F00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H62
XENCODING 98
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X6000
X6000
X6000
X6E00
X7300
X6300
X6300
X6300
X7300
X6E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H63
XENCODING 99
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X3E00
X6300
X6000
X6000
X6000
X6300
X3E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H64
XENCODING 100
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0300
X0300
X0300
X3B00
X6700
X6300
X6300
X6300
X6700
X3B00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H65
XENCODING 101
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X3E00
X6300
X6300
X7F00
X6000
X6300
X3E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H66
XENCODING 102
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0E00
X1B00
X1800
X1800
X7E00
X1800
X1800
X1800
X1800
X1800
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H67
XENCODING 103
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X3B00
X6700
X6300
X6300
X6300
X6700
X3B00
X0300
X6300
X3E00
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H68
XENCODING 104
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X6000
X6000
X6000
X6E00
X7300
X6300
X6300
X6300
X6300
X6300
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H69
XENCODING 105
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0C00
X0C00
X0000
X3C00
X0C00
X0C00
X0C00
X0C00
X0C00
X0C00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H6a
XENCODING 106
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0600
X0600
X0000
X1E00
X0600
X0600
X0600
X0600
X0600
X0600
X0600
X6600
X3C00
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H6b
XENCODING 107
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X6000
X6000
X6000
X6600
X6C00
X7800
X7800
X6C00
X6600
X6300
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H6c
XENCODING 108
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X3C00
X0C00
X0C00
X0C00
X0C00
X0C00
X0C00
X0C00
X0C00
X0C00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H6d
XENCODING 109
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
XB600
XDB00
XDB00
XDB00
XDB00
XDB00
XDB00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H6e
XENCODING 110
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X5E00
X7300
X6300
X6300
X6300
X6300
X6300
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H6f
XENCODING 111
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X3E00
X6300
X6300
X6300
X6300
X6300
X3E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H70
XENCODING 112
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X6E00
X7300
X6300
X6300
X6300
X7300
X6E00
X6000
X6000
X6000
X6000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H71
XENCODING 113
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X3B00
X6700
X6300
X6300
X6300
X6700
X3B00
X0300
X0300
X0300
X0300
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H72
XENCODING 114
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X6E00
X7B00
X6000
X6000
X6000
X6000
X6000
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H73
XENCODING 115
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X3E00
X6300
X6000
X3E00
X0300
X6300
X3E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H74
XENCODING 116
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X1800
X1800
X1800
X7E00
X1800
X1800
X1800
X1800
X1B00
X0E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H75
XENCODING 117
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X6300
X6300
X6300
X6300
X6300
X6700
X3B00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H76
XENCODING 118
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X6300
X6300
X3600
X3600
X1C00
X1C00
X0800
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H77
XENCODING 119
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
XC300
XC300
XDB00
XDB00
XDB00
XDB00
X7E00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H78
XENCODING 120
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X6600
X6600
X3C00
X1800
X3C00
X6600
X6600
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H79
XENCODING 121
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X6300
X6300
X3300
X3600
X1600
X1C00
X0C00
X0C00
X4800
X7800
X3000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H7a
XENCODING 122
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X0000
X0000
X7F00
X0600
X0C00
X1800
X3000
X6000
X7F00
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H7b
XENCODING 123
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0F00
X1800
X1800
X1800
X1800
X1800
X7000
X1800
X1800
X1800
X1800
X1800
X0F00
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H7c
XENCODING 124
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X1800
X1800
X1800
X1800
X1800
X1800
X0000
X1800
X1800
X1800
X1800
X1800
X1800
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H7d
XENCODING 125
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X7800
X0C00
X0C00
X0C00
X0C00
X0C00
X0700
X0C00
X0C00
X0C00
X0C00
X0C00
X7800
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XSTARTCHAR H7e
XENCODING 126
XSWIDTH 562 0
XDWIDTH 9 0
XBBX 9 22 0 -7
XBITMAP
XFF80
XFF80
X0000
X0000
X0000
X0000
X3B00
X7F00
X6E00
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
X0000
XFF80
XFF80
XENDCHAR
XENDFONT
END_OF_FILE
if test 18706 -ne `wc -c <'fonts/push-norm.bdf'`; then
echo shar: \"'fonts/push-norm.bdf'\" unpacked with wrong size!
fi
# end of 'fonts/push-norm.bdf'
fi
if test -f 'master/master.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'master/master.c'\"
else
echo shar: Extracting \"'master/master.c'\" \(18472 characters\)
sed "s/^X//" >'master/master.c' <<'END_OF_FILE'
X/*
X * Copyright (c) Ken W. Marks 1989, 1990.
X */
X
X#include <stdio.h>
X#include <fcntl.h>
X#include <X11/Intrinsic.h>
X#include <X11/StringDefs.h>
X#include <X11/Xaw/Form.h>
X#include <X11/Shell.h>
X#include <Chaos.h>
X#include <LocalDefs.h>
X#include <Menu.h>
X#include <MenuItems.h>
X#include <Canvas.h>
X#include <Task.h>
X#include <Ipc.h>
X#include <Colormap.h>
X
Xstatic void QuitFunc();
Xstatic void DrawFunc();
Xstatic void RedrawFunc();
Xstatic void ZoomFunc();
Xstatic void UnzoomFunc();
Xstatic void RezoomFunc();
Xstatic void TopFunc();
Xstatic void FileFunc();
Xstatic void ColormapFunc();
Xstatic void StartDroneFunc();
Xstatic void SettingsFunc();
X
Xextern void MakeTasksStale();
Xextern void WasteTasks();
Xextern void StartDrawing();
Xextern void DialogPopup();
Xextern void ColormapUpdateFileList();
Xextern void FileUpdateFileList();
Xextern void MessageSetup();
Xextern Widget ColormapCreateDialogbox();
Xextern Widget DroneCreateDialogbox();
Xextern Widget FileCreateDialogbox();
Xextern Widget SettingsCreateDialogbox();
Xextern Widget MessageCreateDialogbox();
Xextern Widget ConfirmCreateDialogbox();
Xextern Boolean SaveEverything();
Xextern Boolean LoadEverything();
X
Xvoid CleanupAndDie();
Xvoid BlatzZoomStack();
X
XDisplay *dpy;
XWidget top_level;
XWidget canvas;
XWidget colormap_dialogbox;
XWidget drone_dialogbox;
XWidget file_dialogbox;
XWidget settings_dialogbox;
XWidget message_dialogbox;
XWidget confirm_dialogbox;
XWidget menu;
XBoolean rotating = False;
XBoolean rotating_save;
XRotation rotation_dir = forward;
Xint colormap_alignment;
XColormap colormap;
Xint zoom_level = 0;
Xint num_zoom_levels = 0;
X
Xstatic Screen *screen;
Xstatic Widget menu_popup;
Xstatic Window window;
Xstatic char default_path[] = ".";
Xstatic char message[256];
X
Xstatic char *save_failed_msg =
X"Cannot write to file '%s/%s'!";
X
Xstatic char *load_failed_msg =
X"Cannot find file '%s/%s'!";
X
X/* default size of tasks */
X#define TASK_WIDTH 30
X#define TASK_HEIGHT 30
X
X/* default iteration limit */
X#define ITERATION_LIMIT 256
X
Xstruct AppResources
X{
X char *map_dir;
X char *image_dir;
X char *zoom_dir;
X int task_width;
X int task_height;
X Boolean keep_tasks_square;
X Boolean retain_aspect_ratio;
X int iteration_limit;
X char *hosts;
X char *drone_path;
X} app_resources;
X
X/* for external access to these application specific resources */
Xchar *map_dir;
Xchar *image_dir;
Xchar *zoom_dir;
Xint task_width;
Xint task_height;
XBoolean keep_tasks_square;
XBoolean retain_aspect_ratio;
Xint iteration_limit;
Xchar *hosts;
Xchar *drone_path;
X
X#define offset(field) XtOffset(struct AppResources *, field)
X
Xstatic XtResource resources[] = {
X {XtNmapDir, XtCPath, XtRString, sizeof(String),
X offset(map_dir), XtRString, (XtPointer) default_path},
X {XtNimageDir, XtCPath, XtRString, sizeof(String),
X offset(image_dir), XtRString, (XtPointer) default_path},
X {XtNzoomDir, XtCPath, XtRString, sizeof(String),
X offset(zoom_dir), XtRString, (XtPointer) default_path},
X {XtNtaskWidth, XtCWidth, XtRInt, sizeof(int),
X offset(task_width), XtRImmediate, (XtPointer) TASK_WIDTH},
X {XtNtaskHeight, XtCHeight, XtRInt, sizeof(int),
X offset(task_height), XtRImmediate, (XtPointer) TASK_HEIGHT},
X {XtNkeepTasksSquare, XtCBoolean, XtRBoolean, sizeof(Boolean),
X offset(keep_tasks_square), XtRImmediate, (XtPointer) True},
X {XtNretainAspectRatio, XtCBoolean, XtRBoolean, sizeof(Boolean),
X offset(retain_aspect_ratio), XtRImmediate, (XtPointer) True},
X {XtNiterationLimit, XtCLimit, XtRInt, sizeof(int),
X offset(iteration_limit), XtRImmediate, (XtPointer) ITERATION_LIMIT},
X {XtNhosts, XtCHosts, XtRString, sizeof(String),
X offset(hosts), XtRString, (XtPointer) NULL},
X {XtNdronePath, XtCPath, XtRString, sizeof(String),
X offset(drone_path), XtRString, (XtPointer) NULL},
X};
X
Xstatic XrmOptionDescRec options[] = {
X {"-map", "mapDir", XrmoptionSepArg, NULL},
X {"-image", "imageDir", XrmoptionSepArg, NULL},
X {"-zoom", "zoomDir", XrmoptionSepArg, NULL},
X {"-task_width", "taskWidth", XrmoptionSepArg, NULL},
X {"-task_height", "taskHeight", XrmoptionSepArg, NULL},
X {"-square", "keepTasksSquare", XrmoptionNoArg, "False"},
X {"-aspect", "retainAspectRatio", XrmoptionNoArg, "False"},
X {"-limit", "iterationLimit", XrmoptionSepArg, NULL},
X {"-hosts", "hosts", XrmoptionSepArg, NULL},
X {"-drone_path", "dronePath", XrmoptionSepArg, NULL},
X};
X
X/* Don't forget to update MenuItems.h if menu_items[] changes */
Xstatic MenuItem menu_items[] = {
X {"Draw", DrawFunc, NULL, False},
X {"Redraw", RedrawFunc, NULL, False},
X {"Zoom", ZoomFunc, NULL, False},
X {"Unzoom", UnzoomFunc, NULL, False},
X {"Rezoom", RezoomFunc, NULL, False},
X {"Top", TopFunc, NULL, False},
X {"Files", FileFunc, NULL, True},
X {"Drones", StartDroneFunc, NULL, True},
X {"Colormap", ColormapFunc, NULL, True},
X {"Settings", SettingsFunc, NULL, True},
X {"Quit", QuitFunc, NULL, True},
X {NULL, NULL, NULL, True},
X};
X
Xstatic Arg canvas_args[] = {
X {XtNresizable, (XtArgVal) True},
X {XtNhorizDistance, (XtArgVal) 0},
X {XtNvertDistance, (XtArgVal) 0},
X {XtNtop, (XtArgVal) XtChainTop},
X {XtNbottom, (XtArgVal) XtChainBottom},
X {XtNleft, (XtArgVal) XtChainLeft},
X {XtNright, (XtArgVal) XtChainRight},
X};
X
Xstatic Arg menu_popup_args[] = {
X {XtNborderWidth, (XtArgVal) 3},
X};
X
Xstatic Arg menu_args[] = {
X {XtNmenuItems, (XtArgVal) menu_items},
X};
X
X
X/*ARGSUSED*/
Xstatic void QuitFunc(widget, data, item)
XWidget widget; /* unused */
Xcaddr_t data; /* unused */
XCardinal item; /* unused */
X{
X CleanupAndDie();
X}
X
X
X/*ARGSUSED*/
Xstatic void DrawFunc(widget, data, item)
XWidget widget; /* unused */
Xcaddr_t data; /* unused */
XCardinal item; /* unused */
X{
X StartDrawing(canvas);
X}
X
X
X/*ARGSUSED*/
Xstatic void RedrawFunc(widget, data, item)
XWidget widget; /* unused */
Xcaddr_t data; /* unused */
XCardinal item; /* unused */
X{
X CanvasClear(canvas);
X MakeTasksStale();
X WasteTasks();
X StartDrawing(canvas);
X}
X
X
X/*ARGSUSED*/
Xstatic void ZoomFunc(widget, data, item)
XWidget widget; /* unused */
Xcaddr_t data; /* unused */
XCardinal item; /* unused */
X{
X char filename[32];
X extern Boolean FileExists();
X extern Boolean RemoveFile();
X
X BlatzZoomStack();
X
X /* We don't bother resaving everything if it hasn't changed since last
X * time it was saved. */
X if (CanvasNeedsSaving(canvas))
X {
X (void) sprintf(filename, "LEVEL%02d.cif", zoom_level);
X if (SaveEverything(zoom_dir, filename, True) == False)
X {
X /* Popup an error message box here */
X (void) sprintf(message, save_failed_msg, zoom_dir, filename);
X MessageSetup(message, (XtCallbackProc) NULL);
X DialogPopup(message_dialogbox);
X return;
X }
X }
X
X ++zoom_level;
X num_zoom_levels = zoom_level;
X
X /* we can now allow tops */
X (void) MenuChangeSensitivity(menu, MENU_TOP_ITEM, True);
X
X /* we can now allow unzooms */
X (void) MenuChangeSensitivity(menu, MENU_UNZOOM_ITEM, True);
X
X /* zoom not allowed until another region is specified */
X (void) MenuChangeSensitivity(menu, MENU_ZOOM_ITEM, False);
X
X /* rezoom stack is destroyed by new zoom */
X (void) MenuChangeSensitivity(menu, MENU_REZOOM_ITEM, False);
X
X CanvasClear(canvas);
X CanvasZoom(canvas);
X MakeTasksStale();
X WasteTasks();
X StartDrawing(canvas);
X}
X
X
X/*ARGSUSED*/
Xstatic void UnzoomFunc(widget, data, item)
XWidget widget; /* unused */
Xcaddr_t data; /* unused */
XCardinal item; /* unused */
X{
X char filename[32];
X
X /* We don't bother resaving everything if it hasn't changed since last
X * time it was saved. */
X if (CanvasNeedsSaving(canvas))
X {
X (void) sprintf(filename, "LEVEL%02d.cif", zoom_level);
X if (SaveEverything(zoom_dir, filename, True) == False)
X {
X /* Popup an error message box here */
X (void) sprintf(message, save_failed_msg, zoom_dir, filename);
X MessageSetup(message, (XtCallbackProc) NULL);
X DialogPopup(message_dialogbox);
X return;
X }
X }
X
X if (zoom_level > num_zoom_levels)
X num_zoom_levels = zoom_level;
X
X --zoom_level;
X
X if (zoom_level == 0)
X {
X /* cannot top any more */
X (void) MenuChangeSensitivity(menu, MENU_TOP_ITEM, False);
X
X /* cannot unzoom any more */
X (void) MenuChangeSensitivity(menu, MENU_UNZOOM_ITEM, False);
X }
X
X /* zoom not allowed until another region is specified */
X (void) MenuChangeSensitivity(menu, MENU_ZOOM_ITEM, False);
X
X /* rezoom are now allowed */
X (void) MenuChangeSensitivity(menu, MENU_REZOOM_ITEM, True);
X
X MakeTasksStale();
X WasteTasks();
X
X (void) sprintf(filename, "LEVEL%02d.cif", zoom_level);
X if (LoadEverything(zoom_dir, filename) == False)
X {
X /* Popup an error message box here */
X (void) sprintf(message, load_failed_msg, zoom_dir, filename);
X MessageSetup(message, (XtCallbackProc) NULL);
X DialogPopup(message_dialogbox);
X }
X}
X
X
X/*ARGSUSED*/
Xstatic void RezoomFunc(widget, data, item)
XWidget widget; /* unused */
Xcaddr_t data; /* unused */
XCardinal item; /* unused */
X{
X char filename[32];
X
X /* We don't bother resaving everything if it hasn't changed since last
X * time it was saved. */
X if (CanvasNeedsSaving(canvas))
X {
X (void) sprintf(filename, "LEVEL%02d.cif", zoom_level);
X if (SaveEverything(zoom_dir, filename, True) == False)
X {
X /* Popup an error message box here */
X (void) sprintf(message, save_failed_msg, zoom_dir, filename);
X MessageSetup(message, (XtCallbackProc) NULL);
X DialogPopup(message_dialogbox);
X return;
X }
X }
X
X MakeTasksStale();
X WasteTasks();
X
X ++zoom_level;
X
X (void) sprintf(filename, "LEVEL%02d.cif", zoom_level);
X if (LoadEverything(zoom_dir, filename) == False)
X {
X /* Popup an error message box here */
X (void) sprintf(message, load_failed_msg, zoom_dir, filename);
X MessageSetup(message, (XtCallbackProc) NULL);
X DialogPopup(message_dialogbox);
X return;
X }
X
X if (zoom_level == num_zoom_levels)
X /* rezoom not allowed (at end of zoom stack) */
X (void) MenuChangeSensitivity(menu, MENU_REZOOM_ITEM, False);
X
X /* we can now allow tops */
X (void) MenuChangeSensitivity(menu, MENU_TOP_ITEM, True);
X
X /* we can now allow unzooms */
X (void) MenuChangeSensitivity(menu, MENU_UNZOOM_ITEM, True);
X
X /* zoom not allowed until another region is specified */
X (void) MenuChangeSensitivity(menu, MENU_ZOOM_ITEM, False);
X}
X
X
X/*ARGSUSED*/
Xstatic void TopFunc(widget, data, item)
XWidget widget; /* unused */
Xcaddr_t data; /* unused */
XCardinal item; /* unused */
X{
X char filename[32];
X
X /* Don't need to bother, we're already at the top */
X if (zoom_level == 0)
X return;
X
X /* We don't bother resaving everything if it hasn't changed since last
X * time it was saved. */
X if (CanvasNeedsSaving(canvas))
X {
X (void) sprintf(filename, "LEVEL%02d.cif", zoom_level);
X if (SaveEverything(zoom_dir, filename, True) == False)
X {
X /* Popup an error message box here */
X (void) sprintf(message, save_failed_msg, zoom_dir, filename);
X MessageSetup(message, (XtCallbackProc) NULL);
X DialogPopup(message_dialogbox);
X return;
X }
X }
X
X if (zoom_level > num_zoom_levels)
X num_zoom_levels = zoom_level;
X
X zoom_level = 0;
X
X /* cannot top any more */
X (void) MenuChangeSensitivity(menu, MENU_TOP_ITEM, False);
X
X /* cannot unzoom any more */
X (void) MenuChangeSensitivity(menu, MENU_UNZOOM_ITEM, False);
X
X /* zoom not allowed until another region is specified */
X (void) MenuChangeSensitivity(menu, MENU_ZOOM_ITEM, False);
X
X if (zoom_level == num_zoom_levels)
X /* rezoom not allowed (at end of zoom stack) */
X (void) MenuChangeSensitivity(menu, MENU_REZOOM_ITEM, False);
X else
X /* rezoom is allowed (more zoom stack below us) */
X (void) MenuChangeSensitivity(menu, MENU_REZOOM_ITEM, True);
X
X MakeTasksStale();
X WasteTasks();
X
X (void) sprintf(filename, "LEVEL%02d.cif", zoom_level);
X if (LoadEverything(zoom_dir, filename) == False)
X {
X /* Popup an error message box here */
X (void) sprintf(message, load_failed_msg, zoom_dir, filename);
X MessageSetup(message, (XtCallbackProc) NULL);
X DialogPopup(message_dialogbox);
X }
X}
X
X
X/*ARGSUSED*/
Xstatic void FileFunc(widget, data, item)
XWidget widget; /* unused */
Xcaddr_t data; /* unused */
XCardinal item; /* unused */
X{
X FileUpdateFileList();
X DialogPopup(file_dialogbox);
X}
X
X
X/*ARGSUSED*/
Xstatic void StartDroneFunc(widget, data, item)
XWidget widget; /* unused */
Xcaddr_t data; /* unused */
XCardinal item; /* unused */
X{
X DialogPopup(drone_dialogbox);
X}
X
X
X/*ARGSUSED*/
Xstatic void ColormapFunc(widget, data, item)
XWidget widget; /* unused */
Xcaddr_t data; /* unused */
XCardinal item; /* unused */
X{
X extern void ColormapUpdateSliders();
X
X rotating_save = rotating;
X rotating = False;
X colormap_alignment = GetColormapAlignment();
X AlignColormap(dpy, colormap, NUM_RESERVED);
X ColormapUpdateSliders();
X ColormapUpdateFileList();
X DialogPopup(colormap_dialogbox);
X}
X
X
X/*ARGSUSED*/
Xstatic void SettingsFunc(widget, data, item)
XWidget widget; /* unused */
Xcaddr_t data; /* unused */
XCardinal item; /* unused */
X{
X DialogPopup(settings_dialogbox);
X}
X
X
Xvoid CallStoreColormap()
X{
X StoreColormap(dpy, colormap);
X}
X
X
Xvoid CleanupAndDie()
X{
X zoom_level = -1;
X /* Remove the entire zoom stack */
X BlatzZoomStack();
X exit(0);
X}
X
X
Xvoid BlatzZoomStack()
X{
X char filename[32];
X extern Boolean FileExists();
X extern Boolean RemoveFile();
X
X /* If a LEVEL file exists for lower levels blatz them. */
X ++num_zoom_levels;
X while (--num_zoom_levels > zoom_level)
X {
X (void) sprintf(filename, "LEVEL%02d.cif", num_zoom_levels);
X if (FileExists(zoom_dir, filename))
X if (RemoveFile(zoom_dir, filename) == False)
X abort();
X }
X}
X
X
XUsage(prog_name, terse)
Xchar *prog_name;
XBoolean terse;
X{
X if (terse)
X {
X (void) fprintf(stderr, "Usage:\n %s ", prog_name);
X (void) fprintf(stderr, "[-help] ");
X (void) fprintf(stderr, "[-map <pathname>] ");
X (void) fprintf(stderr, "[-image <pathname>] ");
X (void) fprintf(stderr, "[-zoom <pathname>] ");
X (void) fprintf(stderr, "\n\t");
X (void) fprintf(stderr, "[-task_width <int>] ");
X (void) fprintf(stderr, "[-task_height <int>] ");
X (void) fprintf(stderr, "[-square] ");
X (void) fprintf(stderr, "[-aspect] ");
X (void) fprintf(stderr, "\n\t");
X (void) fprintf(stderr, "[-limit <int>] ");
X (void) fprintf(stderr, "[-hosts <string>] ");
X (void) fprintf(stderr, "\n\n");
X (void) fprintf(stderr, "Type %s -help for a full description\n",
X prog_name);
X }
X else
X {
X (void) fprintf(stderr, "Available options include:\n");
X (void) fprintf(stderr, " -help\t\t\tprovide this help message\n");
X (void) fprintf(stderr, " -map <pathname>\t\tpath to look for colormaps\n");
X (void) fprintf(stderr, " -image <pathname>\t\tpath to load/store images\n");
X (void) fprintf(stderr, " -zoom <pathname>\t\tpath to store image stack while zooming\n");
X (void) fprintf(stderr, " -task_width <int>\t\twidth of task region\n");
X (void) fprintf(stderr, " -task_height <int>\t\theight of task region\n");
X (void) fprintf(stderr, " -square\t\t\tturn off square task limitation\n");
X (void) fprintf(stderr, " -aspect\t\t\tturn off aspect ratio preservation\n");
X (void) fprintf(stderr, " -limit <int>\t\tmaximum iteration limit\n");
X (void) fprintf(stderr, " -hosts <string>\t\tlist of hosts on which to run drones\n");
X }
X exit(0);
X}
X
X
X
Xmain(argc, argv)
Xint argc;
Xchar **argv;
X{
X XEvent event;
X static char menu_popup_translations[] =
X "<Btn3Down>: popup(menu_popup.menu)\n";
X extern int SubstituteErrorHandler();
X extern void ShowEvent();
X
X XSetErrorHandler(SubstituteErrorHandler);
X
X top_level = XtInitialize(NULL, "Chaos", options, XtNumber(options),
X &argc, argv);
X
X if (argc > 1)
X {
X if (strcmp(argv[1], "-help") == 0)
X Usage(argv[0], False);
X else
X Usage(argv[0], True);
X }
X
X XtGetApplicationResources(top_level, &app_resources, resources,
X XtNumber(resources), NULL, 0);
X
X /* provide simple external access to these application specific resources */
X map_dir = app_resources.map_dir;
X image_dir = app_resources.image_dir;
X zoom_dir = app_resources.zoom_dir;
X task_width = app_resources.task_width;
X task_height = app_resources.task_height;
X keep_tasks_square = app_resources.keep_tasks_square;
X retain_aspect_ratio = app_resources.retain_aspect_ratio;
X iteration_limit = app_resources.iteration_limit;
X hosts = app_resources.hosts;
X drone_path = app_resources.drone_path;
X
X dpy = XtDisplay(top_level);
X screen = XtScreen(top_level);
X
X if (CellsOfScreen(screen) == 2)
X {
X /* Must be a monochrome screen - not currently supported */
X printf("%s: Not currently supported on monochrome displays\n", argv[0]);
X exit(0);
X }
X
X /* Don't let the X socket get inherited by child processes */
X (void) fcntl(ConnectionNumber(dpy), F_SETFD, 1);
X
X canvas = XtCreateManagedWidget("canvas", canvasWidgetClass,
X top_level, canvas_args, XtNumber(canvas_args));
X
X menu_popup = XtCreatePopupShell("menu_popup", overrideShellWidgetClass,
X top_level, menu_popup_args, XtNumber(menu_popup_args));
X
X menu = XtCreateManagedWidget("menu", menuWidgetClass, menu_popup,
X menu_args, XtNumber(menu_args));
X
X XtOverrideTranslations(canvas,
X XtParseTranslationTable(menu_popup_translations));
X
X colormap_dialogbox = ColormapCreateDialogbox(top_level);
X drone_dialogbox = DroneCreateDialogbox(top_level);
X file_dialogbox = FileCreateDialogbox(top_level);
X settings_dialogbox = SettingsCreateDialogbox(top_level);
X message_dialogbox = MessageCreateDialogbox(top_level);
X confirm_dialogbox = ConfirmCreateDialogbox(top_level);
X
X GetReservedColors(dpy, screen);
X if (ReadColors(map_dir, "default.map") == False)
X StoreHSB(1);
X
X XtRealizeWidget(top_level);
X
X window = XtWindow(top_level);
X
X if (InitIpc(XtWindow(canvas)) == False)
X {
X eprintf("Could not initialize IPC\n");
X abort();
X }
X SetOwner(CHAOS_WINDOW);
X
X while (1)
X {
X if (rotating && !XPending(dpy))
X {
X RotateColormap(dpy, colormap, rotation_dir);
X }
X else
X {
X XtNextEvent(&event);
X if (event.type == DestroyNotify)
X {
X event.xdestroywindow.event = XtWindow(canvas);
X#ifdef DEBUG
X ShowEvent(&event);
X (void) printf("\n");
X#endif
X }
X XtDispatchEvent(&event);
X#ifdef DEBUG
X fflush(stdout);
X#endif
X }
X }
X}
END_OF_FILE
if test 18472 -ne `wc -c <'master/master.c'`; then
echo shar: \"'master/master.c'\" unpacked with wrong size!
fi
# end of 'master/master.c'
fi
if test -f 'widgets/Palette.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'widgets/Palette.c'\"
else
echo shar: Extracting \"'widgets/Palette.c'\" \(14272 characters\)
sed "s/^X//" >'widgets/Palette.c' <<'END_OF_FILE'
X/*
X * Copyright (c) Ken W. Marks 1989, 1990.
X */
X
X#include <stdio.h>
X#include <X11/IntrinsicP.h>
X#include <X11/StringDefs.h>
X#include <Chaos.h>
X#include <LocalDefs.h>
X#include <PaletteP.h>
X#include <Colormap.h>
X#include <DlgShell.h>
X
X#define ARROW '\037'
X#define BLANK '\036'
X
Xstatic void PaletteInitialize();
Xstatic void PaletteRealize();
Xstatic void PaletteRedisplay();
Xstatic void PaletteDestroy();
Xstatic void PaletteGoto();
Xstatic void PaletteDrawArrow();
Xstatic void PaletteChangeWithKey();
Xstatic void PaletteChangeWithButton();
Xstatic void PaletteFocusIn();
Xstatic void PaletteFocusOut();
Xstatic void PaletteMark();
Xstatic void PaletteBtnUp();
Xstatic void PaletteLeave();
Xstatic void PaletteMotion();
Xstatic void PaletteHighlightCell();
Xstatic void PaletteUnhighlightCell();
X
X#define offset(field) XtOffset(PaletteWidget, palette.field)
X#define goffset(field) XtOffset(Widget,core.field)
X
Xstatic XtResource palette_resources[] = {
X {XtNcellSize, XtCCellSize, XtRDimension, sizeof(Dimension),
X offset(cell_size), XtRImmediate, (caddr_t) 10},
X {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
X offset(foreground), XtRString, "Black"},
X {XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel),
X goffset(background_pixel), XtRString, "White"},
X {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
X offset(font), XtRString, "chaos-bold"},
X {XtNcallback, XtCCallback, XtRCallback, sizeof(caddr_t),
X offset(callbacks), XtRCallback, (caddr_t) NULL},
X {XtNdialogbox, XtCWidget, XtRWidget, sizeof(Widget),
X offset(dialogbox), XtRWidget, (caddr_t) NULL},
X};
X
Xstatic XtActionsRec palette_actions[] =
X{
X {"mark", PaletteMark},
X {"goto", PaletteGoto},
X {"change", PaletteChangeWithKey},
X {"focus_in", PaletteFocusIn},
X {"focus_out", PaletteFocusOut},
X {"release", PaletteBtnUp},
X {"leave", PaletteLeave},
X {"move", PaletteMotion},
X};
X
Xstatic char palette_translations[] =
X"<BtnDown>: mark()\n\
X <BtnUp>: release()\n\
X <Motion>: move()\n\
X <Leave>: leave()\n\
X Shift<Key>Tab: goto(PREV)\n\
X <Key>Tab: goto(NEXT)\n\
X <Key>Left: change(LEFT)\n\
X <Key>Right: change(RIGHT)\n\
X <Key>Up: change(UP)\n\
X <Key>Down: change(DOWN)\n\
X <FocusIn>: focus_in()\n\
X <FocusOut>: focus_out()\n\
X";
X
X#define superclass (&simpleClassRec)
X
XPaletteClassRec paletteClassRec = {
X {
X /* core fields */
X /* superclass */ (WidgetClass) superclass,
X /* class_name */ "Palette",
X /* widget_size */ sizeof(PaletteRec),
X /* class_initialize */ NULL,
X /* class_part_initialize */ NULL,
X /* class_inited */ FALSE,
X /* initialize */ PaletteInitialize,
X /* initialize_hook */ NULL,
X /* realize */ PaletteRealize,
X /* actions */ palette_actions,
X /* num_actions */ XtNumber(palette_actions),
X /* resources */ palette_resources,
X /* resource_count */ XtNumber(palette_resources),
X /* xrm_class */ NULLQUARK,
X /* compress_motion */ TRUE,
X /* compress_exposure */ TRUE,
X /* compress_enterleave */ TRUE,
X /* visible_interest */ FALSE,
X /* destroy */ PaletteDestroy,
X /* resize */ NULL,
X /* expose */ PaletteRedisplay,
X /* set_values */ NULL,
X /* set_values_hook */ NULL,
X /* set_values_almost */ XtInheritSetValuesAlmost,
X /* get_values_hook */ NULL,
X /* accept_focus */ NULL,
X /* version */ XtVersion,
X /* callback_private */ NULL,
X /* tm_table */ palette_translations,
X /* query_geometry */ NULL,
X /* display_accelerator */ XtInheritDisplayAccelerator,
X /* extension */ NULL
X },
X {
X /* Simple class fields initialization */
X /* change_sensitive */ XtInheritChangeSensitive
X }
X};
X
X
XWidgetClass paletteWidgetClass = (WidgetClass) & paletteClassRec;
X
X
X/************************************************************/
X/******************** Private Procedures ********************/
X/************************************************************/
X
X
Xstatic void PaletteGetGC(w)
XPaletteWidget w;
X{
X XGCValues values;
X
X values.foreground = w->palette.foreground;
X values.background = w->core.background_pixel;
X values.font = w->palette.font->fid;
X values.line_width = 2;
X
X w->palette.normal_gc = XtGetGC((Widget) w, (unsigned) GCForeground |
X GCBackground | GCFont | GCLineWidth, &values);
X
X values.foreground = values.background;
X
X w->palette.clear_gc = XtGetGC((Widget) w, (unsigned) GCForeground |
X GCBackground | GCFont, &values);
X
X values.background = w->palette.foreground;
X
X w->palette.reverse_gc = XtGetGC((Widget) w, (unsigned) GCForeground |
X GCBackground | GCFont | GCLineWidth, &values);
X}
X
X
Xstatic void PaletteSetSize(w)
XPaletteWidget w;
X{
X XtWidgetGeometry my_request;
X XFontStruct *fs = w->palette.font;
X Cardinal width = fs->max_bounds.width;
X Cardinal array_size = (w->palette.unit_space * 16) + 4;
X
X w->palette.baseline = fs->max_bounds.ascent + 1;
X w->palette.char_width = width;
X
X my_request.request_mode = CWWidth | CWHeight | CWBorderWidth;
X my_request.width = width + array_size;
X my_request.height = array_size;
X my_request.border_width = 0;
X
X XtMakeGeometryRequest((Widget) w, &my_request, NULL);
X}
X
X
X/*ARGSUSED*/
Xstatic void PaletteInitialize(request, new)
XWidget request; /* unused */
XWidget new;
X{
X PaletteWidget w = (PaletteWidget) new;
X
X if (w->palette.dialogbox == NULL)
X {
X eprintf("XtNdialogbox not set\n");
X abort();
X }
X
X w->palette.x_pos = NUM_RESERVED;
X w->palette.y_pos = 0;
X w->palette.unit_space = w->palette.cell_size + 2;
X w->palette.active = False;
X w->palette.scrolling = False;
X
X PaletteGetGC(w);
X PaletteSetSize(w);
X}
X
X
Xstatic void PaletteRealize(widget, valueMask, attrs)
XWidget widget;
XXtValueMask *valueMask;
XXSetWindowAttributes *attrs;
X{
X PaletteWidget w = (PaletteWidget) widget;
X Display *dpy = XtDisplay(w);
X Window window;
X int ii, jj;
X unsigned long color = 0;
X
X XtCreateWindow(widget, InputOutput, (Visual *) CopyFromParent,
X *valueMask, attrs);
X
X window = XtWindow(w);
X
X w->palette.pixmap = XCreatePixmap(dpy, window, w->core.width,
X w->core.height, w->core.depth);
X
X if (!w->palette.pixmap)
X {
X eprintf("Insufficient space for pixmap\n");
X abort();
X }
X
X XFillRectangle(dpy, w->palette.pixmap, w->palette.clear_gc, 0, 0,
X w->palette.char_width, w->core.height);
X
X XFillRectangle(dpy, w->palette.pixmap, w->palette.normal_gc,
X w->palette.char_width, 0, w->core.width - w->palette.char_width,
X w->core.height);
X
X for (ii = 0; ii < 16; ii++)
X for (jj = 0; jj < 16; jj++, color++)
X {
X XSetForeground(dpy, w->palette.normal_gc, color);
X XFillRectangle(dpy, w->palette.pixmap, w->palette.normal_gc,
X w->palette.char_width + 3 + w->palette.unit_space * jj,
X 3 + w->palette.unit_space * ii, w->palette.cell_size,
X w->palette.cell_size);
X }
X XSetForeground(dpy, w->palette.normal_gc, w->palette.foreground);
X}
X
X
X
X/*ARGSUSED*/
Xstatic void PaletteRedisplay(widget, event, region)
XWidget widget;
XXEvent *event;
XRegion region; /* unused */
X{
X PaletteWidget w = (PaletteWidget) widget;
X Display *dpy = XtDisplay(w);
X Window window = XtWindow(w);
X XExposeEvent *ev = (XExposeEvent *) event;
X
X if (XtIsRealized(widget) == False)
X return;
X
X XCopyArea(dpy, w->palette.pixmap, window, w->palette.normal_gc,
X ev->x, ev->y, (unsigned) ev->width, (unsigned) ev->height, ev->x, ev->y);
X
X PaletteDrawArrow(widget);
X PaletteHighlightCell(widget);
X}
X
X
Xstatic void PaletteDestroy(widget)
XWidget widget;
X{
X PaletteWidget w = (PaletteWidget) widget;
X
X XtReleaseGC(widget, w->palette.normal_gc);
X XtReleaseGC(widget, w->palette.clear_gc);
X XtReleaseGC(widget, w->palette.reverse_gc);
X}
X
X
Xstatic void PaletteDrawArrow(widget)
XWidget widget;
X{
X PaletteWidget w = (PaletteWidget) widget;
X Display *dpy = XtDisplay(w);
X Window window = XtWindow(w);
X char active_string[1];
X
X /* must convert the arrow/blank char into string for printing */
X active_string[0] = w->palette.active ? ARROW : BLANK;
X
X XDrawImageString(dpy, window, w->palette.normal_gc, 0,
X (int) w->palette.baseline, active_string, 1);
X}
X
X
Xstatic void PaletteHighlightCell(widget)
XWidget widget;
X{
X PaletteWidget w = (PaletteWidget) widget;
X Display *dpy = XtDisplay(w);
X Window window = XtWindow(w);
X int x, y;
X
X x = w->palette.char_width + 2 + w->palette.unit_space * w->palette.x_pos;
X y = 2 + w->palette.unit_space * w->palette.y_pos;
X
X XDrawRectangle(dpy, window, w->palette.reverse_gc, x, y,
X (unsigned) w->palette.unit_space, (unsigned) w->palette.unit_space);
X}
X
X
Xstatic void PaletteUnhighlightCell(widget)
XWidget widget;
X{
X PaletteWidget w = (PaletteWidget) widget;
X Display *dpy = XtDisplay(w);
X Window window = XtWindow(w);
X int x, y;
X
X x = w->palette.char_width + 2 + w->palette.unit_space * w->palette.x_pos;
X y = 2 + w->palette.unit_space * w->palette.y_pos;
X
X XDrawRectangle(dpy, window, w->palette.normal_gc, x, y,
X w->palette.unit_space, w->palette.unit_space);
X}
X
X
X/***********************************************************/
X/******************** Action Procedures ********************/
X/***********************************************************/
X
X
X/*ARGSUSED*/
Xstatic void PaletteFocusIn(widget, event, params, num_params)
XWidget widget;
XXEvent *event;
XString *params;
XCardinal *num_params; /* unused */
X{
X PaletteWidget w = (PaletteWidget) widget;
X
X if (w->palette.active == False)
X {
X w->palette.active = True;
X PaletteDrawArrow(widget);
X }
X}
X
X
X/*ARGSUSED*/
Xstatic void PaletteFocusOut(widget, event, params, num_params)
XWidget widget;
XXEvent *event;
XString *params;
XCardinal *num_params; /* unused */
X{
X PaletteWidget w = (PaletteWidget) widget;
X
X if (w->palette.active == True)
X {
X w->palette.active = False;
X PaletteDrawArrow(widget);
X }
X}
X
X
X/* ARGSUSED */
Xstatic void PaletteGoto(widget, event, params, num_params)
XWidget widget;
XXEvent *event; /* unused */
XString *params;
XCardinal *num_params; /* unused */
X{
X PaletteWidget w = (PaletteWidget) widget;
X
X switch (params[0][0])
X {
X case 'P':
X DialogSetPrevFocus(w->palette.dialogbox);
X break;
X
X case 'N':
X DialogSetNextFocus(w->palette.dialogbox);
X break;
X }
X
X w->palette.active = False;
X PaletteDrawArrow(widget);
X}
X
X
X/* ARGSUSED */
Xstatic void PaletteChangeWithKey(widget, event, params, num_params)
XWidget widget;
XXEvent *event; /* unused */
XString *params;
XCardinal *num_params; /* unused */
X{
X PaletteWidget w = (PaletteWidget) widget;
X
X switch (params[0][0])
X {
X case 'L':
X if (w->palette.x_pos <= 0)
X return;
X
X /* don't allow reserved pixels (0 to NUM_RESERVED-1) to be altered */
X if (w->palette.x_pos == NUM_RESERVED && w->palette.y_pos == 0)
X return;
X
X PaletteUnhighlightCell(widget);
X --w->palette.x_pos;
X PaletteHighlightCell(widget);
X break;
X
X case 'R':
X if (w->palette.x_pos >= 15)
X return;
X
X PaletteUnhighlightCell(widget);
X ++w->palette.x_pos;
X PaletteHighlightCell(widget);
X break;
X
X case 'U':
X if (w->palette.y_pos <= 0)
X return;
X
X /* don't allow reserved pixels (0 to NUM_RESERVED-1) to be altered */
X if (w->palette.y_pos == 1 && w->palette.x_pos < NUM_RESERVED)
X return;
X
X PaletteUnhighlightCell(widget);
X --w->palette.y_pos;
X PaletteHighlightCell(widget);
X break;
X
X case 'D':
X if (w->palette.y_pos >= 15)
X return;
X
X PaletteUnhighlightCell(widget);
X ++w->palette.y_pos;
X PaletteHighlightCell(widget);
X break;
X }
X XtCallCallbacks(widget, XtNcallback, (XtPointer) (w->palette.y_pos * 16 +
X w->palette.x_pos));
X}
X
X
Xstatic void PaletteChangeWithButton(widget, x, y)
XWidget widget;
Xint x;
Xint y;
X{
X PaletteWidget w = (PaletteWidget) widget;
X int new_x_pos, new_y_pos;
X
X new_x_pos = (x - w->palette.char_width - 2) / w->palette.unit_space;
X new_y_pos = (y - 2) / w->palette.unit_space;
X
X if (new_x_pos < 0 || new_x_pos > 15 || new_y_pos < 0 || new_y_pos > 15)
X return;
X
X if (new_x_pos == w->palette.x_pos && new_y_pos == w->palette.y_pos)
X return;
X
X /* don't allow reserved pixels (0 to NUM_RESERVED-1) to be altered */
X if (new_x_pos < NUM_RESERVED && new_y_pos == 0)
X return;
X
X PaletteUnhighlightCell(widget);
X
X w->palette.x_pos = new_x_pos;
X w->palette.y_pos = new_y_pos;
X
X PaletteHighlightCell(widget);
X
X XtCallCallbacks(widget, XtNcallback, (XtPointer) (w->palette.y_pos * 16 +
X w->palette.x_pos));
X}
X
X
X/*ARGSUSED*/
Xstatic void PaletteMark(widget, event, params, num_params)
XWidget widget;
XXEvent *event;
XString *params; /* unused */
XCardinal *num_params; /* unused */
X{
X PaletteWidget w = (PaletteWidget) widget;
X XButtonEvent *ev = (XButtonEvent *) & event->xbutton;
X
X w->palette.active = True;
X w->palette.scrolling = True;
X DialogSetNewFocus(w->palette.dialogbox, widget);
X
X PaletteDrawArrow(widget);
X PaletteChangeWithButton(widget, ev->x, ev->y);
X}
X
X
X/*ARGSUSED*/
Xstatic void PaletteBtnUp(widget, event, params, num_params)
XWidget widget;
XXEvent *event;
XString *params; /* unused */
XCardinal *num_params; /* unused */
X{
X PaletteWidget w = (PaletteWidget) widget;
X XButtonEvent *ev = (XButtonEvent *) & event->xbutton;
X
X w->palette.scrolling = False;
X PaletteChangeWithButton(widget, ev->x, ev->y);
X}
X
X
X/*ARGSUSED*/
Xstatic void PaletteLeave(widget, event, params, num_params)
XWidget widget;
XXEvent *event;
XString *params; /* unused */
XCardinal *num_params; /* unused */
X{
X PaletteWidget w = (PaletteWidget) widget;
X XCrossingEvent *ev = (XCrossingEvent *) & event->xcrossing;
X
X if (w->palette.scrolling == False)
X return;
X
X w->palette.scrolling = False;
X PaletteChangeWithButton(widget, ev->x, ev->y);
X}
X
X
X/*ARGSUSED*/
Xstatic void PaletteMotion(widget, event, params, num_params)
XWidget widget;
XXEvent *event;
XString *params; /* unused */
XCardinal *num_params; /* unused */
X{
X PaletteWidget w = (PaletteWidget) widget;
X Display *dpy = XtDisplay(w);
X Window window = XtWindow(w);
X XMotionEvent *ev = (XMotionEvent *) & event->xmotion;
X
X /* Always skip ahead to the latest ButtomMotionEvent in the queue */
X /* SUPPRESS 530 */
X while (XCheckWindowEvent(dpy, window, ButtonMotionMask, ev));
X
X if (w->palette.scrolling == False)
X return;
X
X PaletteChangeWithButton(widget, ev->x, ev->y);
X}
END_OF_FILE
if test 14272 -ne `wc -c <'widgets/Palette.c'`; then
echo shar: \"'widgets/Palette.c'\" unpacked with wrong size!
fi
# end of 'widgets/Palette.c'
fi
echo shar: End of archive 3 \(of 10\).
cp /dev/null ark3isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 10 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
dan
----------------------------------------------------
O'Reilly && Associates argv@sun.com / argv@ora.com
Opinions expressed reflect those of the author only.