v08i015: xfig -- X Drawing Tool, Part06/21

Brian V. Smith envbvs at epb2.lbl.gov
Tue Jul 3 07:26:16 AEST 1990


Submitted-by: envbvs at epb2.lbl.gov (Brian V. Smith)
Posting-number: Volume 8, Issue 15
Archive-name: xfig2.8/part06

#! /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 6 (of 21)."
# Contents:  @figs/lists.fig @figs/logic.fig CHANGES deletept.c drag.c
#   popup.c save.c spline.c
# Wrapped by envbvs at epb2.lbl.gov on Thu Jun 28 08:51:32 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f '@figs/lists.fig' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'@figs/lists.fig'\"
else
echo shar: Extracting \"'@figs/lists.fig'\" \(5937 characters\)
sed "s/^X//" >'@figs/lists.fig' <<'END_OF_FILE'
X#FIG 1.4
X80 2
X5 1 0 1 0 0 0 0 0.000 0 1 0 542.157 431.581 521 394 549 389 565 395
X	0 0 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 1 1 0 500.178 424.016 475 394 461 424 470 449
X	3407872 131072 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 1 1 0 500.178 479.016 475 449 461 479 470 504
X	3407872 131072 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 0 1 0 300.698 429.006 280 394 308 389 323 395
X	0 0 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 1 1 0 256.808 423.377 233 394 219 424 229 449
X	3407872 131072 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 1 1 0 256.808 478.377 233 449 219 479 229 504
X	3407872 131072 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 1 1 0 256.808 533.377 233 504 219 534 229 559
X	3407872 131072 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 1 1 0 256.808 588.377 233 559 219 589 229 614
X	3407872 131072 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 1 1 0 379.177 534.016 354 504 340 534 349 559
X	3407872 131072 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 1 1 0 379.178 479.016 354 449 340 479 349 504
X	3407872 131072 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 1 1 0 379.178 424.016 354 394 340 424 349 449
X	3407872 131072 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 0 1 0 421.157 431.581 400 394 428 389 444 395
X	0 0 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 1 1 0 135.808 533.377 112 504 98 534 108 559
X	3407872 131072 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 1 1 0 135.808 478.377 112 449 98 479 108 504
X	3407872 131072 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 1 1 0 135.808 423.377 112 394 98 424 108 449
X	3407872 131072 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 1 1 0 87.878 355.286 47 369 61 389 82 398
X	0 0 1.000 4.000 8.000
X5 1 0 1 0 0 0 0 0.000 0 1 0 179.698 429.006 159 394 187 389 202 395
X	0 0 1.000 4.000 8.000
X2 2 0 1 0 0 0 0 0.000 0 0
X	 144 59 144 94 324 94 324 59 144 59 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 154 124 154 219 174 219 174 124 154 124 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 164 94 164 124 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 199 94 199 124 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 189 124 189 219 209 219 209 124 189 124 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 224 124 224 219 244 219 244 124 224 124 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 234 94 234 124 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 269 94 269 124 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 259 124 259 219 279 219 279 124 259 124 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 294 124 294 219 314 219 314 124 294 124 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 304 94 304 124 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 484 494 484 519 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 447 494 447 519 531 519 531 494 447 494 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 568 384 568 409 651 409 651 384 568 384 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 605 384 605 409 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 484 384 484 409 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 447 384 447 409 531 409 531 384 447 384 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 484 439 484 464 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 447 439 447 464 531 464 531 439 447 439 9999 9999
X2 2 1 1 0 0 0 0 4.000 0 0
X	 191 534 308 534 308 584 191 584 191 534 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 242 384 242 409 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 205 384 205 409 289 409 289 384 205 384 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 242 439 242 464 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 205 439 205 464 289 464 289 439 205 439 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 205 494 205 519 289 519 289 494 205 494 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 242 494 242 519 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 242 549 242 574 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 205 549 205 574 289 574 289 549 205 549 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 205 604 205 629 289 629 289 604 205 604 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 242 604 242 629 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 326 549 326 574 410 574 410 549 326 549 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 363 549 363 574 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 363 494 363 519 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 326 494 326 519 410 519 410 494 326 494 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 326 439 326 464 410 464 410 439 326 439 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 363 439 363 464 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 326 384 326 409 410 409 410 384 326 384 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 363 384 363 409 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 122 549 122 574 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 84 549 84 574 168 574 168 549 84 549 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 84 494 84 519 168 519 168 494 84 494 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 122 494 122 519 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 122 439 122 464 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 84 439 84 464 168 464 168 439 84 439 9999 9999
X2 2 0 1 0 0 0 0 0.000 0 0
X	 84 384 84 409 168 409 168 384 84 384 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 122 384 122 409 9999 9999
X4 0 0 12 0 0 0 0.000 1 9 102 334 169 Subordinate Lists
X4 0 0 12 0 0 0 0.000 1 9 6 299 239 5
X4 0 0 12 0 0 0 0.000 1 9 6 264 239 4
X4 0 0 12 0 0 0 0.000 1 9 6 229 239 3
X4 0 0 12 0 0 0 0.000 1 9 6 194 239 2
X4 0 0 12 0 0 0 0.000 1 9 6 159 239 1
X4 0 0 12 0 0 0 0.000 1 9 72 189 84 MASTER  LIST
X4 0 0 12 0 0 0 0.000 1 9 18 452 514 NIL
X4 0 0 12 0 0 0 0.000 1 9 24 489 509 DATA
X4 0 0 12 0 0 0 0.000 1 9 24 610 399 DATA
X4 0 0 12 0 0 0 0.000 1 9 18 572 404 NIL
X4 0 0 12 0 0 0 0.000 1 9 24 489 454 DATA
X4 0 0 12 0 0 0 0.000 1 7 6 312 584 *
X4 0 0 12 0 0 0 0.000 1 9 18 210 624 NIL
X4 0 0 12 0 0 0 0.000 1 9 24 247 454 DATA
X4 0 0 12 0 0 0 0.000 1 9 24 247 509 DATA
X4 0 0 12 0 0 0 0.000 1 9 24 247 564 DATA
X4 0 0 12 0 0 0 0.000 1 9 24 247 619 DATA
X4 0 0 12 0 0 0 0.000 1 9 24 368 564 DATA
X4 0 0 12 0 0 0 0.000 1 9 24 368 509 DATA
X4 0 0 12 0 0 0 0.000 1 9 24 368 454 DATA
X4 0 0 12 0 0 0 0.000 1 9 24 126 564 DATA
X4 0 0 12 0 0 0 0.000 1 9 24 126 509 DATA
X4 0 0 12 0 0 0 0.000 1 9 24 126 454 DATA
X4 0 0 12 0 0 0 0.000 1 9 18 126 399 PTR
X4 0 0 12 0 0 0 0.000 1 9 18 89 399 PTR
X4 0 0 12 0 0 0 0.000 1 9 18 89 569 NIL
X4 0 0 12 0 0 0 0.000 1 9 72 43 359 MASTER  LIST
X4 0 0 12 0 0 0 0.000 1 9 18 331 569 NIL
END_OF_FILE
echo shar: 29 control characters may be missing from \"'@figs/lists.fig'\"
if test 5937 -ne `wc -c <'@figs/lists.fig'`; then
    echo shar: \"'@figs/lists.fig'\" unpacked with wrong size!
