v04i078: xpic -- pic previewer for X11, Part13/15

Dan Heller argv at island.uu.net
Sat Jul 22 17:42:07 AEST 1989


Submitted-by: Mark Moraes <moraes at ai.toronto.edu>
Posting-number: Volume 4, Issue 78
Archive-name: xpic/part13



#! /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 13 (of 15)."
# Contents:  xpic/test/van.ps xpic/windows.c
# Wrapped by moraes at neat.ai on Thu Jul 13 22:36:12 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'xpic/test/van.ps' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/test/van.ps'\"
else
echo shar: Extracting \"'xpic/test/van.ps'\" \(18365 characters\)
sed "s/^X//" >'xpic/test/van.ps' <<'END_OF_FILE'
X%!
X%%Creator: root at bay.csri (Operator)
X%%Title: van.xpic (xpic)
X%%CreationDate: Wed May  4 23:53:47 1988
X%%Pages: 1
X%%DocumentFonts: (atend)
X%%BoundingBox: 96.3 43.2 612 830.7
X%	(in inches) at 1.3375 0.6, width 7.1625, height 10.9375
X%%EndComments
X% Prolog for xpic to PostScript converter
X% Author: Mark Moraes
X% $Header: x2ps.pro,v 1.2 88/03/19 16:50:09 moraes Exp 
X%	%d D - change style SOLID, DOTTED, SHORT-DASH, LONG-DASH, DOT-DASH
X%	%d F - change font ROMAN, BOLD, ITALIC, SPECIAL
X%	%d S - change size (font size in points)
X%	(%s) rj %d t - text right just. (%d is TOPLINE, MIDLINE, BOTLINE)
X%	(%s) lj %d t - text left just. (%d is TOPLINE, MIDLINE, BOTLINE)
X%	(%s) ce %d t - text centered (%d is TOPLINE, MIDLINE, BOTLINE)
X%	%d %d l - lineto
X%	%d %d m - moveto
X%	%d %d s - spline segment
X%	x - flush line, spline
X%	<wid> <ht> <x> <y> b - box
X%	<wid> <ht> <x> <y> e - ellipse
X%	%d ss - setscale
X%	%d W - change linewidth
Xsave 50 dict begin /xpic exch def
X/StartXpic {newpath 0 0 moveto [] 0 setdash 0 setgray 1 setlinecap} def
X% Set defaults
X/fontname /Times-Roman def
X/ptsize 12 def
X% xpic has 4 fonts R, B, I, S
X/nfonts 4 def
X/fonts /Times-Roman /Times-Bold /Times-Italic /Symbol nfonts array astore def
X% halign has the values for MIDLINE, TOPLINE, BOTLINE
X/halign 3 array def
X/s {rcurveto} def
X/x {stroke} def
X/l {lineto} def
X/m {moveto} def
X/b {
X	/ury exch def /urx exch def /lly exch def /llx exch def 
X	llx lly moveto urx lly lineto urx ury lineto 
X	llx ury lineto llx lly lineto stroke
X} def
X/mtrx matrix def
X/e {
X	/yc exch def /xc exch def /yrad exch def /xrad exch def
X	xc xrad add yc moveto
X	/savematrix mtrx currentmatrix def
X	xc yc translate
X	xrad yrad scale
X	0 0 1 0 360 arc
X	savematrix setmatrix stroke
X} def
X% The next three take the text string, and moveto the right horiz. position
X% leaving the string on the stack.
X/lj {} def
X/rj {dup stringwidth pop neg 0 rmoveto} def
X/ce {dup stringwidth pop 2 div neg 0 rmoveto} def
X% And this is invoked after one of the three above, and 
X% computes the vert. pos, and then displays the string.
X/t {halign exch get 0 exch rmoveto show newpath} def
X% Store an array of patterns in /styles - a pattern is an array consisting 
X% of an array and an offset. Corresp to xpic patterns
X% solid, dotted, short-dashed, long-dashed, dot-dashed
X/styles [ [] 0 ] [ [1 3] 0 ] [ [4 4] 0 ] [ [8 4] 0 ] [ [1 4 4 4] 0 ]
X	5 array astore def
X% change style to arg.
X/D {stroke styles exch get aload pop setdash newpath} def
X/W {stroke setlinewidth newpath} def
X% fontbox takes a fontname of the stack, and returns an array
X% containing the values of the bottom line of the bounding box, the
X% mid line of the bounding box, and the top line of the bounding box
X% of that font, taken from the baseline, scaled to a font of size 1
X/fontbox {
X	findfont dup /FontMatrix get /fm exch def /FontBBox get aload pop
X	/ytop exch def pop /ybot exch def pop
X	/ymid ytop ybot sub 2 div def
X	0 ybot fm dtransform exch pop % botline
X	dup neg exch % midline - this works better than (ytop-ybot)/2!
X	0 ytop fm dtransform exch pop exch %topline
X	% now in the order midline, topline, botline.
X	3 array astore
X} def
X% fontboxes stores the fontbox of each of the fontnames in the 'fonts'
X% array
X/fontboxes nfonts array def
X0 1 nfonts 1 sub {
X	fontboxes exch dup fonts exch get fontbox put
X} for
X% select font
X/F {
X	dup fonts exch get /fontname exch def fontboxes exch get
X	/thisfontbox exch def SF 
X} def
X% set point size
X/S {/ptsize exch def SF} def
X% actually set font
X/SF {
X	fontname findfont ptsize curscale div scalefont setfont
X	thisfontbox aload pop
X	1 1 3 {
X		pop ptsize mul curscale div neg 3 1 roll
X	} for
X	halign astore pop
X} def
X% sets the scale to 72 / n, where n is on the stack, and stores the value
X% in curscale for font scaling
X/curscale 1 def
X/ss {/curscale exch 72 exch div dup dup scale def} def
X/land {8.5 72 mul curscale div 0 translate 90 rotate} def
XStartXpic
X%%EndProlog
Xland
X1 1 scale
X80 ss
X0 F
X14 S
X495 77 m
X(ODU - Operand Decode Unit) ce 1 t
X10 S
X163 85 m
X(ind2) ce 1 t
X331 89 m
X(ind1) ce 1 t
X79 125 m
X(ind2.set) ce 1 t
X0 D
X163 177 m
X163 161 l
Xx
X155 161 m
X171 161 l
Xx
X331 177 m
X331 161 l
X323 161 l
X339 161 l
Xx
X323 161 m
X331 145 l
X339 161 l
Xx
X155 161 m
X163 145 l
X171 161 l
Xx
X3 3 162 141 e
X3 3 331 145 e
X331 141 m
X331 129 l
X0 D
X335 138 m
X331 129 l
X328 138 l
X0 D
X331 129 m
Xx
X163 137 m
X163 125 l
X0 D
X167 134 m
X163 125 l
X160 134 l
X0 D
X163 125 m
Xx
X311 129 m
X355 129 l
X347 113 l
X315 113 l
X307 129 l
Xx
X143 121 m
X187 121 l
X179 105 l
X151 105 l
X155 105 l
X147 105 l
X139 121 l
Xx
X331 113 m
X331 93 l
X0 D
X335 102 m
X331 93 l
X328 102 l
X0 D
X331 93 m
Xx
X163 105 m
X163 85 l
X0 D
X167 94 m
X163 85 l
X160 94 l
X0 D
X163 85 m
Xx
X111 137 m
X151 137 l
X151 121 l
X0 D
X155 130 m
X151 121 l
X148 130 l
X0 D
X151 121 m
Xx
X291 145 m
X315 145 l
X315 129 l
X0 D
X319 138 m
X315 129 l
X312 138 l
X0 D
X315 129 m
Xx
X291 121 m
X311 121 l
X0 D
X303 125 m
X311 121 l
X303 118 l
X0 D
X311 121 m
Xx
X107 113 m
X143 113 l
X0 D
X135 117 m
X143 113 l
X135 110 l
X0 D
X143 113 m
Xx
X75 145 m
X(ind2.val) ce 1 t
X267 129 m
X(ind1.set) ce 1 t
X263 153 m
X(ind1.val) ce 1 t
X355 185 m
X(QA\(7\)) ce 1 t
X139 185 m
X(QA\(6\)) ce 1 t
X319 261 m
X0 0 0 1 0 4 s
X0 2 1 5 4 8 s
X2 2 5 2 8 0 s
X2 -2 4 -6 4 -12 s
Xx
X319 261 m
X0 0 5 0 16 0 s
Xx
X2 2 299 346 e
X287 381 m
X291 381 l
X0 D
X283 385 m
X291 381 l
X283 378 l
X0 D
X291 381 m
Xx
X283 337 m
X291 337 l
X0 D
X283 341 m
X291 337 l
X283 334 l
X0 D
X291 337 m
Xx
X315 401 m
X339 401 l
Xx
X419 445 m
X315 445 l
X315 377 l
X335 377 l
Xx
X283 381 m
X303 381 l
X303 393 l
X335 393 l
Xx
X287 381 m
X287 345 l
X299 345 l
Xx
X287 337 m
X303 337 l
Xx
X319 341 m
X327 341 l
X327 369 l
X335 369 l
Xx
X351 373 m
X375 373 l
X375 349 l
X415 349 l
X0 D
X407 353 m
X415 349 l
X407 346 l
X0 D
X415 349 m
Xx
X351 397 m
X383 397 l
X383 365 l
X415 365 l
X0 D
X407 369 m
X415 365 l
X407 362 l
X0 D
X415 365 m
Xx
X415 429 m
X391 429 l
X391 381 l
X415 381 l
X0 D
X407 385 m
X415 381 l
X407 378 l
X0 D
X415 381 m
Xx
X415 413 m
X399 413 l
X399 333 l
X415 333 l
X0 D
X407 337 m
X415 333 l
X407 330 l
X0 D
X415 333 m
Xx
X415 389 495 325 b
X12 S
X447 341 m
X(IBASE) ce 1 t
X471 357 m
X(ROM) ce 0 t
X471 373 m
X(4X5bit) ce 0 t
X431 349 m
X(SP) ce 0 t
X431 365 m
X(FP) ce 0 t
X431 381 m
X(PC) ce 0 t
X127 389 m
X0 0 0 1 0 4 s
X0 2 1 5 4 8 s
X2 2 5 2 8 0 s
X2 -2 4 -6 4 -12 s
Xx
X127 389 m
X0 0 5 0 16 0 s
Xx
X335 405 m
X0 0 1 0 4 0 s
X2 0 5 -1 8 -4 s
X2 -2 2 -5 0 -8 s
X-2 -2 -6 -4 -12 -4 s
Xx
X423 413 m
X415 413 l
X0 D
X424 410 m
X415 413 l
X424 417 l
X0 D
X415 413 m
Xx
X423 429 m
X415 429 l
X0 D
X424 426 m
X415 429 l
X424 433 l
X0 D
X415 429 m
Xx
X423 445 m
X415 445 l
X0 D
X424 442 m
X415 445 l
X424 449 l
X0 D
X415 445 m
Xx
X803 405 m
X795 401 l
Xx
X643 497 m
X639 489 l
Xx
X643 345 m
X635 337 l
Xx
X643 433 m
X635 425 l
Xx
X787 457 m
X799 465 l
Xx
X791 461 m
X795 461 l
Xx
X803 453 m
X811 461 l
Xx
X10 S
X747 521 m
X(\(FP/SP\)) ce 1 t
X12 S
X451 437 m
X(PC.ena) ce 1 t
X455 453 m
X(op2.ena) ce 1 t
X691 333 m
X695 333 l
X0 D
X687 337 m
X695 333 l
X687 330 l
X0 D
X695 333 m
Xx
X10 S
X683 345 m
X(bcc) ce 1 t
X815 453 m
X(5) ce 1 t
X783 453 m
X(5) ce 1 t
X687 465 m
X695 465 l
Xx
X679 517 m
X679 509 l
X0 D
X683 518 m
X679 509 l
X676 518 l
X0 D
X679 509 m
Xx
X707 421 m
X707 453 l
X707 453 l
Xx
X855 365 m
X847 365 l
X0 D
X856 362 m
X847 365 l
X856 369 l
X0 D
X847 365 m
Xx
X607 525 m
X631 525 l
Xx
X607 525 m
X0 0 0 -1 0 -4 s
X0 -2 1 -5 4 -8 s
X2 -2 5 -4 8 -4 s
X2 0 5 1 8 4 s
X2 2 4 6 4 12 s
Xx
X615 533 m
X615 525 l
X0 D
X619 534 m
X615 525 l
X612 534 l
X0 D
X615 525 m
Xx
X851 525 m
X843 525 l
X0 D
X852 522 m
X843 525 l
X852 529 l
X0 D
X843 525 m
Xx
X831 333 m
X823 317 l
Xx
X807 477 m
X807 429 l
X0 D
X811 438 m
X807 429 l
X804 438 l
X0 D
X807 429 m
Xx
X12 S
X807 493 m
X(ROM) ce 1 t
X735 365 m
X743 365 l
X0 D
X735 369 m
X743 365 l
X735 362 l
X0 D
X743 365 m
Xx
X755 365 m
X743 365 l
Xx
X10 S
X719 365 m
X(\(Bf1\)) ce 1 t
X871 381 m
X(Bf1.ena) ce 1 t
X719 381 m
X(QA\(7\)) ce 1 t
X755 381 m
X755 365 l
Xx
X763 365 m
X763 381 l
Xx
X847 365 m
X763 365 l
Xx
X751 381 m
X0 0 0 1 0 4 s
X0 2 1 6 4 10 s
X2 4 5 4 8 0 s
X2 -4 4 -8 4 -14 s
Xx
X751 381 m
X767 381 l
Xx
X759 421 m
X759 397 l
X759 397 l
Xx
X771 420 m
X782 421 l
Xx
X711 557 m
X711 461 l
X727 461 l
X727 405 l
X695 405 l
X695 349 l
X671 349 l
X671 333 l
X695 333 l
Xx
X747 437 m
X(B1.sel) ce 1 t
X687 469 m
X687 453 l
Xx
X775 421 m
X775 421 l
Xx
X12 S
X775 509 m
X(FP) ce 1 t
X759 501 m
X751 501 l
X727 501 l
X727 565 l
Xx
X615 541 m
X615 525 l
Xx
X10 S
X583 557 m
X(Call.ena) ce 1 t
X615 541 m
X591 541 l
Xx
X619 493 m
X623 493 l
Xx
X619 509 m
X619 493 l
Xx
X0 0 707 421 e
X0 0 708 421 e
X0 0 708 422 e
X0 0 708 422 e
X3 3 688 456 e
X839 541 m
X623 541 l
Xx
X12 S
X807 509 m
X(2X5bit) ce 1 t
X10 S
X727 485 m
X(5) ce 1 t
X707 457 m
X691 457 l
Xx
X707 457 m
X707 453 l
X707 453 l
Xx
X775 421 m
X687 421 l
X687 397 l
X655 397 l
X655 405 l
Xx
X847 541 m
X839 541 l
X0 D
X848 538 m
X839 541 l
X848 545 l
X0 D
X839 541 m
Xx
X847 525 m
X695 525 l
X695 461 l
Xx
X711 565 m
X711 557 l
X0 D
X715 566 m
X711 557 l
X708 566 l
X0 D
X711 557 m
Xx
X671 461 m
X655 461 l
X655 469 l
X0 D
X652 461 m
X655 469 l
X659 461 l
X0 D
X655 469 m
Xx
X687 469 m
X0 0 -1 0 -4 0 s
X-2 0 -5 -1 -8 -4 s
X-2 -2 -2 -5 0 -8 s
X2 -2 6 -4 12 -4 s
Xx
X751 485 m
X747 485 l
Xx
X2 2 744 484 e
X735 477 m
X743 485 l
Xx
X735 489 m
X743 485 l
Xx
X735 489 m
X735 477 l
Xx
X12 S
X596 157 m
X(rti.ena) ce 1 t
X195 589 m
X203 593 l
Xx
X315 589 m
X323 597 l
Xx
X655 397 m
X655 405 l
X0 D
X652 397 m
X655 405 l
X659 397 l
X0 D
X655 405 m
Xx
X783 413 m
X775 429 l
Xx
X623 541 m
X623 525 l
Xx
X871 533 m
X(opl.ena) ce 1 t
X871 549 m
X(CC.ena) ce 1 t
X10 S
X783 61 m
X(SEB=SignExtender+Bufferr output) ce 1 t
X12 S
X599 181 m
X(sop.ena) ce 1 t
X863 157 m
X(pull.ena) ce 1 t
X695 133 m
X647 181 l
Xx
X775 133 m
X823 181 l
Xx
X695 133 m
X775 133 l
Xx
X791 197 m
X791 181 l
X0 D
X795 190 m
X791 181 l
X788 190 l
X0 D
X791 181 m
Xx
X759 197 m
X759 181 l
X0 D
X763 190 m
X759 181 l
X756 190 l
X0 D
X759 181 m
Xx
X727 197 m
X727 181 l
X0 D
X731 190 m
X727 181 l
X724 190 l
X0 D
X727 181 m
Xx
X679 197 m
X679 181 l
X0 D
X683 190 m
X679 181 l
X676 190 l
X0 D
X679 181 m
Xx
X647 181 m
X823 181 l
Xx
X679 181 m
X(sop) ce 1 t
X727 181 m
X(rti) ce 1 t
X759 181 m
X(pull) ce 1 t
X791 181 m
X(push) ce 1 t
X679 213 m
X(QA\(7:6\)) ce 1 t
X727 213 m
X('+1') ce 1 t
X759 213 m
X('0') ce 1 t
X791 213 m
X('-2') ce 1 t
X623 173 m
X655 173 l
X0 D
X647 177 m
X655 173 l
X647 170 l
X0 D
X655 173 m
Xx
X623 149 m
X679 149 l
X0 D
X671 153 m
X679 149 l
X671 146 l
X0 D
X679 149 m
Xx
X839 173 m
X815 173 l
X0 D
X824 170 m
X815 173 l
X824 177 l
X0 D
X815 173 m
Xx
X839 149 m
X791 149 l
X0 D
X800 146 m
X791 149 l
X800 153 l
X0 D
X791 149 m
Xx
X719 581 m
X719 573 l
X0 D
X723 582 m
X719 573 l
X716 582 l
X0 D
X719 573 m
Xx
X719 581 m
X719 565 l
Xx
X719 573 m
X719 469 l
X791 469 l
X791 429 l
X0 D
X795 438 m
X791 429 l
X788 438 l
X0 D
X791 429 m
Xx
X727 573 m
X727 565 l
X0 D
X731 574 m
X727 565 l
X724 574 l
X0 D
X727 565 m
Xx
X735 485 m
X727 485 l
X727 501 l
Xx
X10 S
X671 517 m
X(4) ce 1 t
X663 533 m
X(QA\(11:8\)) ce 1 t
X759 485 m
X751 485 l
Xx
X751 581 m
X(QA\(12\)) ce 1 t
X12 S
X775 493 m
X(SP) ce 1 t
X759 509 831 477 b
X815 333 m
X(F) ce 1 t
X791 317 m
X823 317 l
Xx
X839 541 m
X839 325 l
X831 325 l
X0 D
X840 322 m
X831 325 l
X840 329 l
X0 D
X831 325 m
Xx
X10 S
X679 445 m
X('0') ce 1 t
X679 429 m
X663 429 l
X0 D
X672 426 m
X663 429 l
X672 433 l
X0 D
X663 429 m
Xx
X663 501 m
X679 501 l
X679 517 l
Xx
X639 285 m
X(0ffset1\(5\)) ce 1 t
X631 373 m
X(5) ce 1 t
X639 357 m
X(5) ce 1 t
X639 445 m
X(5) ce 1 t
X639 509 m
X(4) ce 1 t
X655 381 m
X655 365 l
X0 D
X659 374 m
X655 365 l
X652 374 l
X0 D
X655 365 m
Xx
X623 493 m
X623 293 l
X0 D
X627 302 m
X623 293 l
X620 302 l
X0 D
X623 293 m
Xx
X647 341 m
X623 341 l
X0 D
X632 338 m
X623 341 l
X632 345 l
X0 D
X623 341 m
Xx
X647 429 m
X623 429 l
X0 D
X632 426 m
X623 429 l
X632 433 l
X0 D
X623 429 m
Xx
X647 493 m
X623 493 l
X0 D
X632 490 m
X623 493 l
X632 497 l
X0 D
X623 493 m
Xx
X743 133 m
X(2) ce 1 t
X191 621 m
X(QA <17:0>) ce 1 t
X295 621 m
X(QB <17:0>) ce 1 t
X12 S
X463 421 m
X(JBASE.ena) ce 1 t
X263 229 m
X(\(Bf2\)) ce 1 t
X263 253 m
X(QA\(6\)) ce 1 t
X271 285 m
X(B2.sel) ce 1 t
X263 357 m
X(QA\(4\)) ce 1 t
X263 373 m
X(\(FP\)) ce 1 t
X263 389 m
X(QA\(5\)) ce 1 t
X39 381 m
X(QA\(3\)) ce 1 t
X39 365 m
X(QA\(4\)) ce 1 t
X39 349 m
X(QA\(5\)) ce 1 t
X175 573 m
X(10) ce 1 t
X199 605 m
X199 573 l
Xx
X231 573 m
X(13) ce 1 t
X279 573 m
X(7) ce 1 t
X327 573 m
X55 573 l
X55 437 l
Xx
X167 549 m
X(SEB) ce 0 t
X151 557 183 541 b
X175 533 m
X(30) ce 1 t
X167 541 m
X167 509 l
X0 D
X171 518 m
X167 509 l
X164 518 l
X0 D
X167 509 m
Xx
X151 429 m
X(30) ce 1 t
X143 437 m
X167 437 l
X0 D
X159 441 m
X167 437 l
X159 434 l
X0 D
X167 437 m
Xx
X135 549 m
X151 549 l
X0 D
X143 553 m
X151 549 l
X143 546 l
X0 D
X151 549 m
Xx
X135 421 m
X(B) ce 0 t
X135 437 m
X(E) ce 0 t
X127 461 143 413 b
X135 453 m
X(S) ce 0 t
X47 333 m
X(\(FP\)) ce 1 t
X319 573 m
X319 557 l
X0 D
X323 566 m
X319 557 l
X316 566 l
X0 D
X319 557 m
Xx
X327 573 m
X(12) ce 1 t
X415 517 m
X(offset<17:0>) ce 1 t
X335 597 m
X(18) ce 1 t
X319 605 m
X319 581 l
X367 581 l
X367 557 l
Xx
X359 573 m
X(18) ce 1 t
X215 597 m
X(18) ce 1 t
X151 325 m
X(30) ce 1 t
X183 285 m
X(offset2\(30\)) ce 1 t
X183 301 m
X(30) ce 1 t
X295 549 m
X303 549 l
X0 D
X295 553 m
X303 549 l
X295 546 l
X0 D
X303 549 m
Xx
X247 549 m
X255 549 l
X0 D
X247 553 m
X255 549 l
X247 546 l
X0 D
X255 549 m
Xx
X191 549 m
X199 549 l
X0 D
X191 553 m
X199 549 l
X191 546 l
X0 D
X199 549 m
Xx
X375 533 m
X(18) ce 1 t
X327 533 m
X(12) ce 1 t
X223 533 m
X(30) ce 1 t
X279 533 m
X(12) ce 1 t
X423 557 m
X(36bit.ena) ce 1 t
X399 549 m
X383 549 l
X0 D
X392 546 m
X383 549 l
X392 553 l
X0 D
X383 549 m
Xx
X143 333 m
X167 333 l
X0 D
X159 337 m
X167 333 l
X159 330 l
X0 D
X167 333 m
Xx
X367 509 m
X167 509 l
X167 285 l
X0 D
X171 294 m
X167 285 l
X164 294 l
X0 D
X167 285 m
Xx
X367 541 m
X367 509 l
X0 D
X371 518 m
X367 509 l
X364 518 l
X0 D
X367 509 m
Xx
X319 541 m
X319 509 l
X0 D
X323 518 m
X319 509 l
X316 518 l
X0 D
X319 509 m
Xx
X271 541 m
X271 509 l
X0 D
X275 518 m
X271 509 l
X268 518 l
X0 D
X271 509 m
Xx
X215 541 m
X215 509 l
X0 D
X219 518 m
X215 509 l
X212 518 l
X0 D
X215 509 m
Xx
X271 573 m
X271 557 l
X0 D
X275 566 m
X271 557 l
X268 566 l
X0 D
X271 557 m
Xx
X215 573 m
X215 557 l
X0 D
X219 566 m
X215 557 l
X212 566 l
X0 D
X215 557 m
Xx
X167 573 m
X167 557 l
X0 D
X171 566 m
X167 557 l
X164 566 l
X0 D
X167 557 m
Xx
X247 621 m
X247 605 l
Xx
X663 389 m
X(CC.ena) ce 1 t
X647 453 663 405 b
X647 517 663 469 b
X823 293 m
X(Breq1\(5\)) ce 1 t
X655 349 m
X(U) ce 1 t
X655 365 m
X(B) ce 1 t
X655 421 m
X(F) ce 1 t
X655 437 m
X(U) ce 1 t
X655 453 m
X(B) ce 1 t
X655 485 m
X(B) ce 1 t
X655 501 m
X(E) ce 1 t
X655 517 m
X(S) ce 1 t
X127 357 143 309 b
X135 317 m
X(F) ce 0 t
X135 333 m
X(U) ce 0 t
X135 349 m
X(B) ce 0 t
X295 517 m
X(off.30) ce 0 t
X247 517 m
X(off.25) ce 0 t
X191 517 m
X(off.13) ce 0 t
X303 549 m
X295 549 l
X295 525 l
Xx
X255 549 m
X247 549 l
X247 525 l
Xx
X199 549 m
X191 549 l
X191 549 l
X191 525 l
Xx
X351 557 383 541 b
X303 557 335 541 b
X255 557 287 541 b
X199 557 231 541 b
X199 557 199 549 b
X143 621 343 605 b
X319 549 m
X(SEB) ce 0 t
X367 549 m
X(BUF) ce 0 t
X271 549 m
X(SEB) ce 0 t
X215 549 m
X(SEB) ce 0 t
X823 93 m
X(before SP is updated\12) ce 1 t
X823 109 m
X(+1 will be added\12) ce 1 t
X743 109 m
X(sop\(2\)) ce 1 t
X647 365 663 317 b
X695 341 767 309 b
X727 325 m
X(8X8bits) ce 1 t
X727 341 m
X(BCC ROM) ce 1 t
X95 453 m
X(QA<3:0>) ce 1 t
X863 197 m
X(push.ena) ce 1 t
X823 429 m
X815 413 l
Xx
X815 413 m
X783 413 l
Xx
X775 429 m
X823 429 l
Xx
X791 429 m
X(1) ce 1 t
X807 429 m
X(0) ce 1 t
X799 413 m
X799 389 l
X815 389 l
X815 333 l
X0 D
X819 342 m
X815 333 l
X812 342 l
X0 D
X815 333 m
Xx
X783 333 m
X831 333 l
Xx
X799 333 m
X(T) ce 1 t
X783 333 m
X791 317 l
Xx
X751 309 m
X751 293 l
X775 293 l
X775 349 l
X799 349 l
X791 349 l
X799 349 l
X799 333 l
X0 D
X803 342 m
X799 333 l
X796 342 l
X0 D
X799 333 m
Xx
X807 317 m
X807 293 l
X0 D
X811 302 m
X807 293 l
X804 302 l
X0 D
X807 293 m
Xx
X10 S
X767 309 m
X(4) ce 1 t
X807 405 m
X(5) ce 1 t
X12 S
X655 333 m
X(F) ce 1 t
X10 S
X703 309 m
X(4) ce 1 t
X711 309 m
X711 293 l
X679 293 l
X679 325 l
X663 325 l
X0 D
X672 322 m
X663 325 l
X672 329 l
X0 D
X663 325 m
Xx
X687 581 m
X(QA\(12:10\)) ce 1 t
X735 597 m
X(QA\(12:8\)) ce 1 t
X735 133 m
X735 109 l
X0 D
X739 118 m
X735 109 l
X732 118 l
X0 D
X735 109 m
Xx
X303 349 m
X303 333 l
Xx
X303 349 m
X0 0 1 0 4 0 s
X2 0 5 -1 8 -4 s
X2 -2 2 -5 0 -8 s
X-2 -2 -6 -4 -12 -4 s
Xx
X335 381 m
X0 0 1 0 4 0 s
X2 0 5 -1 8 -4 s
X2 -2 2 -5 0 -8 s
X-2 -2 -6 -4 -12 -4 s
Xx
X75 273 m
X0 0 0 -1 0 -4 s
X0 -2 1 -5 4 -8 s
X2 -2 5 -4 8 -4 s
X2 0 5 1 8 4 s
X2 2 4 6 4 12 s
Xx
X75 273 m
X99 273 l
Xx
X335 381 m
X335 365 l
Xx
X335 405 m
X335 389 l
Xx
X495 293 m
X487 269 l
Xx
X415 293 m
X423 269 l
Xx
X423 269 m
X487 269 l
Xx
X415 293 m
X495 293 l
Xx
X303 309 m
X439 309 l
X439 293 l
X0 D
X443 302 m
X439 293 l
X436 302 l
X0 D
X439 293 m
Xx
X463 325 m
X463 293 l
X0 D
X467 302 m
X463 293 l
X460 302 l
X0 D
X463 293 m
Xx
X303 285 m
X415 285 l
X0 D
X407 289 m
X415 285 l
X407 282 l
X0 D
X415 285 m
Xx
X455 269 m
X455 237 l
X0 D
X459 246 m
X455 237 l
X452 246 l
X0 D
X455 237 m
Xx
X327 277 m
X327 285 l
Xx
X287 245 m
X323 245 l
X323 261 l
Xx
X331 261 m
X331 245 l
X351 245 l
Xx
X135 405 m
X135 413 l
Xx
X131 365 m
X163 365 l
Xx
X139 389 m
X139 377 l
X163 377 l
Xx
X131 357 m
X131 381 l
Xx
X55 437 m
X127 437 l
Xx
X3 3 132 385 e
X3 3 80 277 e
X3 3 96 276 e
X359 245 m
X351 245 l
X0 D
X360 242 m
X351 245 l
X360 249 l
X0 D
X351 245 m
Xx
X287 245 m
X295 245 l
X0 D
X287 249 m
X295 245 l
X287 242 l
X0 D
X295 245 m
Xx
X303 285 m
X311 285 l
X0 D
X303 289 m
X311 285 l
X303 282 l
X0 D
X311 285 m
Xx
X303 309 m
X311 309 l
X0 D
X303 313 m
X311 309 l
X303 306 l
X0 D
X311 309 m
Xx
X87 253 m
X87 237 l
X0 D
X91 246 m
X87 237 l
X84 246 l
X0 D
X87 237 m
Xx
X63 373 m
X71 373 l
X0 D
X63 377 m
X71 373 l
X63 370 l
X0 D
X71 373 m
Xx
X63 357 m
X71 357 l
X0 D
X63 361 m
X71 357 l
X63 354 l
X0 D
X71 357 m
Xx
X55 437 m
X55 389 l
X71 389 l
X71 317 l
X95 317 l
X95 349 l
X0 D
X92 341 m
X95 349 l
X99 341 l
X0 D
X95 349 m
Xx
X12 S
X119 349 m
X('0') ce 1 t
X95 397 m
X95 349 l
Xx
X111 357 m
X111 389 l
Xx
X95 397 m
X111 389 l
Xx
X71 373 m
X95 373 l
X0 D
X87 377 m
X95 373 l
X87 370 l
X0 D
X95 373 m
Xx
X95 349 m
X111 357 l
Xx
X59 341 m
X71 341 l
X0 D
X63 345 m
X71 341 l
X63 338 l
X0 D
X71 341 m
Xx
X119 333 m
X127 333 l
X0 D
X119 337 m
X127 333 l
X119 330 l
X0 D
X127 333 m
Xx
X79 429 m
X(4) ce 1 t
X71 357 m
X95 357 l
X0 D
X87 361 m
X95 357 l
X87 354 l
X0 D
X95 357 m
Xx
X79 357 m
X79 277 l
Xx
X87 317 m
X87 285 l
X95 285 l
X95 277 l
Xx
X10 S
X103 389 m
X(0) ce 1 t
X103 365 m
X(1) ce 1 t
X87 237 m
X(immediate\(1\)) ce 1 t
X12 S
X207 389 m
X(op2.ena) ce 1 t
X199 365 m
X(B2.sel) ce 1 t
X183 377 m
X175 377 l
X0 D
X184 374 m
X175 377 l
X184 381 l
X0 D
X175 377 m
Xx
X183 365 m
X171 365 l
X0 D
X180 362 m
X171 365 l
X180 369 l
X0 D
X171 365 m
Xx
X455 233 m
X(Breq2\(5\)) ce 1 t
X111 557 m
X(off.10) ce 1 t
X10 S
X435 285 m
X(1) ce 1 t
X467 285 m
X(0) ce 1 t
X463 261 m
X(5) ce 1 t
X471 313 m
X(5) ce 1 t
X12 S
X263 341 m
X(\(SP/i\)) ce 1 t
X10 S
X423 305 m
X(5) ce 1 t
X111 373 m
X119 373 l
X119 437 l
Xx
X12 S
X271 313 m
X(QA\(4:0\)) ce 1 t
X10 S
X115 421 m
X(5) ce 1 t
X107 321 m
X(FP) ce 1 t
X31 221 m
X39 213 l
X263 213 l
X263 205 l
X271 213 l
X519 213 l
X527 221 l
Xx
X575 277 m
X583 269 l
X727 269 l
X735 261 l
X743 269 l
X887 269 l
X895 277 l
Xx
X735 261 m
X(FIELD1) ce 1 t
X263 205 m
X(FIELD 2) ce 1 t
X591 317 m
X591 285 l
X0 D
X595 294 m
X591 285 l
X588 294 l
X0 D
X591 285 m
Xx
X511 253 m
X511 229 l
X0 D
X515 238 m
X511 229 l
X508 238 l
X0 D
X511 229 m
Xx
X591 333 m
X(ind1) ce 1 t
X511 269 m
X(ind2) ce 1 t
X%%Trailer
Xshowpage
X% Trailer for xpic to PostScript converter
X% $Header: x2ps.tra,v 1.1 87/11/21 20:33:03 moraes Exp $
Xxpic end restore
X%%DocumentFonts: Times-Roman Times-Italic Times-Bold Special
END_OF_FILE
if test 18365 -ne `wc -c <'xpic/test/van.ps'`; then
    echo shar: \"'xpic/test/van.ps'\" unpacked with wrong size!
fi
# end of 'xpic/test/van.ps'
fi
if test -f 'xpic/windows.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/windows.c'\"
else
echo shar: Extracting \"'xpic/windows.c'\" \(20058 characters\)
sed "s/^X//" >'xpic/windows.c' <<'END_OF_FILE'
X/* 
X *  CreateWindows() sets up all the windows in a widget hierarchy that
X *  consists of a form enclosing the picture window (Chris Peterson's
X *  Window widget), my Minibuf widget under it, and a column of Labels
X *  (StaticText) and ButtonBoxes (RCmanagers) to the right of it. If you
X *  want to try and figure out what this is, you had better have the Xt
X *  Intrinsics manual, and HP widgets handy. And plenty of aspirin...
X */
X/*  Mark Moraes, CSRI, University of Toronto, July 26, 1988 */
X#include <X11/StringDefs.h>
X#include <X11/Intrinsic.h>
X#include <Xw/Xw.h>
X#include <Xw/PButton.h>
X#include <Xw/RCManager.h>
X#include <Xw/Form.h>
X#include <Xw/SText.h>
X#include "Window.h"
X#include "Minibuf.h"
X
X#include "xpic.h"
X#include "windows.h"
X#include "input.h"
X#include "newfonts.h"
X#include "draw.h"
X
X#define MAXARGS 		32
X/* 
X *  Arbitrary choice of width based on trial and error - if someone
X *  finds a better way, let me know. This is the width of the 'menu' of
X *  buttons along the right
X */
X#define BUTTON_AREA_WIDTH	270
X
X#define MAXWIDGETS		256
X
X#define FORM_NAME		"form"
X#define PIC_NAME		"picture"
X#define MINIBUF_NAME	"minibuf"
X#define DUMMYBUF_NAME	"dummybuf"
X#define BUTTON_CURSOR	"top_left_arrow"
X#define PIC_CURSOR		"tcross"
X#define TEXT_CURSOR		"xterm"
X#define WAIT_CURSOR		"watch"
X
XArg args[MAXARGS];
Xstatic Cardinal argcount;
X#define setarg(name, value) (XtSetArg(args[argcount], name, value), argcount++)
X    
X/*
X *  In order to be efficient we should manage the whole hierarchy in 
X *  one go, the docs would have us believe. So we XtCreate() all 
X *  widgets, and store them in this array, using the addthingy() macro, 
X *  and before we realize the toplevel, we XtManage the whole 
X *  shebang.
X */
XWidget *thingies;
Xstatic Cardinal num_kids = 0;
XWidget LastParent;
X
X#define addthingy(w, parent) \
X{\
Xif (LastParent == parent) \
X	thingies[num_kids++] = w;\
Xelse \
X{\
X    XtManageChildren(thingies, num_kids);\
X    num_kids = 0;\
X    thingies[num_kids++] = w;\
X}\
XLastParent = parent; }
X
X/*
X *  Selecting a button releases the button that is presently selected in
X *  a radio button box. So we don't want a release action
X */
Xstatic String booleanButtonTransTbl = 
X	"<Btn1Down>: select()\n\
X	 <EnterWindow>:	enter()\n\
X	 <LeaveWindow>: leave()\n\
X	 <FocusIn>: focusIn() \n\
X	 <FocusOut>: focusOut() \n\
X	 <KeyDown>s: select() \n\
X	 <KeyDown>0xFF60: select() \n\
X	 <KeyUp>0xFF60: unselect() \n\
X	 <Key>0xFF52: traverseUp() \n\
X	 <Key>0xFF54: traverseDown() \n\
X	 <Key>0xFF51: traverseLeft() \n\
X	 <Key>0xFF53: traverseRight() \n\
X	 <Key>0xFF56: traverseNext() \n\
X	 <Key>0xFF55: traversePrev() \n\
X	 <Key>0xFF50: traverseHome()";
X
Xstatic String defaultButtonTransTbl = 
X	"<Btn1Down>: select() unselect()\n\
X	 <EnterWindow>:	enter()\n\
X	 <LeaveWindow>: leave()\n\
X	 <FocusIn>: focusIn() \n\
X	 <FocusOut>: focusOut() \n\
X	 <KeyDown>s: select() \n\
X	 <KeyDown>0xFF60: select() \n\
X	 <KeyUp>0xFF60: unselect() \n\
X	 <Key>0xFF52: traverseUp() \n\
X	 <Key>0xFF54: traverseDown() \n\
X	 <Key>0xFF51: traverseLeft() \n\
X	 <Key>0xFF53: traverseRight() \n\
X	 <Key>0xFF56: traverseNext() \n\
X	 <Key>0xFF55: traversePrev() \n\
X	 <Key>0xFF50: traverseHome()";
X
Xstatic String updownTransTbl =
X	"<Btn1Down>: increment() select() \n\
X	 <Btn3Down>: decrement() select() \n\
X	 <Btn1Up>: unselect() \n\
X	 <Btn3Up>: unselect() \n\
X	 <EnterWindow>: enter() \n\
X	 <LeaveWindow>: leave() \n\
X	 <FocusIn>: focusIn() \n\
X	 <FocusOut>: focusOut() \n\
X	 <KeyDown>s: select() \n\
X	 <KeyDown>0xFF60: select() \n\
X	 <KeyUp>0xFF60: unselect() \n\
X	 <Key>0xFF52: traverseUp() \n\
X	 <Key>0xFF54: traverseDown() \n\
X	 <Key>0xFF51: traverseLeft() \n\
X	 <Key>0xFF53: traverseRight() \n\
X	 <Key>0xFF56: traverseNext() \n\
X	 <Key>0xFF55: traversePrev() \n\
X	 <Key>0xFF50: traverseHome()";
X
Xextern void Increment(), Decrement();
XXtActionsRec actionTable[] = {
X	{"increment", 	Increment},
X	{"decrement", 	Decrement},
X};
X
Xstatic 	XtTranslations booleanButtonTranslations;
Xstatic 	XtTranslations defaultButtonTranslations;
Xstatic 	XtTranslations updownTranslations;
X
X/* 
X *  This array contains the names of the various menu items, and is
X *  structured in the form BoxTitle, BoxItemList, BoxTitle, BoxItemList,
X *  ......, 0 where each BoxItemList consists of BoxItemName,
X *  BoxItemName, ...., 0. The & indicates Command buttons and the +
X *  indicates the default value, which only makes sense for boolean
X *  buttons. The "*" is a special button - instead of making the
X *  procedure with it a handler, that procedure is called immediately,
X *  with the label as an argument - the procedure in question returns a
X *  ButtonInfo struct, and also initializes it's data appropriately.
X *  Typically, (well, always) I use this for an "up-down" button - this
X *  is a Command button where pressing the right key decrements, and the
X *  left key increments, and allows you to cycle through a list of
X *  choices. The initializing routine is meant to set this list of
X *  things to cycle through up - this can be read from a file.
X */
X
X/*
X *  The method of initializing defaults is not too elegant, because the +
X *  merely means that the button should be highlit - it does not set the
X *  appropriate variables, which are initialized somewhere at the end of
X *  CreateWindows, and should be changed if the defaults are changed.
X *  Now if this was in a proper object oriented language......
X */
Xextern void picEventHandle();
X
Xextern void copy(), cut(), move(), adjust(), 
X	rotate(), scale(), paste(),
X	change(), editattrib(), element(), 
X	linepattern(), linearrow(), linethickness(),
X	textfont(), textsize(),
X 	readcell(), savecell(), getcell(), putcell(),
X	lprintcell(),
X	redisplay(), quit(), change_buffer(),
X	kill_buffer(), textvalign(), texthalign(),
X	setgrid(), setsnap(), undo(), status();
X#ifdef DEBUG
Xextern void printcell();
X#endif
X
Xstatic ButtonInfo buttonnames[] = {
X	"Elements", NULL, 
X		"Box", element, "+Line", element, "Spline", element, 
X		"Circle", element, "Ellipse", element, "Text", element,
X		"Copy", copy, "Move", move, "Delete", cut, "Paste", paste,
X		"Adjust", adjust, "ChangeAttribute", change,
X#if 0
X		/* !! One day... */
X		"Scale", scale, "Rotate", rotate,
X#endif
X		"Get", getcell, "Put", putcell, 
X	"Edit Attributes", NULL, 
X		"Block", editattrib, "+Element", editattrib,
X	"Line Patterns", NULL, 
X		"+Solid", linepattern, "Dotted", linepattern, 
X		"Short-Dashed", linepattern, "Long-Dashed", linepattern,
X		"Dot-Dashed", linepattern,
X	"Line Thickness", NULL,
X		"+0", linethickness,
X		"1", linethickness, "2", linethickness, "3", linethickness,
X		"4", linethickness, "5", linethickness, "6", linethickness,
X		"7", linethickness, "8", linethickness, "9", linethickness,
X		"10", linethickness,		
X	"Line Arrows", NULL,
X		"+None", linearrow, "Start", linearrow, 
X		"End", linearrow,	"Both", linearrow,
X	"Text Font", NULL,
X		"*", textfont,
X	"Text Point Size", NULL, 
X		"*", textsize,
X	"Text Vertical", NULL,
X		"Top", textvalign, "+Middle", textvalign, "Bottom", textvalign,
X	"Text Horizontal", NULL,
X		"+Centred", texthalign, "Left Just.", texthalign, 
X		"Right Just.", texthalign,
X	"Snap", NULL,
X		"1", setsnap, "2", setsnap, 
X		"4", setsnap, "+8", setsnap, "16", setsnap , "24", setsnap, 
X		"32", setsnap, "40", setsnap,
X	"&Files", NULL, 
X		"Read", readcell, "Save", savecell, "Save As", savecell, 
X		"Print", lprintcell,
X	"&Miscellaneous", NULL,
X		"Undo", undo, "Redisplay", redisplay, 
X		"Grid", setgrid, "Status", status, "Exit", quit,
X#ifdef DEBUG
X		"PrintCell", printcell,
X#endif
X#if 0
X	"&Buffers", NULL, 
X		"Change Buffer", change_buffer,
X		"Kill Buffer", kill_buffer,
X#endif
X	NULL, NULL
X};
X
Xstatic Cursor framecursor, piccursor, waitcursor, textcursor;
X
X
Xvoid CreateWindows(toplevel)
XWidget toplevel;
X{
X	Widget buttonbox, button;
X	int i;
X	Dimension height, border;
X	int isCommand;
X	char *label;
X	int maxMenuWidth = BUTTON_AREA_WIDTH;
X	char boxname[64];
X	XrmValue fromVal, toVal;
X	static XtCallbackRec callbacks[] = {
X		{finished_input, NULL},
X		{NULL, NULL},
X	};
X	XGCValues gcv;
X	Pixel foreground, background;
X	XColor foreback[2];
X	char *grid_data;
X	char *makegrid();
X	int grid_width, grid_height, grid_size;
X	/* 
X	 *  The grids are stored as bitmaps - that's much faster than drawing
X	 *  them point by point The grids are generated by the procedures
X	 *  makegrid and invertgrid in grid.c from the value of the grid
X	 *  point spacing.
X	 */
X	Pixmap gray_tile;
X	void (*prehandler)();
X	ButtonInfo posthandler;
X	ButtonInfo updowninfo;
X	XtTranslations translations;
X	Widget typeout;
X	extern Widget CreateTypeout();
X	extern Pixmap XwCreateTile();
X
X	thingies = (Widget *) XtCalloc(MAXWIDGETS, sizeof(Widget));
X	
X	XtAddActions(actionTable, XtNumber(actionTable));
X	updownTranslations = XtParseTranslationTable(updownTransTbl);
X	booleanButtonTranslations = XtParseTranslationTable(booleanButtonTransTbl);
X	defaultButtonTranslations = XtParseTranslationTable(defaultButtonTransTbl);
X
X	outerFrame = XtCreateWidget(FORM_NAME, XwformWidgetClass,
X		toplevel, (ArgList) NULL, (Cardinal) 0);
X	addthingy(outerFrame, toplevel);
X	SetFocusRoot(outerFrame);
X	fromVal.addr = BUTTON_CURSOR;
X	fromVal.size = sizeof(BUTTON_CURSOR);
X	XtConvert(outerFrame, XtRString, &fromVal, 
X		XtRCursor, (XrmValuePtr) &toVal);
X	framecursor = *(Cursor *) toVal.addr;
X
X	picWinHeight = pageHeight * gridSpacing;
X	picWinWidth = pageWidth * gridSpacing;
X	minPicHeight = MINPAGEHEIGHT * gridSpacing;
X	minPicWidth = MINPAGEWIDTH * gridSpacing;
X
X	/*
X	 *  First create the picwin - the XtNyAttachOffset is a lie; we'll
X	 *  deal with it later when we get the correct height from the
X	 *  minibuf widget. One day, I'll understand how to do this right
X	 */
X	argcount = 0;
X	setarg(XtNwidth, (Dimension) picWinWidth);
X	setarg(XtNheight, (Dimension) picWinHeight);
X	setarg(XtNxRefName, FORM_NAME);
X	setarg(XtNyRefName, FORM_NAME);
X	setarg(XtNxResizable, True);
X	setarg(XtNyResizable, True);
X	setarg(XtNyAttachBottom, True);
X	setarg(XtNyAttachOffset, 0);
X	picWidget = XtCreateWidget(PIC_NAME, windowWidgetClass,
X		outerFrame, args, argcount);
X	addthingy(picWidget, outerFrame);
X	fromVal.addr = PIC_CURSOR;
X	fromVal.size = sizeof(PIC_CURSOR);
X	XtConvert(outerFrame, XtRString, &fromVal,
X		XtRCursor, (XrmValuePtr) &toVal);
X	piccursor = *(Cursor *) toVal.addr;
X	fromVal.addr = WAIT_CURSOR;
X	fromVal.size = sizeof(WAIT_CURSOR);
X	XtConvert(outerFrame, XtRString, &fromVal,
X		XtRCursor, (XrmValuePtr) &toVal);
X	waitcursor = *(Cursor *) toVal.addr;
X	fromVal.addr = TEXT_CURSOR;
X	fromVal.size = sizeof(TEXT_CURSOR);
X	XtConvert(outerFrame, XtRString, &fromVal,
X		XtRCursor, (XrmValuePtr) &toVal);
X	textcursor = *(Cursor *) toVal.addr;
X
X#ifdef TYPEOUT
X	typeout = CreateTypeout(picWidget, 80, 40, 0, 0, (char *) NULL);
X#endif
X
X	/* Set event handler for picwin */
X	/* One day, we'll use the translation manager here */
X	XtAddEventHandler(picWidget, 
X	 (EventMask) ExposureMask | ButtonPressMask | PointerMotionMask |
X	 StructureNotifyMask, NULL, picEventHandle, (caddr_t) NULL);
X	/* create the minibuf */
X	argcount = 0;
X	setarg(XtNwidth, (Dimension) picWinWidth);
X	setarg(XtNxRefName, FORM_NAME);
X	setarg(XtNyRefName, PIC_NAME);
X	setarg(XtNyAddHeight, True);
X	setarg(XtNxResizable, True);
X	setarg(XtNyAttachBottom, True);
X	setarg(XtNyAttachOffset, 0);
X	setarg(XtNfinishedCallback, callbacks);
X#ifdef TYPEOUT
X	setarg(XtNtypeout, typeout);
X	setarg(XtNtypeoutColumns, 80);
X#endif
X	inputWidget = XtCreateWidget(MINIBUF_NAME, minibufWidgetClass,
X		outerFrame, args, argcount);
X	addthingy(inputWidget, outerFrame);
X
X	/* get the height and border width of the minibuf */
X	argcount = 0;
X	setarg(XtNheight, &height);
X	setarg(XtNborderWidth, &border);
X	XtGetValues(inputWidget, args, argcount);
X
X	/* Shorten the picWidget to let the two coexist happily. */
X	argcount = 0;
X	setarg(XtNyAttachOffset, height + 2 * border);
X	XtSetValues(picWidget, args, argcount);
X	
X	/*
X	 *  Wanted to use RefWidget, but that causes Xt to dump core in a
X	 *  strcpy deep in an XtCreate - so we use Refname which works well,
X	 *  but is (I suspect) more time-consuming. Oh well - who cares...
X	 */
X	buttonbox = outerFrame;
X	(void) strcpy(boxname, FORM_NAME);
X	for (i = 0; buttonnames[i].name != NULL; i++) {
X		if (buttonnames[i].handler == NULL) {
X			/* If it starts with &, make it a command box */
X			if (*buttonnames[i].name == '&') {
X				label = &buttonnames[i].name[1];
X				isCommand = TRUE;
X			} else {
X				label = buttonnames[i].name;
X				isCommand = FALSE;
X			}
X
X			/* make label and attach to form */
X			argcount = 0;
X			setarg(XtNwidth, (Dimension) maxMenuWidth);
X			setarg(XtNstring, label);
X			setarg(XtNxRefName, PIC_NAME);
X			setarg(XtNyRefName, boxname);
X			setarg(XtNxAddWidth, True);
X			setarg(XtNyAddHeight, True);
X			setarg(XtNxAttachRight, True);
X			setarg(XtNalignment, XwALIGN_CENTER);
X			button = XtCreateWidget(label, 
X				XwstatictextWidgetClass, outerFrame, args, argcount);
X			addthingy(button, outerFrame);
X
X			/*
X			 *  make button box (RCmanager to HP Widgets) and attach to
X			 *  label
X			 */
X			argcount = 0;
X			/*
X			 *  If it is a command button box, then buttons go up and
X			 *  down normally. If radio button, then we only allow one
X			 *  button to be down. Fortunately, the RCManager does this
X			 *  for us - we just set up the translations for the button
X			 *  so that Btn1Up is NOT 'release' - that's done by the
X			 *  RCManager
X			 */
X			if (!isCommand)
X				setarg(XtNmode, XwONE_OF_MANY);
X			setarg(XtNwidth, (Dimension) maxMenuWidth);
X			/* As many buttons in a row as possible */
X			setarg(XtNlayoutType, XwMAXIMUM_UNALIGNED);
X			setarg(XtNxRefName, PIC_NAME);
X			setarg(XtNyRefName, label);
X			setarg(XtNxAddWidth, True);
X			setarg(XtNyAddHeight, True);
X			/*
X			 *  This maintains the box width, and since height is
X			 *  unspecified, computes the minimum height. For
X			 *  efficiency, it then gets left alone (we hope)
X			 */
X			setarg(XtNlayout, XwMAXIMIZE);
X			setarg(XtNxResizable, False);
X			(void) sprintf(boxname, "%s.box", label);
X			buttonbox = XtCreateWidget(boxname,
X			 XwrowColWidgetClass, outerFrame, args, argcount);
X			addthingy(buttonbox, outerFrame);
X		} else {
X			/* make button a child of the current RCManager */
X			argcount = 0;
X#if 0
X			setarg(XtNhighlightStyle, XwPATTERN_BORDER);
X			setarg(XtNhighlightTile, XwFOREGROUND);
X			setarg(XtNhighlightThickness, 0);
X#endif
X			prehandler = buttonnames[i].handler;
X			posthandler.name = NULL;
X			label = buttonnames[i].name;
X			if (isCommand)
X				translations = defaultButtonTranslations;
X			else
X				translations = booleanButtonTranslations;
X			/* If the button name starts with a '+', it is ON by default */
X			if (buttonnames[i].name[0] == '+') {
X				label++;
X				setarg(XtNset, True);
X			} else if (buttonnames[i].name[0] == '*') {
X				(* prehandler)(label, &updowninfo, &posthandler);
X				label = updowninfo.name;
X				prehandler = updowninfo.handler;
X				translations = updownTranslations;
X				isCommand = TRUE;	/* Just making sure! */
X			}
X			setarg(XtNlabel, label);
X			setarg(XtNtranslations, translations);
X			button = XtCreateWidget(label,
X			 XwpushButtonWidgetClass, buttonbox, args, argcount);
X			addthingy(button, buttonbox);
X			XtAddCallback(button, XtNselect, prehandler, label);
X			if (posthandler.name)
X				(* posthandler.handler)(button);
X		}
X	}
X	
X	/* This had better be fast */
X	if (num_kids)
X	    XtManageChildren(thingies, num_kids);
X	XtRealizeWidget(toplevel);
X	XtFree((char *) thingies);
X
X	picWin = XtWindow(picWidget);
X	inputWin = XtWindow(inputWidget);
X
X	argcount = 0;
X	setarg(XtNforeground, &foreground);
X	setarg(XtNbackground, &background);
X	XtGetValues(picWidget, args, argcount);
X
X	foreback[0].pixel = cursorColor;
X	foreback[1].pixel = background;
X	XQueryColors (picDpy, DefaultColormapOfScreen(XtScreen(outerFrame)),
X	 foreback, 2);
X	XRecolorCursor (picDpy, framecursor, foreback, foreback+1);
X	XRecolorCursor (picDpy, piccursor, foreback, foreback+1);
X	XDefineCursor(picDpy, XtWindow(outerFrame), framecursor);
X	XDefineCursor(picDpy, picWin, piccursor);
X
X	/*
X	 *  make the GC stuff here - one for copy, one for invert. Remember
X	 *  to change the both appropriately
X	 */
X	gcv.foreground = foreground;
X	gcv.background = background;
X	gcv.function = GXcopy;
X	gcv.line_width = 0;
X	gcv.line_style = LineSolid;
X	gcNormal = XCreateGC(picDpy, picWin, GCForeground | GCBackground 
X	 | GCLineWidth | GCLineStyle | GCFunction, &gcv);
X	tmpGcNormal = XCreateGC(picDpy, picWin, GCForeground | GCBackground 
X	 | GCLineWidth | GCLineStyle | GCFunction, &gcv);
X	gcv.foreground = background;
X	gcErase = XCreateGC(picDpy, picWin, GCForeground | GCBackground 
X	 | GCLineWidth | GCLineStyle | GCFunction, &gcv);
X	tmpGcErase = XCreateGC(picDpy, picWin, GCForeground | GCBackground 
X	 | GCLineWidth | GCLineStyle | GCFunction, &gcv);
X	gcv.foreground = foreground ^ background;
X	gcv.function = GXxor;
X	gcInvert = XCreateGC(picDpy, picWin, GCForeground | GCBackground
X	 | GCLineWidth | GCLineStyle | GCFunction, &gcv);
X	tmpGcInvert = XCreateGC(picDpy, picWin, GCForeground | GCBackground
X	 | GCLineWidth | GCLineStyle | GCFunction, &gcv);
X	
X	/* This one's for drag boxes and outlines, bounding boxes, etc. */
X	gcv.foreground = foreground ^ background;
X	gcv.background = background;
X	gcv.function = GXxor;
X	gcBlock = XCreateGC(picDpy, picWin, GCForeground | GCBackground
X	 | GCFunction, &gcv);
X
X	/* Now create the tile for tiling the pic win */
X	if ((grid_data = makegrid(gridSpacing, &grid_size, &grid_width, 
X	 &grid_height)) == NULL) {
X	 	error("CreateWindows: Can't make grid");
X		/*NOTREACHED*/
X	 }
X
X	if ((gridTile = XCreatePixmapFromBitmapData(XtDisplay(outerFrame),
X	  RootWindowOfScreen(XtScreen(outerFrame)), grid_data, 
X	  (unsigned) grid_width, (unsigned) grid_height, gridColor, background, 
X	  (unsigned) DefaultDepthOfScreen(XtScreen(outerFrame)))) == NULL) {
X		error("CreateWindows: Can't make grid tile");
X		/*NOTREACHED*/
X	}
X
X	blankTile = XwCreateTile(XtScreen(toplevel), foreground, background, 
X	 XwBACKGROUND);
X	 
X	if(gridOn) {
X		argcount = 0;
X		setarg(XtNbackgroundPixmap, gridTile);
X		XtSetValues(picWidget, args, argcount);
X	}
X	
X	gray_tile = XwCreateTile(XtScreen(toplevel), foreground, background, 
X	 Xw25_FOREGROUND);
X	gcv.foreground = foreground ^ background;
X	gcv.background = background;
X	gcv.function = GXxor;
X	gcv.fill_style = FillTiled;
X	gcv.tile = gray_tile;
X
X	gcGray = XCreateGC(picDpy, picWin, GCForeground | GCBackground
X	 | GCFunction | GCFillStyle | GCTile, &gcv);
X
X	picBox.ll.x = 0;
X	picBox.ll.y = 0;
X	picBox.ur.x = picWinWidth;
X	picBox.ur.y = picWinHeight;
X
X	mouseResolution = gridSpacing;
X
X	if ((verts = (XPoint *) calloc((unsigned) INC_VERTS, sizeof(XPoint)))
X	 == NULL) {
X		error("CreateWindows: Can't allocate vertex buffer");
X		/*NOTREACHED*/
X	}
X	nVerts = 0;
X	maxVerts = INC_VERTS;
X
X	/* Initialize the line styles - patterns from gnuplot */
X
X	MAKEPATTERN(LineTypes[SOLID], "");					/* Solid */
X	MAKEPATTERN(LineTypes[DOTTED], "\002\003");			/* Dotted */
X	MAKEPATTERN(LineTypes[SDASH], "\005\003");			/* Short dashed */
X	MAKEPATTERN(LineTypes[LDASH], "\010\004");			/* Long Dashed */
X	MAKEPATTERN(LineTypes[DDASH], "\005\003\002\003");	/* Dot dashed */
X
X	/* 
X	 *  If these are changed, remember to change the leading + on the
X	 *  menu item names in the buttonnnames struct. Not too nice to
X	 *  hardwire these like this, but the handlers rely on these being
X	 *  set up correctly.
X	 */
X	lineThickness = 0;
X	drawingMode = START_MODE;
X	editMode = ELEMENT;
X	objectType = LINE;
X	line_type = SOLID;
X	line_arrow = NO_ARROW;
X	textVertAlign = MIDLINE;
X	textHorizAlign = CENTRE;
X}
X
X
X/*
X *  Generates a dummy ExposeWindow event
X */
Xvoid RedrawPicWin()
X{
X	XEvent ev;
X	
X	XClearWindow(picDpy, picWin);
X	/* generate a dummy event to redraw the window */
X	ev.type = Expose;
X	ev.xexpose.window = picWin;
X	ev.xexpose.width = picWinWidth;
X	ev.xexpose.height = picWinHeight;
X	picEventHandle(picWidget, (caddr_t) NULL, &ev);
X}
X
Xvoid
XSetWaitCursor()
X{
X	XDefineCursor(picDpy, picWin, waitcursor);
X	XFlush(picDpy);
X}
X
Xvoid
XSetTextCursor()
X{
X	XDefineCursor(picDpy, picWin, textcursor);
X	XFlush(picDpy);
X}
X
Xvoid
XSetWorkingCursor()
X{
X	XDefineCursor(picDpy, picWin, piccursor);
X	XFlush(picDpy);
X}
END_OF_FILE
if test 20058 -ne `wc -c <'xpic/windows.c'`; then
    echo shar: \"'xpic/windows.c'\" unpacked with wrong size!
fi
# end of 'xpic/windows.c'
fi
echo shar: End of archive 13 \(of 15\).
cp /dev/null ark13isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 15 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0



More information about the Comp.sources.x mailing list