fi
# end of '@figs/lists.fig'
fi
if test -f '@figs/logic.fig' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'@figs/logic.fig'\"
else
echo shar: Extracting \"'@figs/logic.fig'\" \(6796 characters\)
sed "s/^X//" >'@figs/logic.fig' <<'END_OF_FILE'
X#FIG 1.4X
X80 2
X1 4 0 1 0 0 0 21 0.000 1 0.000 224 79 3 3 222 79 227 79
X1 3 0 1 0 0 0 0 0.000 1 0.000 219 24 10 10 219 24 229 24
X1 3 0 1 0 0 0 0 0.000 1 0.000 534 104 5 5 534 104 539 104
X1 3 0 1 0 0 0 0 0.000 1 0.000 434 44 10 10 434 44 444 44
X1 4 0 1 0 0 0 21 0.000 1 0.000 479 79 3 3 477 79 482 79
X1 4 0 1 0 0 0 21 0.000 1 0.000 689 79 3 3 687 79 692 79
X1 3 0 1 0 0 0 0 0.000 1 0.000 364 249 10 10 364 249 374 249
X1 4 0 1 0 0 0 21 0.000 1 0.000 419 224 3 3 417 224 422 224
X1 4 0 1 0 0 0 21 0.000 1 0.000 419 349 3 3 417 349 422 349
X1 4 0 1 0 0 0 21 0.000 1 0.000 449 349 3 3 447 349 452 349
X1 3 0 1 0 0 0 0 0.000 1 0.000 64 278 10 10 64 278 74 278
X1 4 0 1 0 0 0 21 0.000 1 0.000 119 279 3 3 117 279 122 279
X1 4 0 1 0 0 0 21 0.000 1 0.000 259 279 3 3 257 279 262 279
X1 3 0 1 0 0 0 0 0.000 1 0.000 224 264 10 10 224 264 234 264
X1 4 0 1 0 0 0 21 0.000 1 0.000 599 394 3 3 597 394 602 394
X1 4 0 1 0 0 0 21 0.000 1 0.000 629 394 3 3 627 394 632 394
X1 4 0 1 0 0 0 21 0.000 1 0.000 599 224 3 3 597 224 602 224
X1 3 0 1 0 0 0 0 0.000 1 0.000 564 203 10 10 564 203 574 203
X1 3 0 1 0 0 0 0 0.000 1 0.000 144 539 4 4 144 539 148 539
X1 3 0 1 0 0 0 0 0.000 1 0.000 159 534 5 5 159 534 164 534
X1 3 0 1 0 0 0 0 0.000 1 0.000 174 539 4 4 174 539 178 539
X2 1 0 1 0 0 0 0 0.000 0 0
X	 124 59 154 59 184 49 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 124 99 154 99 184 89 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 184 59 224 59 224 99 184 99 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 224 79 254 79 284 69 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 284 79 319 79 9999 9999
X2 3 0 1 0 0 0 0 0.000 0 0
X	 504 89 504 119 529 104 504 89 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 504 104 479 104 479 54 584 54 614 44 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 539 104 584 104 614 94 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 614 54 689 54 689 104 614 104 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 689 79 729 79 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 479 79 449 79 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 597 82 606 82 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 449 349 449 304 459 274 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 389 349 389 304 399 274 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 389 274 389 224 449 224 449 274 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 427 193 412 203 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 419 199 419 224 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 409 429 429 429 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 414 434 424 434 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 416 439 421 439 9999 9999
X2 1 0 1 0 0 0 0 0.000 1 0
X	0 0 1.000 4.000 8.000
X	 389 349 494 349 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 419 349 419 369 414 374 424 379 414 384 424 389 414 394 424 399 414 404 424 409 419 414 419 429 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 119 429 119 384 129 354 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 119 354 119 324 129 294 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 116 439 121 439 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 114 434 124 434 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 109 429 129 429 9999 9999
X2 1 0 1 0 0 0 0 0.000 1 0
X	0 0 1.000 4.000 8.000
X	 119 279 159 279 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 127 193 112 203 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 119 199 119 214 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 119 214 119 224 114 229 124 234 114 239 124 244 114 249 124 254 114 259 124 264 119 269 119 294 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 249 449 269 449 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 254 454 264 454 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 256 459 261 459 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 259 294 234 319 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 226 312 219 334 199 354 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 226 396 219 374 199 354 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 259 414 234 389 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 259 414 284 389 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 292 396 299 374 319 354 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 292 312 299 334 319 354 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 259 294 284 319 9999 9999
X2 1 0 1 0 0 0 0 0.000 1 0
X	0 0 1.000 4.000 8.000
X	 259 279 299 279 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 267 193 252 203 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 259 199 259 214 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 259 214 259 224 254 229 264 234 254 239 264 244 254 249 264 254 254 259 264 264 259 269 259 294 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 199 354 244 354 274 344 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 274 354 319 354 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 259 414 259 449 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 589 474 609 474 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 594 479 604 479 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 596 484 601 484 9999 9999
X2 1 0 1 0 0 0 0 0.000 1 0
X	0 0 1.000 4.000 8.000
X	 569 394 674 394 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 599 394 599 414 594 419 604 424 594 429 604 434 594 439 604 444 594 449 604 454 599 459 599 474 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 629 334 629 304 619 274 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 629 394 629 364 619 334 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 569 394 569 364 559 334 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 569 334 569 304 559 274 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 569 274 569 224 629 224 629 274 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 599 199 599 224 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 607 194 592 204 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 99 539 144 539 174 529 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 174 539 211 539 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 264 539 309 539 339 529 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 339 539 376 539 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 159 534 159 554 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 154 559 159 554 164 559 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 234 544 249 544 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 234 534 249 534 9999 9999
X2 1 0 1 0 0 0 0 0.000 0 0
X	 234 539 249 539 9999 9999
X4 0 0 12 0 0 0 0.000 1 9 6 109 64 A
X4 0 0 12 0 0 0 0.000 1 9 6 164 44 C
X4 0 0 12 0 0 0 0.000 1 9 6 169 84 D
X4 0 0 12 0 0 0 0.000 1 9 6 109 104 B
X4 0 0 12 0 0 0 0.000 1 9 6 269 64 E
X4 0 0 12 0 0 0 0.000 1 6 6 216 27 c
X4 0 0 12 0 0 0 0.000 1 9 6 434 84 A
X4 0 0 12 0 0 0 0.000 1 9 6 432 48 f
X4 0 0 12 0 0 0 0.000 1 9 6 594 34 B
X4 0 0 12 0 0 0 0.000 1 9 6 599 94 B
X4 0 0 12 0 0 0 0.000 1 9 6 362 253 b
X4 0 0 12 0 0 0 0.000 1 9 6 464 294 B
X4 0 0 12 0 0 0 0.000 1 9 6 369 294 A
X4 0 0 12 0 0 0 0.000 1 6 6 61 281 a
X4 0 0 12 0 0 0 0.000 1 9 6 99 369 B
X4 0 0 12 0 0 0 0.000 1 9 6 99 314 A
X4 0 0 12 0 0 0 0.000 1 6 6 221 267 e
X4 0 0 12 0 0 0 0.000 1 9 6 204 324 A
X4 0 0 12 0 0 0 0.000 1 9 6 304 324 B
X4 0 0 12 0 0 0 0.000 1 9 6 254 339 E
X4 0 0 12 0 0 0 0.000 1 9 6 209 394 C
X4 0 0 12 0 0 0 0.000 1 9 6 304 394 D
X4 0 0 12 0 0 0 0.000 1 9 6 560 207 d
X4 0 0 12 0 0 0 0.000 1 9 6 544 294 A
X4 0 0 12 0 0 0 0.000 1 9 6 604 294 C
X4 0 0 12 0 0 0 0.000 1 9 6 544 359 B
X4 0 0 12 0 0 0 0.000 1 9 6 604 359 D
X4 0 0 12 0 0 0 0.000 1 9 30 99 519 note:
X4 0 0 12 0 0 0 0.000 1 9 6 154 569 A
X4 0 0 12 0 0 0 0.000 1 9 6 314 529 A
END_OF_FILE
echo shar: 30 control characters may be missing from \"'@figs/logic.fig'\"
if test 6796 -ne `wc -c <'@figs/logic.fig'`; then
    echo shar: \"'@figs/logic.fig'\" unpacked with wrong size!
fi
# end of '@figs/logic.fig'
fi
if test -f 'CHANGES' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'CHANGES'\"
else
echo shar: Extracting \"'CHANGES'\" \(7029 characters\)
sed "s/^X//" >'CHANGES' <<'END_OF_FILE'
XVersion 2.0 
X
XPatchlevel 8
XChanges from patchlevel 7:
X
Xo Many bugs fixed with flipping arcs, malloc/free, popup menu 
X    going off screen, gcc warnings, etc.
X    From Isamu Wada <i-wada at srans3.sra.co.jp>
Xo Bug fixed in redisplay.c where all but the most recently created
X    compounds' objects were invisible
Xo Changed code that assumed a (char *) return value for sprintf
X    to follow POSIX and ANSI C standard of returning int.
Xo Removed conditional compilation flags for R3, since R3 is no
X    longer supported :-(
Xo Moved initializing of Fig icon in main() to work with mwm
X    From David Elliot <dce at smsc.sony.com>
Xo f2p and f2ps now return meaningfull error codes: 0 for OK, 1 for error
Xo Errors in reading figure file should report correct line numbers now
Xo Handles "default" font for TransFig correctly
Xo Text input is now correctly terminated whenever a menu item is chosen,
X    not just on CR or middle-button pressed
Xo troff_ft_codes files allows ANY white space between troff font name
X    and Postscript fone name
Xo Attempting to move the center point of circle/ellipse with move-point 
X    no longer makes point markers disappear
Xo BoundingBox computed correctly for centered and right-justified text now
X    for f2ps and save-as-bitmap
X    From Tom Tkacik
Xo Font names output by f2p and f2ps fixed for -TFX option.
X    From Guy Cardwell
Xo Object icon displayed in change-object popup menu
Xo Removed rounded-corner boxes from TFX compile-time option and reverted
X    protocol version to 1.4-TFX, as per Micah Beck (beck at cs.cornell.edu) 
X
XPatchlevel 7 (4/26/90)
XChanges from patchlevel 6:
X
Xo New patch files for psfonts.c, panel.h to fix problems with those
X    files in patch level 6
Xo The patch for search.c in patch 6 was an old patch and should
X    not be applied
Xo Bug fix for f2ps where figure went off the page in landscape mode
X
XPatchlevel 6 (4/25/90)
XChanges from patchlevel 5:
X
Xo *** New popup menu to change characteristics of existing objects, 
X   e.g. line thickness, style, text options, area fill etc.
X   Not ALL things may be modified yet (e.g. arrows on lines).
X   Jon Tombs and Frank Schmuck provided this much-needed feature
Xo Because the popup menu uses the new Simple Menu widget from R4, xfig
X   will no longer compile under R3
Xo Fixed WMHints to "or" in InputHint to retain any existing Hints
X  Thanks to David Elliott
Xo Doesn't let one delete to fewer than 3 points in interpolated spline
Xo Removed unused variables
Xo Changed rounded-corner box objects to have radius component instead 
X   of using the pen component (new protocol version 2.0 and 2.0-TFX)
Xo Added back support to read protocol version 1.3 files
Xo Fixed bug where the line style wasn't passed in drawing bounding 
X   rectangle when moving/copying objects
Xo Fixed cursor for popup command menu
Xo Fixed bounding box bug for postscript output from f2ps
Xo Fixed bug that erroneously allowed filled polylines (only polygons, boxes,
X   round-corner boxes, ellipses, circles, closed splines and arcs may be filled)
Xo Fixed name of AvantGarde-Book font (was AvantGarde)
Xo Added two X fonts that are similar to AvantGarde... and Palatino...
X   From Dave Davey 
Xo Fixed bug that caused coredump when referencing a zero-radius ellipse
Xo Added back the LaTex buttons even for non-TFX mode
Xo More SYSV #ifdefs from Scott E. Garfinkle (dacseg at uts.amdahl.com)
Xo New rule in Imakefile to install troff_ft_codes file
Xo put_fmsg() uses double arguments instead of float to prevent some 
X    systems from choking on float-double-float conversions of invalid data.
Xo 8-bit characters allowed for text objects
X    From Tor Lillqvist <tml at hemuli.tik.vtt.fi>
X
XPatchlevel 5 (3/27/90)
XChanges from patchlevel 4:
X
Xo Line widths of zero now allowed for drawing borderless objects
Xo Resources now parsed in more portable way
Xo Variable "compound" changed to "cmpnd" in drag.c and search.c because 
X    SunOs 4.1 has function called compound()
Xo Unknown "-" options no longer parsed as file name
Xo Filled areas now drawn opaquely instead of transparently
Xo Ruler arrows now drawn correctly
Xo Area fill for rounded corner boxes displays properly
Xo Lower panel buttons and rulers slightly smaller to allow 9.5 inch tall
X  canvas in portrait mode on screens that are "only" 864 pixels tall
Xo Imakefile now uses XawClientDepLibs instead of $(DEPXAWLIB) $(DEPXMUlIB) ...
Xo -1 for area fill (no fill) in TransFig files handled properly
Xo u_int defined as uint for SYSV systems
Xo 'figure_modified' flag cleared when editing new file
Xo If "save in" is done and there is no current file name, then the
X  current file name is set to the one specified in the save
Xo -track default is now True as man entry states
Xo side panel resource renamed to side_panel
Xo fixed bug in f2ps where filled arcs weren't filled
Xo line width and font support for f2p (pic)
X  Thanks to Dave Davey for these additions
X
XPatchlevel 4 (3/12/90)
XChanges from patchlevel 3:
X
Xo Bug fixed in drawing zero-length lines with arrows
X    Thanks to Dave Davey for this fix
Xo Portrait/Landscape bug fixed (only appeared on Sun 4)
Xo Fig will not allow edit of new figure without confirmation if
X    current figure has been modified
Xo Widget resources work better now (e.g. xfig.form.indicator.background: green)
Xo -ri option for button panel on right side works properly now
Xo Changed some widget names for better resource hierarchy
Xo Wrapped indicator widgets in box widget
Xo Adds compatibility with Fig 1.4-TFX file format INSTEAD of 1.4X
X  as a compile time option (compiler flag -DTFX).  No change to program
X  as compiled without the -DTFX flag.  See file README.TFX.
X    Credit goes to Micah Beck (beck at cs.cornell.edu) for this one.
Xo Fixed bug where scanf was doing %lf for text angle instead of %f
X  in read_textobject()
X    Thanks to Leroy Hugues (Hugues.Leroy at irisa.fr) for this fix
Xo #include <X11/Scroll.h> put back in fig.h for R3 - XtRFloat is defined here
Xo XtPointer is only defined in R4 - uses caddr_t for R3 blink() routine
Xo Print figure on default printer, specify particular printer or print to file
X    Thanks to Daren Latham (dwl at udev.cdc.com) for this one
Xo Original FORMAT1.4 file included to compare new 1.4X format with 1.4
X  New file that describes xfig file format is called FORMAT1.4X
Xo Drawing too-narrow ellipses doesn't loop forever anymore, but they
X  are still not drawn correctly
X
XPatchlevel 3 (2/28/90)
XChanges from patchlevel 2:
X
Xo now uses XtAddTimer instead of setitimer() for blinking cursor
X  This fixes the problem with text freezing up xfig or crashing with core dump
Xo Changed include directives for Athena widgets to include/X11/Xaw directory
Xo added put_fmsg() to print messages with floating point numbers
X  Some machines (MIPS) were dumping core when passing floats as ints.
X
XPatchlevel 2 (2/23/90)
XChanges from patchlevel 1:
X
Xo removed call to free() in curve() which was causing coredumps
Xo Imakefile had .o filenames in SRCS definition
X
X
XPatchlevel 1 (2/20/90)
XChanges from patchlevel 0:
X
Xo included definition of put_msg()/FREE/CFREE in f2ps.c
END_OF_FILE
if test 7029 -ne `wc -c <'CHANGES'`; then
    echo shar: \"'CHANGES'\" unpacked with wrong size!
fi
# end of 'CHANGES'
fi
if test -f 'deletept.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'deletept.c'\"
else
echo shar: Extracting \"'deletept.c'\" \(5903 characters\)
sed "s/^X//" >'deletept.c' <<'END_OF_FILE'
X/* 
X *	FIG : Facility for Interactive Generation of figures
X *
X *	Copyright (c) 1985 by Supoj Sutanthavibul (supoj at sally.UTEXAS.EDU)
X *	January 1985.
X *	1st revision : Aug 1985.
X *
X *	%W%	%G%
X*/
X#include "fig.h"
X#include "resources.h"
X#include "func.h"
X#include "object.h"
X#include "paintop.h"
X
X#define			TOLERANCE	3
X
Xextern			(*canvas_kbd_proc)();
Xextern			(*canvas_locmove_proc)();
Xextern			(*canvas_leftbut_proc)();
Xextern			(*canvas_middlebut_proc)();
Xextern			(*canvas_rightbut_proc)();
Xextern			null_proc();
Xextern			set_popupmenu();
X
Xextern F_line		*line_point_search();
Xextern F_spline		*spline_point_search();
Xextern int		last_object;
Xextern int		fix_x, fix_y, cur_x, cur_y;
Xextern int		pointmarker_shown;
X
Xextern F_point		*left_point, *right_point;
Xextern F_point		*deleted_point;
Xextern F_line		*line;
Xextern F_spline		*spline;
X
Xextern int		init_delete_point();
X
Xdelete_point_selected()
X{
X	canvas_kbd_proc = null_proc;
X	canvas_locmove_proc = null_proc;
X	canvas_leftbut_proc = init_delete_point;
X	canvas_middlebut_proc = null_proc;
X	canvas_rightbut_proc = set_popupmenu;
X	set_cursor(&pick9_cursor);
X	reset_action_on();
X	}
X
Xinit_delete_point(x, y)
Xint	 x, y;
X{
X	F_spline	*spline;
X	F_line		*line;
X	F_point		*p, *q;
X	int		n;
X
X	/*
X	If the attemp to delete point fails, we wouldn't want any important
X	variables (left_point, right_point and delted_point) to change. 
X	So we used p and q in the search.
X	*/
X
X	if ((line = line_point_search(x, y, TOLERANCE, &p, &q)) != NULL) {
X	    if (line->type == T_BOX || line->type == T_ARC_BOX) {
X		put_msg("Deleting box corners is not allowed");
X		return;
X		}
X	    n = num_points(line->points);
X	    if (line->type == T_POLYGON) {
X		if (n <= 4) {
X		    put_msg("A polygon cannot have less than 3 points");
X		    return;
X		    }
X		}
X	    else if (n <= 1) {
X		put_msg("A line cannot have less than 2 points");
X		return;
X		}
X	    clean_up();
X	    left_point = p;
X	    deleted_point = q;
X	    right_point = q->next;
X	    linepoint_deleting(line);
X	    set_action_object(F_DELETE_POINT, O_POLYLINE);
X	    set_latestline(line);
X	    }
X	else if ((spline=spline_point_search(x, y, TOLERANCE, &p, &q)) != NULL){
X	    n = num_points(spline->points);
X	    if (closed_spline(spline)) {
X		if (n <= 4) {
X		    put_msg("A closed spline cannot have less than 3 points");
X		    return;
X		    }
X		}
X	    else if (normal_spline(spline)) {
X		if (n <= 2) {
X		    put_msg("A spline cannot have less than 2 points");
X		    return;
X		    }
X		}
X	    else if (n <= 3) { /* it must be an interpolated spline */
X		put_msg("An interpolated spline cannot have less than 3 points");
X		return;
X		}
X	    clean_up();
X	    left_point = p;
X	    deleted_point = q;
X	    right_point = q->next;
X	    splinepoint_deleting(spline);
X	    set_action_object(F_DELETE_POINT, O_SPLINE);
X	    set_latestspline(spline);
X	    }
X	}
X
X/**************************  spline  *******************************/
X
Xsplinepoint_deleting(spline)
XF_spline	*spline;
X{
X	F_point		*p;
X
X	set_temp_cursor(&wait_cursor);
X	if (closed_spline(spline)) {
X	    if (pointmarker_shown) toggle_splinepointmarker(spline);
X	    draw_spline(spline, ERASE); /*erase the spline */
X	    if (left_point == NULL) { 
X		/* The deleted point is the first point */
X		spline->points = right_point;
X		for (left_point = right_point, p = left_point->next;
X			p->next != NULL;
X			left_point = p, p = p->next);
X		/*
X		left_point now points at next to last point
X		(the last point is a copy of the first).
X		*/
X		p->x = spline->points->x;
X		p->y = spline->points->y;
X		right_point = p;
X		/*
X		Right_point becomes the last point.  If this operation
X		(point deletion) is reversed (undo), the deleted_point
X		will not be inserted into it original place, but will
X		be between left_point and right_point.
X		*/
X		}
X	    else
X		left_point->next = right_point;
X	    }
X	else { /* open spline */
X	    if (pointmarker_shown) toggle_splinepointmarker(spline);
X	    draw_spline(spline, ERASE); /*erase the spline */
X	    if (left_point == NULL) 
X		spline->points = right_point;
X	    else 
X		left_point->next = right_point;
X	    }
X	if (int_spline(spline)) {
X	    F_control	*c;
X
X	    c = spline->controls;
X	    spline->controls = c->next;
X	    c->next = NULL;
X	    free((char*)c);
X	    remake_control_points(spline);
X	    }
X	draw_spline(spline, PAINT);
X	if (pointmarker_shown) toggle_splinepointmarker(spline);
X	set_modifiedflag();
X	reset_cursor();
X	}
X
X/***************************  line  ********************************/
X
X/*
XIn deleting a point p, linepoint_deleting uses left_point and
Xright_point of point p.  The relationship of the three points
Xare : left_point->p->right_point except when p is the first
Xpoint in the list, in which case left_point will be NULL.
X*/
Xlinepoint_deleting(line)
XF_line	*line;
X{
X	F_point	*p;
X
X	if (line->type == T_POLYGON) {
X	    if (pointmarker_shown) toggle_linepointmarker(line);
X	    draw_line(line, ERASE); /*erase the line */
X	    if (left_point == NULL) {
X		/* The deleted point is the first point */
X		line->points = right_point;
X		for (left_point = right_point, p = left_point->next; 
X			p->next != NULL; 
X			left_point = p, p = p->next);
X		/*
X		left_point now points at next to last point
X		(the last point is a copy of the first).
X		*/
X		p->x = right_point->x;
X		p->y = right_point->y;
X		right_point = p;
X		/*
X		Right_point becomes the last point.  If this operation
X		(point deletion) is reversed (undo), the deleted_point
X		will not be inserted into it original place, but will
X		be between left_point and right_point.
X		*/
X		}
X	    else
X		left_point->next = right_point;
X	    }
X	else { /* polyline */
X	    if (pointmarker_shown) toggle_linepointmarker(line);
X	    draw_line(line, ERASE); /*erase the line */
X	    if (left_point == NULL) 
X		line->points = right_point;
X	    else 
X		left_point->next = right_point;
X	    }
X	draw_line(line, PAINT);
X	if (pointmarker_shown) toggle_linepointmarker(line);
X	set_modifiedflag();
X	}
END_OF_FILE
if test 5903 -ne `wc -c <'deletept.c'`; then
    echo shar: \"'deletept.c'\" unpacked with wrong size!
fi
# end of 'deletept.c'
fi
if test -f 'drag.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'drag.c'\"
else
echo shar: Extracting \"'drag.c'\" \(7037 characters\)
sed "s/^X//" >'drag.c' <<'END_OF_FILE'
X/* 
X *	FIG : Facility for Interactive Generation of figures
X *
X *	Copyright (c) 1985 by Supoj Sutanthavibul (supoj at sally.UTEXAS.EDU)
X *	January 1985.
X *	1st revision : Aug 1985.
X *
X *	%W%	%G%
X*/
X#include "fig.h"
X#include "resources.h"
X#include "font.h"
X#include "object.h"
X#include "paintop.h"
X
Xextern F_pos		last_position, new_position;  /* undo.c   */
Xextern int		foreground_color, background_color;
Xextern int		fix_x, fix_y, cur_x, cur_y;
X
Xextern			(*canvas_kbd_proc)();
Xextern			(*canvas_locmove_proc)();
Xextern			(*canvas_leftbut_proc)();
Xextern			(*canvas_middlebut_proc)();
Xextern			(*canvas_rightbut_proc)();
Xextern			null_proc();
Xextern			set_popupmenu();
X
Xstatic			draw_movingbox();
Xstatic int		x1off, y1off, x2off, y2off;
X
Xextern int		(*return_proc)();
Xextern int		 move_line(), place_line();
Xextern int		 move_arc(), place_arc();
Xextern int		 move_spline(), place_spline();
Xextern int		 move_movingbox();
Xextern int		 place_ellipse();
Xextern int		 move_text(), place_text();
Xextern int		 place_compound();
X
Xstatic F_arc		*arc;
Xstatic F_compound	*cmpnd;
Xstatic F_ellipse	*ellipse;
Xstatic F_line		*line;
Xstatic F_spline		*spline;
Xstatic F_text		*text;
X
Xstatic
Xdraw_movingbox(op)
Xint	op;
X{
X	register int	x1, y1, x2, y2;
X
X	x1 = cur_x + x1off;
X	x2 = cur_x + x2off;
X	y1 = cur_y + y1off;
X	y2 = cur_y + y2off;
X	draw_rectbox(x1, y1, x2, y2, op);
X	}
X
Xmove_movingbox(x, y)
Xint	x, y;
X{
X	draw_movingbox(INV_PAINT);
X	cur_x = x;
X	cur_y = y;
X	draw_movingbox(INV_PAINT);
X	}
X
X/***************************** ellipse section ************************/
X
Xinit_ellipsedragging(e, x, y)
XF_ellipse	*e;
Xint		x, y;
X{
X	ellipse = e;
X	last_position.x = cur_x = x; 
X	last_position.y = cur_y = y;
X	x1off = (e->center.x - e->radiuses.x) - cur_x; 
X	x2off = (e->center.x + e->radiuses.x) - cur_x; 
X	y1off = (e->center.y - e->radiuses.y) - cur_y;
X	y2off = (e->center.y + e->radiuses.y) - cur_y;
X	canvas_locmove_proc = move_movingbox;
X	canvas_middlebut_proc = place_ellipse;
X	set_action_on();
X	draw_movingbox(INV_PAINT);
X	}
X
Xplace_ellipse(x, y)
Xint	x, y;
X{
X	draw_movingbox(INV_PAINT);
X	new_position.x = x;
X	new_position.y = y;
X	translate_ellipse(ellipse, x - last_position.x, y - last_position.y);
X	draw_ellipse(ellipse, foreground_color);
X	show_pointmarker();
X	set_modifiedflag();
X	(*return_proc)();
X	}
X
X/*****************************  arc  section  *******************/
X
Xinit_arcdragging(a, x, y)
XF_arc	*a;
Xint	x, y;
X{
X	arc = a;
X	fix_x = last_position.x = cur_x = x;
X	fix_y = last_position.y = cur_y = y;
X	canvas_locmove_proc = move_arc;
X	canvas_middlebut_proc = place_arc;
X	set_action_on();
X	draw_movingarc(arc, INV_PAINT);
X	}
X
Xmove_arc(x, y)
Xint	x, y;
X{
X	draw_movingarc(arc, INV_PAINT);
X	cur_x = x;  
X	cur_y = y;
X	draw_movingarc(arc, INV_PAINT);
X	}
X
Xplace_arc(x, y)
Xint	x, y;
X{
X	draw_movingarc(arc, INV_PAINT);
X	new_position.x = x;
X	new_position.y = y;
X	translate_arc(arc, x - fix_x, y - fix_y);
X	draw_arc(arc, foreground_color);
X	show_pointmarker();
X	set_modifiedflag();
X	(*return_proc)();
X	}
X
Xdraw_movingarc(a, op)
XF_arc	*a;
Xint	op;
X{
X	int	dx, dy;
X
X	dx = cur_x - fix_x;
X	dy = cur_y - fix_y;
X	pw_vector(canvas_win, a->point[0].x+dx, a->point[0].y+dy,
X		a->point[1].x+dx, a->point[1].y+dy, op, 1, SOLID_LINE, 0.0);
X	pw_vector(canvas_win, a->point[1].x+dx, a->point[1].y+dy,
X		a->point[2].x+dx, a->point[2].y+dy, op, 1, SOLID_LINE, 0.0);
X	}
X
X/*************************  line  section  **********************/
X
Xinit_linedragging(l, x, y)
XF_line	*l;
Xint	x, y;
X{
X	line = l;
X	last_position.x = cur_x = fix_x = x;
X	last_position.y = cur_y = fix_y = y;
X	canvas_locmove_proc = move_line;
X	canvas_middlebut_proc = place_line;
X	set_action_on();
X	draw_movingpoint(line->points, INV_PAINT);
X	}
X
Xmove_line(x, y)
Xint	x, y;
X{
X	draw_movingpoint(line->points, INV_PAINT);
X	cur_x = x;  
X	cur_y = y;
X	draw_movingpoint(line->points, INV_PAINT);
X	}
X
Xplace_line(x, y)
Xint	x, y;
X{
X	draw_movingpoint(line->points, INV_PAINT);
X	new_position.x = x;
X	new_position.y = y;
X	translate_line(line, x - fix_x, y - fix_y);
X	draw_line(line, PAINT);
X	show_pointmarker();
X	set_modifiedflag();
X	(*return_proc)();
X	}
X
Xdraw_movingpoint(ps, op)
XF_point	*ps;
Xint	op;
X{
X	F_point	*p;
X	int	dx, dy, x, y, xx, yy;
X
X	dx = cur_x - fix_x;
X	dy = cur_y - fix_y;
X	p = ps;
X	x = p->x + dx;
X	y = p->y + dy;
X	for (p = p->next; p != NULL; x = xx, y = yy, p = p->next) {
X	    xx = p->x + dx;  yy = p->y +dy;
X	    pw_vector(canvas_win, x, y, xx, yy, op, 1, SOLID_LINE, 0.0);
X	    }
X}
X
X/************************  text section  **************************/
X
Xstatic	PR_SIZE	txsize;
X
Xinit_textdragging(t, x, y)
XF_text	*t;
Xint	x, y;
X{
X
X	text = t;
X	fix_x = cur_x = x; 
X	fix_y = cur_y = y;
X	y1off = t->base_y - y;
X	if (t->type == T_CENTER_JUSTIFIED || t->type == T_RIGHT_JUSTIFIED)
X		{
X		txsize = pf_textwidth(t->font, t->size, strlen(t->cstring), t->cstring);
X		if (t->type == T_CENTER_JUSTIFIED)
X			x1off =  - txsize.x/2;
X		else
X			x1off =  - txsize.x;
X		fix_x = t->base_x;
X		}
X	else /* LEFT */
X		{
X		x1off = 0;
X		fix_x = t->base_x;
X		}
X	canvas_locmove_proc = move_text;
X	canvas_middlebut_proc = place_text;
X	draw_movingtext();
X	set_action_on();
X	}
X
Xmove_text(x, y)
Xint	x, y;
X{
X	draw_movingtext();
X	cur_x = x;
X	cur_y = y;
X	draw_movingtext();
X	}
X
Xplace_text(x, y)
Xint	x, y;
X{
X	draw_movingtext();
X	new_position.x = x;
X	new_position.y = y;
X	last_position.x = fix_x; 
X	last_position.y = fix_y;
X	translate_text(text, x - fix_x, y - fix_y);
X	draw_text(text, PAINT);
X	set_modifiedflag();
X	(*return_proc)();
X	}
X
Xdraw_movingtext()
X{
X	pw_text(canvas_win, cur_x + x1off, cur_y + y1off, INV_PAINT,
X		text->font, text->size, text->cstring);
X	}
X
X/*************************  spline  section  **********************/
X
Xinit_splinedragging(s, x, y)
XF_spline	*s;
Xint		x, y;
X{
X	spline = s;
X	last_position.x = cur_x = fix_x = x;
X	last_position.y = cur_y = fix_y = y;
X	canvas_locmove_proc = move_spline;
X	canvas_middlebut_proc = place_spline;
X	set_action_on();
X	draw_movingpoint(spline->points, INV_PAINT);
X	}
X
Xmove_spline(x, y)
Xint	x, y;
X{
X	draw_movingpoint(spline->points, INV_PAINT);
X	cur_x = x;  
X	cur_y = y;
X	draw_movingpoint(spline->points, INV_PAINT);
X	}
X
Xplace_spline(x, y)
Xint	x, y;
X{
X	draw_movingpoint(spline->points, INV_PAINT);
X	translate_spline(spline, x - fix_x, y - fix_y);
X	new_position.x = x;
X	new_position.y = y;
X	draw_spline(spline, PAINT);
X	show_pointmarker();
X	set_modifiedflag();
X	(*return_proc)();
X	}
X
X/*****************************  Compound section  *******************/
X
Xinit_compounddragging(c, x, y)
XF_compound	*c;
Xint		x, y;
X{
X	cmpnd = c;
X	last_position.x = cur_x = x; 
X	last_position.y = cur_y = y;
X	x1off = c->nwcorner.x - x;
X	x2off = c->secorner.x - x;
X	y1off = c->nwcorner.y - y;
X	y2off = c->secorner.y - y;
X	canvas_locmove_proc = move_movingbox;
X	canvas_middlebut_proc = place_compound;
X	set_action_on();
X	draw_movingbox(INV_PAINT);
X	}
X
Xplace_compound(x, y)
Xint	x, y;
X{
X	draw_movingbox(INV_PAINT);
X	new_position.x = x;
X	new_position.y = y;
X	translate_compound(cmpnd, x - last_position.x, y - last_position.y);
X	draw_compound(cmpnd);
X	draw_compoundbox(cmpnd, INV_PAINT);
X	set_modifiedflag();
X	(*return_proc)();
X	}
END_OF_FILE
if test 7037 -ne `wc -c <'drag.c'`; then
    echo shar: \"'drag.c'\" unpacked with wrong size!
fi
# end of 'drag.c'
fi
if test -f 'popup.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'popup.c'\"
else
echo shar: Extracting \"'popup.c'\" \(6363 characters\)
sed "s/^X//" >'popup.c' <<'END_OF_FILE'
X/* 
X *	FIG : Facility for Interactive Generation of figures
X *
X *	Copyright (c) 1985 by Supoj Sutanthavibul (supoj at sally.UTEXAS.EDU)
X *	January 1985.
X *	1st revision : Aug 1985.
X *
X *	%W%	%G%
X*/
X#include "fig.h"
X#include "resources.h"
X#include "func.h"
X#include "font.h"
X
X/*******************  imported global variables and procedures  **************/
X
Xextern int		figure_modified;
Xextern char		current_file[];
X
Xextern			put_msg();
Xextern			init_msg_receiving();
Xextern			read_file();
Xextern			edit_file();
Xextern			change_directory();
Xextern			save_current_file();
Xextern			save_file();
Xextern			save_and_exit();
Xextern			write_bitmap();
Xextern			Reset_cursor();
X
X/********************  local variables  ***************************/
X
Xstatic MENUITEM pumenu_items[] = {
X	{MENU_IMAGESTRING, "Quit",		(caddr_t) F_QUIT},
X	{MENU_IMAGESTRING, "Undo",		(caddr_t) F_UNDO},
X	{MENU_IMAGESTRING, "Redisplay",		(caddr_t) F_REDISPLAY},
X	{MENU_IMAGESTRING, "Remove all",	(caddr_t) F_REMOVE_ALL},
X	{MENU_IMAGESTRING, "Edit file ...",	(caddr_t) F_EDIT},
X	{MENU_IMAGESTRING, "Save",		(caddr_t) F_SAVE},
X	{MENU_IMAGESTRING, "Read file ...",	(caddr_t) F_READ},
X	{MENU_IMAGESTRING, "Save in ...",	(caddr_t) F_SAVE_IN},
X	{MENU_IMAGESTRING, "Print Figure",	(caddr_t) F_PRINT},
X	{MENU_IMAGESTRING, "Status",		(caddr_t) F_STATUS},
X	{MENU_IMAGESTRING, "Change Directory",	(caddr_t) F_CHDIR},
X	{MENU_IMAGESTRING, "Print Working Directory",	(caddr_t) F_PWDIR},
X	{MENU_IMAGESTRING, "Save & Quit",	(caddr_t) F_SAVE_N_EXIT},
X	{MENU_IMAGESTRING, "Save as BITMAP ..",	(caddr_t) F_SAVE_BITMAP},
X	};
X
Xstatic char quit_msg[] = "CONFIRM with LEFT button, CANCEL with RIGHT or MIDDLE button";
Xstatic char edit_msg[] = "Figures are modified; please CONFIRM with LEFT button or CANCEL with RIGHT button";
X
X/* currently, no arguments are needed for the menu widget */
X
Xstatic Arg	menu_args[] =
X{
X        { XtNwidth, (XtArgVal)0 },
X};
X
Xextern void pane_select();
X
Xstatic XtCallbackRec	pane_callbacks[] =
X{
X	{ pane_select, NULL },
X	{ NULL, NULL },
X};
X
Xstatic Arg      pane_args[] =
X{
X        { XtNlabel, (XtArgVal)"        " },
X        { XtNwidth, (XtArgVal)0 },
X        { XtNcallback, (XtArgVal)pane_callbacks },
X};
X
XXtActionsRec popup_actions[] =
X{
X	{ "Reset_cursor", (XtActionProc)Reset_cursor },
X};
X
XReset_cursor(tool, event, params, nparams)
X	TOOL	tool;
X	XEvent	*event;
X	String	*params;
X	Cardinal *nparams;
X{
X	reset_cursor();
X}
X
XTOOL		menu;
X
Xint 
Xinit_menu(tool)
X	TOOL			tool;
X{
X	TOOL			panes, pane, title;
X	register int		i, tlen, rlen = 0;
X	register MENUITEM	*mi;
X	XtTranslations		popdown_actions, pane_actions;
X	Arg			my_list;
X	PIX_FONT		temp_font;
X
X	menu = XtCreatePopupShell("popup_menu", overrideShellWidgetClass, tool,
X		menu_args, XtNumber(menu_args));
X	popdown_actions = XtParseTranslationTable(
X		"<Btn3Up>:MenuPopdown()Reset_cursor()\n");
X		/*<LeaveWindow>:MenuPopdown()Reset_cursor()\n");*/
X	XtOverrideTranslations(menu, popdown_actions);
X	panes = XtCreateManagedWidget("menu", boxWidgetClass, menu, menu_args,
X		XtNumber(menu_args));
X	pane_actions = XtParseTranslationTable(
X		"<EnterWindow>:set()\n\
X		<Btn3Up>:notify()unset()\n");
X	XtAddActions(popup_actions, XtNumber(popup_actions));
X	for (i = 0; i < XtNumber(pumenu_items); i++)
X	{
X		mi = &pumenu_items[i];
X		tlen = strlen(mi->label);
X		if( tlen > rlen )
X			rlen = tlen;
X	}
X	
X	pane_args[0].value = (XtArgVal)"COMMANDS";
X	title = XtCreateManagedWidget("title", labelWidgetClass,
X				   panes, pane_args, XtNumber(pane_args));
X
X	/* create the first pane */
X	mi = &pumenu_items[0];
X	pane_args[0].value = (XtArgVal)mi->label;
X	pane_callbacks[0].closure = (caddr_t)mi;
X	pane = XtCreateManagedWidget("pane", commandWidgetClass,
X				     panes, pane_args, XtNumber(pane_args));
X	XtOverrideTranslations(pane, pane_actions);
X
X	/* get the default font */
X	my_list.value = (XtArgVal)&temp_font;
X	my_list.name = XtNfont;
X	XtGetValues(pane, &my_list, 1);
X
X	/* set the width of this pane and the title to the correct width */
X	pane_args[1].value = char_width(temp_font) * rlen + 10;
X	XtSetValues(title, &pane_args[1], 1);
X	XtSetValues(pane, &pane_args[1], 1);
X	
X	for (i = 1; i < XtNumber(pumenu_items); ++i)
X	{
X		mi = &pumenu_items[i];
X		pane_args[0].value = (XtArgVal)mi->label;
X		pane_callbacks[0].closure = (caddr_t)mi;
X		pane = XtCreateManagedWidget("pane", commandWidgetClass,
X			panes, pane_args, XtNumber(pane_args));
X		XtOverrideTranslations(pane, pane_actions);
X	}
X	return (1);
X}
X
Xset_popupmenu(event)
X	INPUTEVENT	*event;
X{
X}
X
Xvoid 
Xpane_select(widget, mi)
X	TOOL			widget;
X	MENUITEM		*mi;
X{
X	int			menu_code = (int)mi->info;
X
X	char_handler(CR);
X
X	switch(menu_code) {
X	    case F_UNDO : 
X		undo();
X		break;
X	    case F_READ :
X		init_msg_receiving(read_file, "Read file : ");
X		break;
X	    case F_SAVE :
X		(void)save_current_file();
X		break;
X	    case F_SAVE_IN : 
X		if (no_object()) {
X		    put_msg("No figure to save; ignored");
X		    break;
X		    }
X		init_msg_receiving(save_file, "Save in file : ");
X		break;
X	    case F_REDISPLAY :
X		redisplay_canvas();
X		break;
X	    case F_EDIT :
X		edit();
X		break;
X	    case F_PRINT:
X		print_figure();
X		break;
X	    case F_REMOVE_ALL :
X		remove_all();
X		put_msg("Immediate Undo will restore the figure.");
X		redisplay_canvas();
X		break;
X	    case F_CHDIR :
X		init_msg_receiving(change_directory, "Directory : ");
X		break;
X	    case F_PWDIR:
X		print_directory();
X		break;
X	    case F_STATUS :
X		status();
X		break;
X	    case F_SAVE_N_EXIT :
X		save_n_exit();
X		break;
X	    case F_QUIT : 
X		quit();
X		break;
X	    case F_SAVE_BITMAP : 
X		if (no_object()) {
X		    put_msg("No figure to save");
X		    break;
X		    }
X		init_msg_receiving(write_bitmap, "Save bitmap to file : ");
X		break;
X	    }
X	Reset_cursor();
X	XtPopdown(menu);
X	}
X
Xquit()
X{
X	if (no_object()) {
X	    tool_destroy(tool);
X	    exit(0);
X	    }
X	if (! figure_modified) {
X	    tool_destroy(tool);
X	    exit(0);
X	    }
X	if (wmgr_confirm(canvas_win, quit_msg) == -1) {
X	    tool_destroy(tool);
X	    exit(0);
X	    }
X	}
X
Xsave_n_exit()
X	{
X	if (! figure_modified) 
X		quit();
X	if (no_object()) 
X		quit();
X	if (*current_file != 0) {
X	    if (0 == write_file(current_file, 0)) 
X		quit();
X	    }
X	else {
X	    blink_msg();
X	    init_msg_receiving(save_and_exit, "Save in file : ");
X	    }
X	}
X
Xedit()
X	{
X	if (!no_object() && figure_modified)
X	    if (wmgr_confirm(canvas_win, edit_msg) != -1) 
X		return;
X	init_msg_receiving(edit_file, "Edit file : ");
X	}
END_OF_FILE
if test 6363 -ne `wc -c <'popup.c'`; then
    echo shar: \"'popup.c'\" unpacked with wrong size!
fi
# end of 'popup.c'
fi
if test -f 'save.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'save.c'\"
else
echo shar: Extracting \"'save.c'\" \(6908 characters\)
sed "s/^X//" >'save.c' <<'END_OF_FILE'
X/* 
X *	FIG : Facility for Interactive Generation of figures
X *
X *	Copyright (c) 1985, 1988 by Supoj Sutanthavibul (supoj at sally.UTEXAS.EDU)
X *	January 1985.
X *	1st revision : August 1985.
X *	2nd revision : March 1988.
X *
X *	%W%	%G%
X*/
X#include "fig.h"
X#include "resources.h"
X#include "func.h"
X#include "object.h"
X#include "const.h"
X
Xextern F_compound	objects;
X
Xextern int		figure_modified;
Xextern int		errno;
X
Xextern 			null_proc();
X
Xextern char		*sys_errlist[];
Xextern int		sys_nerr, errno;
Xextern int		num_object;
X
Xwrite_file(file_name, prompt)
Xchar	*file_name;
Xint	prompt;
X{
X	FILE		*fp;
X	struct stat	file_status;
X	char		string[180];
X
X	if (*file_name == 0) {
X	    put_msg("No file.  Abort save operation.");
X	    return(-1);
X	    }
X	if (stat(file_name, &file_status) == 0) { /* file exists */
X	    if (file_status.st_mode & S_IFDIR) {
X		put_msg("\"%s\" is a directory", file_name);
X		return(-1);
X		}
X	    if (file_status.st_mode & S_IWRITE) { /* writing is permitted */
X		if (file_status.st_uid != geteuid()) {
X		    put_msg("\"%s\" permission is denied", file_name);
X		    return(-1);
X		    }
X		else if (prompt) {
X		    sprintf(string, "\"%s\" File exists. Please click the LEFT button to COMFIRM overwrite. To cancel, click the MIDDLE or RIGHT button.", file_name);
X		    if (wmgr_confirm(canvas_win, string) != -1) {
X			put_msg("Cancel save");
X			return(-1);
X			}
X		    }
X		}
X	    else {
X		put_msg("\"%s\" File is read only", file_name);
X		return(-1);
X		}
X	    }
X	else if (errno != ENOENT)
X	    return(-1);  /* file does exist but stat fails */
X
X	if ((fp = fopen(file_name, "w")) == NULL) {
X	    blink_msg();
X	    put_msg("Couldn't open file %s, %s", file_name, sys_errlist[errno]);
X	    return(-1);
X	    }
X	else {
X	    figure_modified = 0;
X	    num_object = 0;
X	    write_objects(fp);
X	    put_msg("%d objects saved in \"%s\"", num_object, file_name);
X	    return(0);
X	    }
X	}
X
Xwrite_objects(fp)
XFILE	*fp;
X{
X	extern char	file_header[];
X	F_arc		*a;
X	F_compound	*c;
X	F_ellipse	*e;
X	F_line		*l;
X	F_spline	*s;
X	F_text		*t;
X
X	/*  Number 2 means that the origin (0,0) is at the upper
X	left corner of the screen (2nd quadrant)	*/
X
X	put_msg("Writing . . .");
X	fprintf(fp, "%s\n", file_header);
X	fprintf(fp, "%d %d\n", PIX_PER_INCH, 2);
X	for (a = objects.arcs; a != NULL; a = a-> next) {
X	    num_object++;
X	    write_arc(fp, a);
X	    }
X	for (c = objects.compounds; c != NULL; c = c-> next) {
X	    num_object++;
X	    write_compound(fp, c);
X	    }
X	for (e = objects.ellipses; e != NULL; e = e-> next) {
X	    num_object++;
X	    write_ellipse(fp, e);
X	    }
X	for (l = objects.lines; l != NULL; l = l-> next) {
X	    num_object++;
X	    write_line(fp, l);
X	    }
X	for (s = objects.splines; s != NULL; s = s-> next) {
X	    num_object++;
X	    write_spline(fp, s);
X	    }
X	for (t = objects.texts; t != NULL; t = t-> next) {
X	    num_object++;
X	    write_text(fp, t);
X	    }
X	fclose(fp);
X	}
X
Xwrite_arc(fp, a)
XFILE	*fp;
XF_arc	*a;
X{
X	F_arrow	*f, *b;
X
X	fprintf(fp, "%d %d %d %d %d %d %d %d %.3f %d %d %d %.3f %.3f %d %d %d %d %d %d\n",
X		O_ARC, a->type, a->style, a->thickness, 
X		a->color, a->depth, a->pen, a->area_fill,
X		a->style_val, a->direction,
X		((f = a->for_arrow) ? 1 : 0), ((b = a->back_arrow) ? 1 : 0),
X		a->center.x, a->center.y, 
X		a->point[0].x, a->point[0].y, 
X		a->point[1].x, a->point[1].y, 
X		a->point[2].x, a->point[2].y);
X	if (f)
X	    fprintf(fp, "\t%d %d %.3f %.3f %.3f\n", f->type, f->style,
X			f->thickness, f->wid, f->ht);
X	if (b)
X	    fprintf(fp, "\t%d %d %.3f %.3f %.3f\n", b->type, b->style,
X			b->thickness, b->wid, b->ht);
X	}
X
Xwrite_compound(fp, com)
XFILE		*fp;
XF_compound	*com;
X{
X	F_arc		*a;
X	F_compound	*c;
X	F_ellipse	*e;
X	F_line		*l;
X	F_spline	*s;
X	F_text		*t;
X
X	fprintf(fp, "%d %d %d %d %d\n", O_COMPOUND, com->nwcorner.x,
X		com->nwcorner.y, com->secorner.x, com->secorner.y);
X	for (a = com->arcs; a != NULL; a = a-> next) write_arc(fp, a);
X	for (c = com->compounds; c != NULL; c = c-> next) write_compound(fp, c);
X	for (e = com->ellipses; e != NULL; e = e-> next) write_ellipse(fp, e);
X	for (l = com->lines; l != NULL; l = l-> next) write_line(fp, l);
X	for (s = com->splines; s != NULL; s = s-> next) write_spline(fp, s);
X	for (t = com->texts; t != NULL; t = t-> next) write_text(fp, t);
X	fprintf(fp, "%d\n", O_END_COMPOUND);
X	}
X
Xwrite_ellipse(fp, e)
XFILE		*fp;
XF_ellipse	*e;
X{
X	if( e->radiuses.x == 0 || e->radiuses.y == 0 )
X		return;
X	
X	fprintf(fp, "%d %d %d %d %d %d %d %d %.3f %d %.3f %d %d %d %d %d %d %d %d\n",
X		O_ELLIPSE, e->type, e->style, e->thickness, 
X		e->color, e->depth, e->pen, e->area_fill,
X		e->style_val, e->direction, e->angle,
X		e->center.x, e->center.y, 
X		e->radiuses.x, e->radiuses.y, 
X		e->start.x, e->start.y, 
X		e->end.x, e->end.y);
X	}
X
Xwrite_line(fp, l)
XFILE	*fp;
XF_line	*l;
X{
X	F_point	*p;
X	F_arrow	*f, *b;
X
X	if( l->points == NULL )
X		return;
X#ifndef TFX
X	if (l->type == T_ARC_BOX)
X	    fprintf(fp, "%d %d %d %d %d %d %d %d %.3f %d %d %d\n",
X		O_POLYLINE, l->type, l->style, l->thickness,
X		l->color, l->depth, l->pen, l->area_fill, l->style_val, l->radius,
X		((f = l->for_arrow) ? 1 : 0), ((b = l->back_arrow) ? 1 : 0));
X	else
X#endif TFX
X	    fprintf(fp, "%d %d %d %d %d %d %d %d %.3f %d %d\n",
X		O_POLYLINE, l->type, l->style, l->thickness,
X		l->color, l->depth, l->pen, l->area_fill, l->style_val,
X		((f = l->for_arrow) ? 1 : 0), ((b = l->back_arrow) ? 1 : 0));
X	if (f)
X	    fprintf(fp, "\t%d %d %.3f %.3f %.3f\n", f->type, f->style,
X			f->thickness, f->wid, f->ht);
X	if (b)
X	    fprintf(fp, "\t%d %d %.3f %.3f %.3f\n", b->type, b->style,
X			b->thickness, b->wid, b->ht);
X	fprintf(fp, "\t");
X	for (p = l->points; p!= NULL; p = p->next) {
X	    fprintf(fp, " %d %d", p->x, p->y);
X	    };
X	fprintf(fp, " 9999 9999\n");
X	}
X
Xwrite_spline(fp, s)
XFILE		*fp;
XF_spline	*s;
X{
X	F_control	*cp;
X	F_point		*p;
X	F_arrow		*f, *b;
X
X	if( s->points == NULL )
X		return;
X	fprintf(fp, "%d %d %d %d %d %d %d %d %.3f %d %d\n",
X		O_SPLINE, s->type, s->style, s->thickness,
X		s->color, s->depth, s->pen, s->area_fill, s->style_val,
X		((f = s->for_arrow) ? 1 : 0), ((b = s->back_arrow) ? 1 : 0));
X	if (f)
X	    fprintf(fp, "\t%d %d %.3f %.3f %.3f\n", f->type, f->style,
X			f->thickness, f->wid, f->ht);
X	if (b)
X	    fprintf(fp, "\t%d %d %.3f %.3f %.3f\n", b->type, b->style,
X			b->thickness, b->wid, b->ht);
X	fprintf(fp, "\t");
X	for (p = s->points; p != NULL; p = p->next) {
X	    fprintf(fp, " %d %d", p->x, p->y);
X	    };
X	fprintf(fp, " 9999 9999\n");  /* terminating code  */
X
X	if (s->controls == NULL) return;
X	fprintf(fp, "\t");
X	for (cp = s->controls; cp != NULL; cp = cp->next) {
X	    fprintf(fp, " %.3f %.3f %.3f %.3f",
X			cp->lx, cp->ly, cp->rx, cp->ry);
X	    };
X	fprintf(fp, "\n");
X	}
X
Xwrite_text(fp, t)
XFILE	*fp;
XF_text	*t;
X{
X	if( t->length == 0 )
X		return;
X	fprintf(fp, "%d %d %d %d %d %d %d %.3f %d %d %d %d %d %s\1\n", 
X		O_TEXT, t->type, t->font, t->size, t->pen,
X		t->color, t->depth, t->angle,
X		t->style, t->height, t->length, 
X		t->base_x, t->base_y, t->cstring);
X	}
END_OF_FILE
if test 6908 -ne `wc -c <'save.c'`; then
    echo shar: \"'save.c'\" unpacked with wrong size!
fi
# end of 'save.c'
fi
if test -f 'spline.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'spline.c'\"
else
echo shar: Extracting \"'spline.c'\" \(6183 characters\)
sed "s/^X//" >'spline.c' <<'END_OF_FILE'
X/* 
X *	FIG : Facility for Interactive Generation of figures
X *
X *	Copyright (c) 1985 by Supoj Sutanthavibul (supoj at sally.UTEXAS.EDU)
X *	January 1985.
X *	1st revision : Aug 1985, Add closed spline.
X *
X *	%W%	%G%
X*/
X#include "fig.h"
X#include "resources.h"
X#include "alloc.h"
X#include "func.h"
X#include "object.h"
X#include "paintop.h"
X
Xextern			(*canvas_kbd_proc)();
Xextern			(*canvas_locmove_proc)();
Xextern			(*canvas_leftbut_proc)();
Xextern			(*canvas_middlebut_proc)();
Xextern			(*canvas_rightbut_proc)();
Xextern			null_proc();
Xextern			set_popupmenu();
X
Xextern int		line_style, line_thickness;
Xextern float		cur_styleval;
Xextern int		cur_color;
Xextern int		cur_areafill;
Xextern int		fill_mode;
Xextern int		fix_x, fix_y, cur_x, cur_y;
Xextern int		cur_command;
Xextern int		manhattan_mode, mountain_mode;
Xextern int		autoforwardarrow_mode;
Xextern int		autobackwardarrow_mode;
Xextern int		arrow_ht, arrow_wid;
Xextern F_compound	objects;
Xextern int		num_point;
Xextern F_point		*first_point, *cur_point;
Xextern appresStruct	appres;
X
Xextern int		create_splineobject();
Xextern int		init_spline_drawing();
X
Xdraw_spline_selected()
X{
X	canvas_kbd_proc = null_proc;
X	canvas_locmove_proc = null_proc;
X	canvas_leftbut_proc = init_spline_drawing;
X	canvas_middlebut_proc = null_proc;
X	canvas_rightbut_proc = set_popupmenu;
X	set_cursor(&arrow_cursor);
X	reset_action_on();
X	}
X
Xinit_spline_drawing(x, y)
Xint	x, y;
X{
X	init_line_drawing(x, y);
X	canvas_middlebut_proc = create_splineobject;
X	canvas_rightbut_proc = null_proc;
X	}
X
Xcreate_splineobject(x, y)
Xint	x, y;
X{
X	extern F_arrow	*forward_arrow(), *backward_arrow();
X	F_spline	*spline;
X
X	if (x != fix_x || y != fix_y) get_intermediatepoint(x, y);
X	draw_elasticline();
X	if (num_point <= 2) {
X	    pw_vector(canvas_win, first_point->x, first_point->y,
X			cur_point->x, cur_point->y, PAINT, 1, SOLID_LINE, 0.0);
X	    if (num_point == 1) {
X		free((char*)cur_point);
X		cur_point = NULL;
X	    }
X	    free((char*)first_point);
X	    first_point = NULL;
X	    draw_spline_selected();
X	    return;
X	    }
X	if (NULL == (Spline_malloc(spline))) {
X	    put_msg(Err_mem);
X	    return(NULL);
X	    }
X	spline->style = line_style;
X	spline->thickness = line_thickness;
X	spline->style_val = cur_styleval;
X	spline->color = cur_color;
X	spline->depth = 0;
X	spline->pen = 0;
X	spline->area_fill = 0;
X	spline->points = first_point;
X	spline->controls = NULL; 
X	spline->next = NULL; 
X	cur_x = cur_y = fix_x = fix_y = 0; /* used in draw_movingpoint */
X	draw_movingpoint(spline->points, INV_PAINT); /* erase control vector */
X	if (cur_command == F_CLOSED_SPLINE) {
X	    spline->type = T_CLOSED_NORMAL;
X	    spline->for_arrow = NULL;
X	    spline->back_arrow = NULL;
X	    /* added 3/1/89 B.V.Smith */
X	    /* The current area fill color will be saved in the object if 
X	       fill_mode is != 0, but the method presently used to draw
X	       the spline doesn't easily lend itself to area fill,
X	       so it is drawn not filled.
X	       The spline is drawn in sections that aren't adjacent, 
X	       and have overlapping sections. */
X	    spline->area_fill = fill_mode? cur_areafill : 0;
X	    num_point++;
X	    append_point(first_point->x, first_point->y, &cur_point);
X	    draw_closed_spline(spline, PAINT);
X	    }
X	else {	/* It must be F_SPLINE */
X	    if (autoforwardarrow_mode)
X		spline->for_arrow = forward_arrow();
X	    else
X		spline->for_arrow = NULL;
X	    if (autobackwardarrow_mode)
X		spline->back_arrow = backward_arrow();
X	    else
X		spline->back_arrow = NULL;
X	    spline->type = T_OPEN_NORMAL;
X	    draw_open_spline(spline, PAINT);
X	    }
X	if (appres.DEBUG) {
X	    int		xmin, ymin, xmax, ymax;
X	    spline_bound(spline, &xmin, &ymin, &xmax, &ymax);
X	    draw_rectbox(xmin, ymin, xmax, ymax, PAINT);
X	    }
X	clean_up();
X	insert_spline(&objects.splines, spline);
X	set_action_object(F_CREATE, O_SPLINE);
X	set_latestspline(spline);
X	set_modifiedflag();
X	draw_spline_selected();
X	}
X
X#define			round(x)		((int) (x + .5))
X
Xdraw_open_spline(spline, op)
XF_spline	*spline;
Xint		op;
X{
X	F_point	*p;
X	float	cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
X	float	x1, y1, x2, y2;
X
X	p = spline->points;
X	x1 = p->x;  y1 = p->y;
X	p = p->next;
X	x2 = p->x;  y2 = p->y;
X	cx1 = (x1 + x2) / 2;      cy1 = (y1 + y2) / 2;
X	cx2 = (cx1 + x2) / 2;  cy2 = (cy1 + y2) / 2;
X	if (spline->back_arrow) /*  backward arrow  */
X	    draw_arrow((int)x2, (int)y2, (int)x1, (int)y1, 
X		spline->back_arrow, op);
X	pw_vector(canvas_win, (int)x1, (int)y1, round(cx1), 
X		round(cy1), op, spline->thickness, 
X		spline->style, spline->style_val);
X
X	for (p = p->next; p != NULL; p = p->next) {
X	    x1 = x2;  y1 = y2;
X	    x2 = p->x;  y2 = p->y;
X	    cx4 = (x1 + x2) / 2; cy4 = (y1 + y2) / 2;
X	    cx3 = (x1 + cx4) / 2; cy3 = (y1 + cy4) / 2;
X	    quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4, op,
X			spline->thickness, spline->style, spline->style_val);
X	    cx1 = cx4;  cy1 = cy4;
X	    cx2 = (cx1 + x2) / 2;  cy2 = (cy1 + y2) / 2;
X	    }
X	pw_vector(canvas_win, round(cx1), round(cy1), 
X		(int)x2, (int)y2, op, spline->thickness, 
X		spline->style, spline->style_val);
X	if (spline->for_arrow) /*  forward arrow  */
X	    draw_arrow((int)x1, (int)y1, (int)x2, (int)y2, 
X		spline->for_arrow, op);
X	}
X
Xdraw_closed_spline(spline, op)
XF_spline	*spline;
Xint		op;
X{
X	F_point	*p;
X	float	cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
X	float	x1, y1, x2, y2;
X
X	p = spline->points;
X	x1 = p->x;  y1 = p->y;
X	p = p->next;
X	x2 = p->x;  y2 = p->y;
X	cx1 = (x1 + x2) / 2;      cy1 = (y1 + y2) / 2;
X	cx2 = (x1 + 3 * x2) / 4;  cy2 = (y1 + 3 * y2) / 4;
X
X	for (p = p->next; p != NULL; p = p->next) {
X	    x1 = x2;  y1 = y2;
X	    x2 = p->x;  y2 = p->y;
X	    cx4 = (x1 + x2) / 2;   cy4 = (y1 + y2) / 2;
X	    cx3 = (x1 + cx4) / 2;  cy3 = (y1 + cy4) / 2;
X	    quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4, op, 
X			spline->thickness, spline->style, spline->style_val);
X	    cx1 = cx4;  cy1 = cy4;
X	    cx2 = (cx1 + x2) / 2;  cy2 = (cy1 + y2) / 2;
X	    }
X	x1 = x2;  y1 = y2;
X	p = spline->points->next;
X	x2 = p->x;  y2 = p->y;
X	cx4 = (x1 + x2) / 2;   cy4 = (y1 + y2) / 2;
X	cx3 = (x1 + cx4) / 2;  cy3 = (y1 + cy4) / 2;
X	quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4, op, 
X			spline->thickness, spline->style, spline->style_val);
X	}
END_OF_FILE
if test 6183 -ne `wc -c <'spline.c'`; then
    echo shar: \"'spline.c'\" unpacked with wrong size!
fi
# end of 'spline.c'
fi
echo shar: End of archive 6 \(of 21\).
cp /dev/null ark6isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 21 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 at sun.com / argv at ora.com
Opinions expressed reflect those of the author only.



More information about the Comp.sources.x mailing list