home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume19 / xfig / part11 < prev    next >
Encoding:
Text File  |  1993-05-26  |  72.7 KB  |  2,092 lines

  1. Newsgroups: comp.sources.x
  2. From: envbvs@epb9.lbl.gov (Brian V. Smith)
  3. Subject: v19i123:  xfig - Draw amd manipulate objects in an X-Window, Part11/27
  4. Message-ID: <1993May21.021437.5894@sparky.imd.sterling.com>
  5. X-Md4-Signature: e8ed189b92d14041ee6317fc1621bdce
  6. Sender: chris@sparky.imd.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Fri, 21 May 1993 02:14:37 GMT
  9. Approved: chris@sparky.imd.sterling.com
  10.  
  11. Submitted-by: envbvs@epb9.lbl.gov (Brian V. Smith)
  12. Posting-number: Volume 19, Issue 123
  13. Archive-name: xfig/part11
  14. Environment: X11
  15. Supersedes: xfig: Volume 16, Issue 6-30,39
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of archive 11 (of 27)."
  24. # Contents:  Examples/watch.fig.uu Makefile u_markers.c w_export.c
  25. #   w_modepanel.c
  26. # Wrapped by envbvs@epb9.lbl.gov.lbl.gov on Mon May  3 12:05:54 1993
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'Examples/watch.fig.uu' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'Examples/watch.fig.uu'\"
  30. else
  31. echo shar: Extracting \"'Examples/watch.fig.uu'\" \(13742 characters\)
  32. sed "s/^X//" >'Examples/watch.fig.uu' <<'END_OF_FILE'
  33. Xbegin 444 watch.fig
  34. XM(T9)1R`R+C$*.#`@,@HU(#$@,"`Q("TQ(#`@,"`P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D*,B`Q(#`@,2`M,2`P
  247. XM(#`@,"`P+C`P,"`P(#`@,`H)(#(T-"`T,SD@,C4X(#0S.2`Y.3DY(#DY.3D*
  248. XM,B`Q(#`@,B`M,2`P(#`@,"`P+C`P,"`P(#`@,`H)(#(U,B`T,CD@,C4R(#0R
  249. XM-R`Y.3DY(#DY.3D*-"`P(#$X(#$T(#`@+3$@,"`P+C`P,"`T(#$Q(#(S(#,Q
  250. XM.2`R.#D@04T!"C0@,2`Q."`Q."`P("TQ(#`@,"XP,#`@-"`Q-"`V,"`R,3@@
  251. XM,C,V($-!4TE/`0HT(#$@,3@@,30@,"`M,2`P(#`N,#`P(#0@,3$@,S(@-#,V
  252. XM(#0T,B!#2%(!"C0@,2`Q."`Q-"`P("TQ(#`@,"XP,#`@-"`Q,2`S,B`S.3,@
  253. XM-#0R(%1-4@$*-"`Q(#$X(#$T(#`@+3$@,"`P+C`P,"`T(#$Q(#0P(#,T-R`T
  254. XM-#(@1%5!3`$*-"`Q(#$X(#$T(#`@+3$@,"`P+C`P,"`T(#$Q(#,Q(#,P,2`T
  255. X(-#(@04Q-`0H*
  256. X`
  257. Xend
  258. END_OF_FILE
  259. if test 13742 -ne `wc -c <'Examples/watch.fig.uu'`; then
  260.     echo shar: \"'Examples/watch.fig.uu'\" unpacked with wrong size!
  261. fi
  262. # end of 'Examples/watch.fig.uu'
  263. fi
  264. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  265.   echo shar: Will not clobber existing file \"'Makefile'\"
  266. else
  267. echo shar: Extracting \"'Makefile'\" \(13610 characters\)
  268. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  269. X# Makefile generated by imake - do not edit!
  270. X# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
  271. X#
  272. X# The cpp used on this machine replaces all newlines and multiple tabs and
  273. X# spaces in a macro expansion with a single space.  Imake tries to compensate
  274. X# for this, but is not always successful.
  275. X#
  276. X
  277. X# -------------------------------------------------------------------------
  278. X# Makefile generated from "Imake.tmpl" and </tmp/IIf.a12617>
  279. X# $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
  280. X#
  281. X# Platform-specific parameters may be set in the appropriate <vendor>.cf
  282. X# configuration files.  Site-specific parameters should be set in the file
  283. X# site.def.  Full rebuilds are recommended if any parameters are changed.
  284. X#
  285. X# If your C preprocessor does not define any unique symbols, you will need
  286. X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  287. X# "make World" the first time).
  288. X#
  289. X
  290. X# -------------------------------------------------------------------------
  291. X# site-specific configuration parameters that need to come before
  292. X# the platform-specific parameters - edit site.def to change
  293. X
  294. X# site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  295. X
  296. X# -------------------------------------------------------------------------
  297. X# platform-specific configuration parameters - edit sun.cf to change
  298. X
  299. X# platform:  $XConsortium: sun.cf,v 1.72.1.1 92/03/18 13:13:37 rws Exp $
  300. X
  301. X# operating system:  SunOS 4.1.2
  302. X
  303. X# $XConsortium: sunLib.rules,v 1.7 91/12/20 11:19:47 rws Exp $
  304. X
  305. X# -------------------------------------------------------------------------
  306. X# site-specific configuration parameters that go after
  307. X# the platform-specific parameters - edit site.def to change
  308. X
  309. X# site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  310. X
  311. X            SHELL = /bin/sh
  312. X
  313. X              TOP = .
  314. X      CURRENT_DIR = .
  315. X
  316. X               AR = ar clq
  317. X  BOOTSTRAPCFLAGS =
  318. X               CC = cc
  319. X               AS = as
  320. X
  321. X         COMPRESS = compress
  322. X              CPP = /lib/cpp $(STD_CPP_DEFINES)
  323. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  324. X          INSTALL = install
  325. X               LD = ld
  326. X             LINT = lint
  327. X      LINTLIBFLAG = -C
  328. X         LINTOPTS = -axz
  329. X               LN = ln -s
  330. X             MAKE = make
  331. X               MV = mv
  332. X               CP = cp
  333. X
  334. X           RANLIB = ranlib
  335. X  RANLIBINSTFLAGS =
  336. X
  337. X               RM = rm -f
  338. X            TROFF = psroff
  339. X         MSMACROS = -ms
  340. X              TBL = tbl
  341. X              EQN = eqn
  342. X     STD_INCLUDES =
  343. X  STD_CPP_DEFINES =
  344. X      STD_DEFINES =
  345. X EXTRA_LOAD_FLAGS =
  346. X  EXTRA_LIBRARIES =
  347. X             TAGS = ctags
  348. X
  349. X    SHAREDCODEDEF = -DSHAREDCODE
  350. X         SHLIBDEF = -DSUNSHLIB
  351. X
  352. X    PROTO_DEFINES =
  353. X
  354. X     INSTPGMFLAGS =
  355. X
  356. X     INSTBINFLAGS = -m 0755
  357. X     INSTUIDFLAGS = -m 4755
  358. X     INSTLIBFLAGS = -m 0644
  359. X     INSTINCFLAGS = -m 0444
  360. X     INSTMANFLAGS = -m 0444
  361. X     INSTDATFLAGS = -m 0444
  362. X    INSTKMEMFLAGS = -g kmem -m 2755
  363. X
  364. X      CDEBUGFLAGS = -O
  365. X        CCOPTIONS =
  366. X
  367. X      ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
  368. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
  369. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  370. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  371. X
  372. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  373. X
  374. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS)
  375. X
  376. X   LDCOMBINEFLAGS = -X -r
  377. X      DEPENDFLAGS =
  378. X
  379. X        MACROFILE = sun.cf
  380. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
  381. X
  382. X    IMAKE_DEFINES =
  383. X
  384. X         IRULESRC = $(CONFIGDIR)
  385. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  386. X
  387. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  388. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  389. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  390. X
  391. X# -------------------------------------------------------------------------
  392. X# X Window System Build Parameters
  393. X# $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
  394. X
  395. X# -------------------------------------------------------------------------
  396. X# X Window System make variables; this need to be coordinated with rules
  397. X
  398. X          PATHSEP = /
  399. X        USRLIBDIR = /usr/lib
  400. X           BINDIR = /usr/bin/X11
  401. X          INCROOT = /usr/include
  402. X     BUILDINCROOT = $(TOP)
  403. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  404. X      BUILDINCTOP = ..
  405. X           INCDIR = $(INCROOT)/X11
  406. X           ADMDIR = /usr/adm
  407. X           LIBDIR = $(USRLIBDIR)/X11
  408. X        CONFIGDIR = $(LIBDIR)/config
  409. X       LINTLIBDIR = $(USRLIBDIR)/lint
  410. X
  411. X          FONTDIR = $(LIBDIR)/fonts
  412. X         XINITDIR = $(LIBDIR)/xinit
  413. X           XDMDIR = $(LIBDIR)/xdm
  414. X           TWMDIR = $(LIBDIR)/twm
  415. X          MANPATH = /usr/man
  416. X    MANSOURCEPATH = $(MANPATH)/man
  417. X        MANSUFFIX = l
  418. X     LIBMANSUFFIX = 3
  419. X           MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
  420. X        LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
  421. X           NLSDIR = $(LIBDIR)/nls
  422. X        PEXAPIDIR = $(LIBDIR)/PEX
  423. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  424. X       FONTCFLAGS = -t
  425. X
  426. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  427. X
  428. X            IMAKE = imake
  429. X           DEPEND = makedepend
  430. X              RGB = rgb
  431. X
  432. X            FONTC = bdftopcf
  433. X
  434. X        MKFONTDIR = mkfontdir
  435. X        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
  436. X
  437. X        CONFIGSRC = $(TOP)/config
  438. X       DOCUTILSRC = $(TOP)/doc/util
  439. X        CLIENTSRC = $(TOP)/clients
  440. X          DEMOSRC = $(TOP)/demos
  441. X           LIBSRC = $(TOP)/lib
  442. X          FONTSRC = $(TOP)/fonts
  443. X       INCLUDESRC = $(TOP)/X11
  444. X        SERVERSRC = $(TOP)/server
  445. X          UTILSRC = $(TOP)/util
  446. X        SCRIPTSRC = $(UTILSRC)/scripts
  447. X       EXAMPLESRC = $(TOP)/examples
  448. X       CONTRIBSRC = $(TOP)/../contrib
  449. X           DOCSRC = $(TOP)/doc
  450. X           RGBSRC = $(TOP)/rgb
  451. X        DEPENDSRC = $(UTILSRC)/makedepend
  452. X         IMAKESRC = $(CONFIGSRC)
  453. X         XAUTHSRC = $(LIBSRC)/Xau
  454. X          XLIBSRC = $(LIBSRC)/X
  455. X           XMUSRC = $(LIBSRC)/Xmu
  456. X       TOOLKITSRC = $(LIBSRC)/Xt
  457. X       AWIDGETSRC = $(LIBSRC)/Xaw
  458. X       OLDXLIBSRC = $(LIBSRC)/oldX
  459. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  460. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  461. X      BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
  462. X      BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
  463. X     MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
  464. X         FSLIBSRC = $(FONTSRC)/lib/fs
  465. X    FONTSERVERSRC = $(FONTSRC)/server
  466. X     EXTENSIONSRC = $(TOP)/extensions
  467. X         XILIBSRC = $(EXTENSIONSRC)/lib/xinput
  468. X      PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
  469. X
  470. X# $XConsortium: sunLib.tmpl,v 1.14.1.1 92/03/17 14:58:46 rws Exp $
  471. X
  472. XSHLIBLDFLAGS = -assert pure-text
  473. XPICFLAGS = -pic
  474. X
  475. X  DEPEXTENSIONLIB =
  476. X     EXTENSIONLIB = -lXext
  477. X
  478. X          DEPXLIB = $(DEPEXTENSIONLIB)
  479. X             XLIB = $(EXTENSIONLIB) -lX11
  480. X
  481. X        DEPXMULIB = $(USRLIBDIR)/libXmu.sa.$(SOXMUREV)
  482. X       XMULIBONLY = -lXmu
  483. X           XMULIB = -lXmu
  484. X
  485. X       DEPOLDXLIB =
  486. X          OLDXLIB = -loldX
  487. X
  488. X      DEPXTOOLLIB = $(USRLIBDIR)/libXt.sa.$(SOXTREV)
  489. X         XTOOLLIB = -lXt
  490. X
  491. X        DEPXAWLIB = $(USRLIBDIR)/libXaw.sa.$(SOXAWREV)
  492. X           XAWLIB = -lXaw
  493. X
  494. X        DEPXILIB =
  495. X           XILIB = -lXi
  496. X
  497. X        SOXLIBREV = 4.10
  498. X          SOXTREV = 4.10
  499. X         SOXAWREV = 5.0
  500. X        SOOLDXREV = 4.10
  501. X         SOXMUREV = 4.10
  502. X        SOXEXTREV = 4.10
  503. X      SOXINPUTREV = 4.10
  504. X
  505. X      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
  506. X         XAUTHLIB =  -lXau
  507. X      DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
  508. X         XDMCPLIB =  -lXdmcp
  509. X
  510. X        DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
  511. X           PHIGSLIB =  -lphigs
  512. X
  513. X       DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
  514. X          XBSDLIB =  -lXbsd
  515. X
  516. X LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
  517. X         LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
  518. X          LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
  519. X        LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
  520. X          LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
  521. X           LINTXI = $(LINTLIBDIR)/llib-lXi.ln
  522. X        LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
  523. X
  524. X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  525. X
  526. X         DEPLIBS1 = $(DEPLIBS)
  527. X         DEPLIBS2 = $(DEPLIBS)
  528. X         DEPLIBS3 = $(DEPLIBS)
  529. X
  530. X# -------------------------------------------------------------------------
  531. X# Imake rules for building libraries, programs, scripts, and data files
  532. X# rules:  $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
  533. X
  534. X# -------------------------------------------------------------------------
  535. X# start of Imakefile
  536. X
  537. X# Uncomment the following if needed for DECstations running older X11R4
  538. X#INCROOT=/usr/include/mit
  539. X
  540. XSYS_LIBRARIES=         -lm
  541. XDEPLIBS =         $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  542. X# use the following if NOT using DPS
  543. XLOCAL_LIBRARIES =     $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
  544. X# use the following if using DPS, *** and add -DDPS to the DEFINES line ***
  545. X#LOCAL_LIBRARIES =     -ldps $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
  546. X# use (and change) the following if you want the multi-key data base file
  547. X# somewhere other than the standard X11 library directory
  548. X#XFIGLIBDIR =        /usr/local/lib/X11/xfig
  549. X# use this if you want the multi-key data base file in the standard X11 tree
  550. XXFIGLIBDIR =        $(LIBDIR)/xfig
  551. XDIR_DEFS=        -DXFIGLIBDIR=\"$(XFIGLIBDIR)\"
  552. X
  553. X# remove -DGSBIT from the DEFINES if you DON'T want to have gs (ghostscript)
  554. X# generate a preview bitmap.  If you do use ghostscript you will need
  555. X# version 2.4 or later.
  556. XDEFINES =             $(STRSTRDEFINES) -DGSBIT
  557. X
  558. XXFIGSRC =    d_arc.c d_arcbox.c d_box.c d_ellipse.c d_epsobj.c \
  559. X        d_intspline.c d_line.c d_regpoly.c d_spline.c d_text.c \
  560. X        e_addpt.c e_align.c e_arrow.c e_break.c \
  561. X        e_convert.c e_copy.c e_delete.c e_deletept.c \
  562. X        e_edit.c e_flip.c e_glue.c e_move.c \
  563. X        e_movept.c e_rotate.c e_scale.c e_update.c \
  564. X        f_load.c f_read.c f_epsobj.c \
  565. X        f_readold.c f_save.c f_util.c f_xbitmap.c \
  566. X        main.c mode.c object.c resources.c \
  567. X        u_bound.c u_create.c u_drag.c u_draw.c \
  568. X        u_elastic.c u_error.c u_fonts.c u_free.c u_geom.c \
  569. X        u_list.c u_markers.c u_pan.c u_print.c \
  570. X        u_redraw.c u_search.c u_translate.c u_undo.c \
  571. X        w_canvas.c w_cmdpanel.c w_cursor.c w_dir.c w_drawprim.c \
  572. X        w_export.c w_file.c w_fontbits.c w_fontpanel.c w_grid.c \
  573. X        w_icons.c w_indpanel.c w_modepanel.c w_mousefun.c w_msgpanel.c \
  574. X        w_print.c w_rottext.c w_rulers.c w_setup.c w_util.c w_zoom.c
  575. X
  576. XXFIGOBJ =    d_arc.o d_arcbox.o d_box.o d_ellipse.o d_epsobj.o \
  577. X        d_intspline.o d_line.o d_regpoly.o d_spline.o d_text.o \
  578. X        e_addpt.o e_align.o e_arrow.o e_break.o \
  579. X        e_convert.o e_copy.o e_delete.o e_deletept.o \
  580. X        e_edit.o e_flip.o e_glue.o e_move.o \
  581. X        e_movept.o e_rotate.o e_scale.o e_update.o \
  582. X        f_load.o f_read.o f_epsobj.o \
  583. X        f_readold.o f_save.o f_util.o f_xbitmap.o \
  584. X        main.o mode.o object.o resources.o \
  585. X        u_bound.o u_create.o u_drag.o u_draw.o \
  586. X        u_elastic.o u_error.o u_fonts.o u_free.o u_geom.o \
  587. X        u_list.o u_markers.o u_pan.o u_print.o \
  588. X        u_redraw.o u_search.o u_translate.o u_undo.o \
  589. X        w_canvas.o w_cmdpanel.o w_cursor.o w_dir.o w_drawprim.o \
  590. X        w_export.o w_file.o w_fontbits.o w_fontpanel.o w_grid.o \
  591. X        w_icons.o w_indpanel.o w_modepanel.o w_mousefun.o w_msgpanel.o \
  592. X        w_print.o w_rottext.o w_rulers.o w_setup.o w_util.o w_zoom.o
  593. X
  594. XSRCS = $(XFIGSRC)
  595. XOBJS = $(XFIGOBJ)
  596. X
  597. X PROGRAM = xfig
  598. X
  599. Xall:: xfig
  600. X
  601. Xxfig: $(OBJS) $(DEPLIBS)
  602. X    $(RM) $@
  603. X    $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
  604. X
  605. Xsaber_xfig:: $(SRCS)
  606. X    # load $(ALLDEFINES) $(SRCS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  607. X
  608. Xosaber_xfig:: $(OBJS)
  609. X    # load $(ALLDEFINES) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  610. X
  611. Xinstall:: xfig
  612. X    @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
  613. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
  614. X    $(INSTALL) -c $(INSTPGMFLAGS)  xfig $(DESTDIR)$(BINDIR)
  615. X
  616. Xinstall.man:: Doc/xfig.man
  617. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  618. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  619. X    $(INSTALL) -c $(INSTMANFLAGS) Doc/xfig.man $(DESTDIR)$(MANDIR)/xfig.$(MANSUFFIX)
  620. X
  621. Xdepend::
  622. X    $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  623. X
  624. Xlint:
  625. X    $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
  626. Xlint1:
  627. X    $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  628. X
  629. Xclean::
  630. X    $(RM) $(PROGRAM)
  631. X
  632. Xinstall::
  633. X    @case '${MFLAGS}' in *[i]*) set +e;; esac;
  634. X    @for i in $(XFIGLIBDIR); do if [ -d $(DESTDIR)$$i ]; then \
  635. X    set +x; else (set -x; $(MKDIRHIER) $(DESTDIR)$$i); fi \
  636. X    done
  637. X
  638. Xinstall:: CompKeyDB
  639. X    $(INSTALL) -c $(INSTDATFLAGS) CompKeyDB $(DESTDIR)$(XFIGLIBDIR)
  640. X
  641. Xinstall:: Fig.ad
  642. X    @if [ -d $(DESTDIR)$(XAPPLOADDIR) ]; then set +x; \
  643. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(XAPPLOADDIR)); fi
  644. X    $(INSTALL) -c $(INSTAPPFLAGS) Fig.ad $(DESTDIR)$(XAPPLOADDIR)/Fig
  645. X
  646. Xinstall:: Fig-color.ad
  647. X    @if [ -d $(DESTDIR)$(XAPPLOADDIR) ]; then set +x; \
  648. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(XAPPLOADDIR)); fi
  649. X    $(INSTALL) -c $(INSTAPPFLAGS) Fig-color.ad $(DESTDIR)$(XAPPLOADDIR)/Fig-color
  650. X
  651. Xw_canvas.o:  $(ICONFIGFILES)
  652. X    $(RM) $@
  653. X    $(CC) -c $(CFLAGS)  $(DIR_DEFS) $*.c
  654. X
  655. X# -------------------------------------------------------------------------
  656. X# common rules for all Makefiles - do not edit
  657. X
  658. Xemptyrule::
  659. X
  660. Xclean::
  661. X    $(RM_CMD) "#"*
  662. X
  663. XMakefile::
  664. X    -@if [ -f Makefile ]; then set -x; \
  665. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  666. X    else exit 0; fi
  667. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  668. X
  669. Xtags::
  670. X    $(TAGS) -w *.[ch]
  671. X    $(TAGS) -xw *.[ch] > TAGS
  672. X
  673. Xsaber:
  674. X    # load $(ALLDEFINES) $(SRCS)
  675. X
  676. Xosaber:
  677. X    # load $(ALLDEFINES) $(OBJS)
  678. X
  679. X# -------------------------------------------------------------------------
  680. X# empty rules for directories that do not have SUBDIRS - do not edit
  681. X
  682. Xinstall::
  683. X    @echo "install in $(CURRENT_DIR) done"
  684. X
  685. Xinstall.man::
  686. X    @echo "install.man in $(CURRENT_DIR) done"
  687. X
  688. XMakefiles::
  689. X
  690. Xincludes::
  691. X
  692. X# -------------------------------------------------------------------------
  693. X# dependencies generated by makedepend
  694. X
  695. END_OF_FILE
  696. if test 13610 -ne `wc -c <'Makefile'`; then
  697.     echo shar: \"'Makefile'\" unpacked with wrong size!
  698. fi
  699. # end of 'Makefile'
  700. fi
  701. if test -f 'u_markers.c' -a "${1}" != "-c" ; then 
  702.   echo shar: Will not clobber existing file \"'u_markers.c'\"
  703. else
  704. echo shar: Extracting \"'u_markers.c'\" \(13865 characters\)
  705. sed "s/^X//" >'u_markers.c' <<'END_OF_FILE'
  706. X/*
  707. X * FIG : Facility for Interactive Generation of figures
  708. X * Copyright (c) 1985 by Supoj Sutanthavibul
  709. X *
  710. X * "Permission to use, copy, modify, distribute, and sell this software and its
  711. X * documentation for any purpose is hereby granted without fee, provided that
  712. X * the above copyright notice appear in all copies and that both the copyright
  713. X * notice and this permission notice appear in supporting documentation. 
  714. X * No representations are made about the suitability of this software for 
  715. X * any purpose.  It is provided "as is" without express or implied warranty."
  716. X */
  717. X
  718. X#include "fig.h"
  719. X#include "resources.h"
  720. X#include "object.h"
  721. X#include "mode.h"
  722. X#include "paintop.h"
  723. X#include "w_zoom.h"
  724. X
  725. X#define set_marker(win,x,y,w,h,z1,z2) \
  726. X    zXDrawRectangle(tool_d,(win),gccache[INV_PAINT],(x),(y),(w),(h))
  727. X
  728. X#ifdef notdef
  729. X/* not used in present implementation */
  730. Xstatic u_int    marker_pattern[3] = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
  731. X
  732. Xmpr_static(pmarker, 5, 5, 1, marker_pattern);
  733. X#endif
  734. X
  735. Xcenter_marker(x, y)
  736. X    int            x, y;
  737. X{
  738. X    pw_vector(canvas_win, x, y - 2, x, y + 2, INV_PAINT, 1,
  739. X          RUBBER_LINE, 0.0, DEFAULT_COLOR);
  740. X    pw_vector(canvas_win, x - 2, y, x + 2, y, INV_PAINT, 1,
  741. X          RUBBER_LINE, 0.0, DEFAULT_COLOR);
  742. X}
  743. X
  744. Xtoggle_csrhighlight(x, y)
  745. X    int            x, y;
  746. X{
  747. X    set_line_stuff(1, RUBBER_LINE, 0.0, (INV_PAINT), DEFAULT_COLOR);
  748. X    set_marker(canvas_win, x - 2, y - 2, 5, 5, 0, 0);
  749. X    set_marker(canvas_win, x - 1, y - 1, 3, 3, 0, 0);
  750. X}
  751. X
  752. Xellipse_in_mask()
  753. X{
  754. X    return (cur_objmask & M_ELLIPSE);
  755. X}
  756. X
  757. Xarc_in_mask()
  758. X{
  759. X    return (cur_objmask & M_ARC);
  760. X}
  761. X
  762. Xcompound_in_mask()
  763. X{
  764. X    return (cur_objmask & M_COMPOUND);
  765. X}
  766. X
  767. Xanytext_in_mask()
  768. X{
  769. X    return ((cur_objmask & M_TEXT_NORMAL) || (cur_objmask & M_TEXT_HIDDEN));
  770. X}
  771. X
  772. Xvalidtext_in_mask(t)
  773. X    F_text       *t;
  774. X{
  775. X    return ((hidden_text(t) && (cur_objmask & M_TEXT_HIDDEN)) ||
  776. X        ((!hidden_text(t)) && (cur_objmask & M_TEXT_NORMAL)));
  777. X}
  778. X
  779. Xanyline_in_mask()
  780. X{
  781. X    return ((cur_objmask & M_POLYLINE_LINE) ||
  782. X        (cur_objmask & M_POLYLINE_POLYGON) ||
  783. X        (cur_objmask & M_POLYLINE_BOX));
  784. X}
  785. X
  786. Xvalidline_in_mask(l)
  787. X    F_line       *l;
  788. X{
  789. X    return ((((l->type == T_BOX) ||
  790. X          (l->type == T_ARC_BOX)) && (cur_objmask & M_POLYLINE_BOX)) ||
  791. X        ((l->type == T_EPS_BOX) && (cur_objmask & M_POLYLINE_BOX)) ||
  792. X        ((l->type == T_POLYLINE) && (cur_objmask & M_POLYLINE_LINE)) ||
  793. X        ((l->type == T_POLYGON) && (cur_objmask & M_POLYLINE_POLYGON)));
  794. X}
  795. X
  796. Xanyspline_in_mask()
  797. X{
  798. X    return ((cur_objmask & M_SPLINE_O_NORMAL) ||
  799. X        (cur_objmask & M_SPLINE_O_INTERP) ||
  800. X        (cur_objmask & M_SPLINE_C_NORMAL) ||
  801. X        (cur_objmask & M_SPLINE_C_INTERP));
  802. X}
  803. X
  804. Xvalidspline_in_mask(s)
  805. X    F_spline       *s;
  806. X{
  807. X    return (((s->type == T_OPEN_INTERP) && (cur_objmask & M_SPLINE_O_INTERP)) ||
  808. X    ((s->type == T_OPEN_NORMAL) && (cur_objmask & M_SPLINE_O_NORMAL)) ||
  809. X      ((s->type == T_CLOSED_INTERP) && (cur_objmask & M_SPLINE_C_INTERP)) ||
  810. X       ((s->type == T_CLOSED_NORMAL) && (cur_objmask & M_SPLINE_C_NORMAL)));
  811. X}
  812. X
  813. Xmask_toggle_ellipsemarker(e)
  814. X    F_ellipse       *e;
  815. X{
  816. X    if (ellipse_in_mask())
  817. X    toggle_ellipsemarker(e);
  818. X}
  819. X
  820. Xmask_toggle_arcmarker(a)
  821. X    F_arc       *a;
  822. X{
  823. X    if (arc_in_mask())
  824. X    toggle_arcmarker(a);
  825. X}
  826. X
  827. Xmask_toggle_compoundmarker(c)
  828. X    F_compound       *c;
  829. X{
  830. X    if (compound_in_mask())
  831. X    toggle_compoundmarker(c);
  832. X}
  833. X
  834. Xmask_toggle_textmarker(t)
  835. X    F_text       *t;
  836. X{
  837. X    if (validtext_in_mask(t))
  838. X    toggle_textmarker(t);
  839. X}
  840. X
  841. Xmask_toggle_linemarker(l)
  842. X    F_line       *l;
  843. X{
  844. X    if (validline_in_mask(l))
  845. X    toggle_linemarker(l);
  846. X}
  847. X
  848. Xmask_toggle_splinemarker(s)
  849. X    F_spline       *s;
  850. X{
  851. X    if (validspline_in_mask(s))
  852. X    toggle_splinemarker(s);
  853. X}
  854. X
  855. Xtoggle_markers()
  856. X{
  857. X    toggle_markers_in_compound(&objects);
  858. X}
  859. X
  860. Xtoggle_markers_in_compound(cmpnd)
  861. X    F_compound       *cmpnd;
  862. X{
  863. X    F_ellipse       *e;
  864. X    F_arc       *a;
  865. X    F_line       *l;
  866. X    F_spline       *s;
  867. X    F_text       *t;
  868. X    F_compound       *c;
  869. X    register int    mask;
  870. X
  871. X    mask = cur_objmask;
  872. X    if (mask & M_ELLIPSE)
  873. X    for (e = cmpnd->ellipses; e != NULL; e = e->next)
  874. X        toggle_ellipsemarker(e);
  875. X    if ((mask & M_TEXT_NORMAL) || (mask & M_TEXT_HIDDEN))
  876. X    for (t = cmpnd->texts; t != NULL; t = t->next) {
  877. X        if ((hidden_text(t) && (mask & M_TEXT_HIDDEN)) ||
  878. X        ((!hidden_text(t)) && (mask & M_TEXT_NORMAL)))
  879. X        toggle_textmarker(t);
  880. X    }
  881. X    if (mask & M_ARC)
  882. X    for (a = cmpnd->arcs; a != NULL; a = a->next)
  883. X        toggle_arcmarker(a);
  884. X    if ((mask & M_POLYLINE_LINE) ||
  885. X    (mask & M_POLYLINE_POLYGON) ||
  886. X    (mask & M_POLYLINE_BOX))
  887. X    for (l = cmpnd->lines; l != NULL; l = l->next) {
  888. X        if ((((l->type == T_BOX) ||
  889. X          (l->type == T_ARC_BOX)) && (mask & M_POLYLINE_BOX)) ||
  890. X        ((l->type == T_EPS_BOX) && (mask & M_POLYLINE_BOX)) ||
  891. X        ((l->type == T_POLYLINE) && (mask & M_POLYLINE_LINE)) ||
  892. X        ((l->type == T_POLYGON) && (mask & M_POLYLINE_POLYGON)))
  893. X        toggle_linemarker(l);
  894. X    }
  895. X    if ((mask & M_SPLINE_O_NORMAL) || (mask & M_SPLINE_O_INTERP) ||
  896. X    (mask & M_SPLINE_C_NORMAL) || (mask & M_SPLINE_C_INTERP))
  897. X    for (s = cmpnd->splines; s != NULL; s = s->next) {
  898. X        if (((s->type == T_OPEN_INTERP) && (mask & M_SPLINE_O_INTERP)) ||
  899. X        ((s->type == T_OPEN_NORMAL) && (mask & M_SPLINE_O_NORMAL)) ||
  900. X         ((s->type == T_CLOSED_INTERP) && (mask & M_SPLINE_C_INTERP)) ||
  901. X        ((s->type == T_CLOSED_NORMAL) && (mask & M_SPLINE_C_NORMAL)))
  902. X        toggle_splinemarker(s);
  903. X    }
  904. X    if (mask & M_COMPOUND)
  905. X    for (c = cmpnd->compounds; c != NULL; c = c->next)
  906. X        toggle_compoundmarker(c);
  907. X}
  908. X
  909. Xupdate_markers(mask)
  910. X    int            mask;
  911. X{
  912. X    F_ellipse       *e;
  913. X    F_arc       *a;
  914. X    F_line       *l;
  915. X    F_spline       *s;
  916. X    F_text       *t;
  917. X    F_compound       *c;
  918. X    register int    oldmask, newmask;
  919. X
  920. X    oldmask = cur_objmask;
  921. X    newmask = mask;
  922. X    if ((oldmask & M_ELLIPSE) != (newmask & M_ELLIPSE))
  923. X    for (e = objects.ellipses; e != NULL; e = e->next)
  924. X        toggle_ellipsemarker(e);
  925. X    if (((oldmask & M_TEXT_NORMAL) != (newmask & M_TEXT_NORMAL)) ||
  926. X    ((oldmask & M_TEXT_HIDDEN) != (newmask & M_TEXT_HIDDEN)))
  927. X    for (t = objects.texts; t != NULL; t = t->next) {
  928. X        if ((hidden_text(t) &&
  929. X         ((oldmask & M_TEXT_HIDDEN) != (newmask & M_TEXT_HIDDEN))) ||
  930. X        ((!hidden_text(t)) &&
  931. X         ((oldmask & M_TEXT_NORMAL) != (newmask & M_TEXT_NORMAL))))
  932. X        toggle_textmarker(t);
  933. X    }
  934. X    if ((oldmask & M_ARC) != (newmask & M_ARC))
  935. X    for (a = objects.arcs; a != NULL; a = a->next)
  936. X        toggle_arcmarker(a);
  937. X    if (((oldmask & M_POLYLINE_LINE) != (newmask & M_POLYLINE_LINE)) ||
  938. X    ((oldmask & M_POLYLINE_POLYGON) != (newmask & M_POLYLINE_POLYGON)) ||
  939. X    ((oldmask & M_POLYLINE_BOX) != (newmask & M_POLYLINE_BOX)))
  940. X    for (l = objects.lines; l != NULL; l = l->next) {
  941. X        if ((((l->type == T_BOX) ||
  942. X          (l->type == T_ARC_BOX || l->type == T_EPS_BOX)) &&
  943. X          ((oldmask & M_POLYLINE_BOX) != (newmask & M_POLYLINE_BOX))) ||
  944. X        ((l->type == T_POLYLINE) &&
  945. X        ((oldmask & M_POLYLINE_LINE) != (newmask & M_POLYLINE_LINE))) ||
  946. X        ((l->type == T_POLYGON) &&
  947. X         ((oldmask & M_POLYLINE_POLYGON) != (newmask & M_POLYLINE_POLYGON))))
  948. X        toggle_linemarker(l);
  949. X    }
  950. X    if (((oldmask & M_SPLINE_O_NORMAL) != (newmask & M_SPLINE_O_NORMAL)) ||
  951. X    ((oldmask & M_SPLINE_O_INTERP) != (newmask & M_SPLINE_O_INTERP)) ||
  952. X    ((oldmask & M_SPLINE_C_NORMAL) != (newmask & M_SPLINE_C_NORMAL)) ||
  953. X    ((oldmask & M_SPLINE_C_INTERP) != (newmask & M_SPLINE_C_INTERP)))
  954. X    for (s = objects.splines; s != NULL; s = s->next) {
  955. X        if (((s->type == T_OPEN_INTERP) &&
  956. X         ((oldmask & M_SPLINE_O_INTERP) !=
  957. X          (newmask & M_SPLINE_O_INTERP))) ||
  958. X        ((s->type == T_OPEN_NORMAL) &&
  959. X         ((oldmask & M_SPLINE_O_NORMAL) !=
  960. X          (newmask & M_SPLINE_O_NORMAL))) ||
  961. X        ((s->type == T_CLOSED_INTERP) &&
  962. X         ((oldmask & M_SPLINE_C_INTERP) !=
  963. X          (newmask & M_SPLINE_C_INTERP))) ||
  964. X        ((s->type == T_CLOSED_NORMAL) &&
  965. X         ((oldmask & M_SPLINE_C_NORMAL) !=
  966. X          (newmask & M_SPLINE_C_NORMAL))))
  967. X        toggle_splinemarker(s);
  968. X    }
  969. X    if ((oldmask & M_COMPOUND) != (newmask & M_COMPOUND))
  970. X    for (c = objects.compounds; c != NULL; c = c->next)
  971. X        toggle_compoundmarker(c);
  972. X    cur_objmask = newmask;
  973. X}
  974. X
  975. Xtoggle_ellipsemarker(e)
  976. X    F_ellipse       *e;
  977. X{
  978. X    set_line_stuff(1, RUBBER_LINE, 0.0, (INV_PAINT), DEFAULT_COLOR);
  979. X    set_marker(canvas_win, e->start.x - 2, e->start.y - 2, 5, 5, 0, 0);
  980. X    set_marker(canvas_win, e->end.x - 2, e->end.y - 2, 5, 5, 0, 0);
  981. X    if (e->tagged)
  982. X    toggle_ellipsehighlight(e);
  983. X}
  984. X
  985. Xtoggle_ellipsehighlight(e)
  986. X    F_ellipse       *e;
  987. X{
  988. X    set_line_stuff(1, RUBBER_LINE, 0.0, (INV_PAINT), DEFAULT_COLOR);
  989. X    set_marker(canvas_win, e->start.x, e->start.y, 1, 1, 0, 0);
  990. X    set_marker(canvas_win, e->start.x - 1, e->start.y - 1, 3, 3, 0, 0);
  991. X    set_marker(canvas_win, e->end.x, e->end.y, 1, 1, 0, 0);
  992. X    set_marker(canvas_win, e->end.x - 1, e->end.y - 1, 3, 3, 0, 0);
  993. X}
  994. X
  995. Xtoggle_arcmarker(a)
  996. X    F_arc       *a;
  997. X{
  998. X    set_line_stuff(1, RUBBER_LINE, 0.0, (INV_PAINT), DEFAULT_COLOR);
  999. X    set_marker(canvas_win, a->point[0].x - 2, a->point[0].y - 2, 5, 5, 0, 0);
  1000. X    set_marker(canvas_win, a->point[1].x - 2, a->point[1].y - 2, 5, 5, 0, 0);
  1001. X    set_marker(canvas_win, a->point[2].x - 2, a->point[2].y - 2, 5, 5, 0, 0);
  1002. X    if (a->tagged)
  1003. X    toggle_archighlight(a);
  1004. X}
  1005. X
  1006. Xtoggle_archighlight(a)
  1007. X    F_arc       *a;
  1008. X{
  1009. X    set_line_stuff(1, RUBBER_LINE, 0.0, (INV_PAINT), DEFAULT_COLOR);
  1010. X    set_marker(canvas_win, a->point[0].x, a->point[0].y, 1, 1, 0, 0);
  1011. X    set_marker(canvas_win, a->point[0].x - 1, a->point[0].y - 1, 3, 3, 0, 0);
  1012. X    set_marker(canvas_win, a->point[1].x, a->point[1].y, 1, 1, 0, 0);
  1013. X    set_marker(canvas_win, a->point[1].x - 1, a->point[1].y - 1, 3, 3, 0, 0);
  1014. X    set_marker(canvas_win, a->point[2].x, a->point[2].y, 1, 1, 0, 0);
  1015. X    set_marker(canvas_win, a->point[2].x - 1, a->point[2].y - 1, 3, 3, 0, 0);
  1016. X}
  1017. X
  1018. Xtoggle_textmarker(t)
  1019. X    F_text       *t;
  1020. X{
  1021. X    int            dx, dy;
  1022. X
  1023. X    set_line_stuff(1, RUBBER_LINE, 0.0, (INV_PAINT), DEFAULT_COLOR);
  1024. X    /* adjust for text angle */
  1025. X    dy = (int) ((double) t->height * cos(t->angle));
  1026. X    dx = (int) ((double) t->height * sin(t->angle));
  1027. X    set_marker(canvas_win, t->base_x - dx - 2, t->base_y - dy - 2, 5, 5, 0, 0);
  1028. X    set_marker(canvas_win, t->base_x - 2, t->base_y - 2, 5, 5, 0, 0);
  1029. X    if (t->tagged)
  1030. X    toggle_texthighlight(t);
  1031. X}
  1032. X
  1033. Xtoggle_texthighlight(t)
  1034. X    F_text       *t;
  1035. X{
  1036. X    int            dx, dy;
  1037. X
  1038. X    set_line_stuff(1, RUBBER_LINE, 0.0, (INV_PAINT), DEFAULT_COLOR);
  1039. X    /* adjust for text angle */
  1040. X    dy = (int) ((double) t->height * cos(t->angle));
  1041. X    dx = (int) ((double) t->height * sin(t->angle));
  1042. X    set_marker(canvas_win, t->base_x - dx, t->base_y - dy, 1, 1, 0, 0);
  1043. X    set_marker(canvas_win, t->base_x - dx - 1, t->base_y - dy - 1, 3, 3, 0, 0);
  1044. X    set_marker(canvas_win, t->base_x, t->base_y, 1, 1, 0, 0);
  1045. X    set_marker(canvas_win, t->base_x - 1, t->base_y - 1, 3, 3, 0, 0);
  1046. X}
  1047. X
  1048. Xtoggle_all_compoundmarkers()
  1049. X{
  1050. X    F_compound       *c;
  1051. X    for (c=objects.compounds; c!=NULL ; c=c->next)
  1052. X    toggle_compoundmarker(c);
  1053. X}
  1054. X
  1055. Xtoggle_compoundmarker(c)
  1056. X    F_compound       *c;
  1057. X{
  1058. X    set_line_stuff(1, RUBBER_LINE, 0.0, (INV_PAINT), DEFAULT_COLOR);
  1059. X    set_marker(canvas_win, c->nwcorner.x - 2, c->nwcorner.y - 2, 5, 5, 0, 0);
  1060. X    set_marker(canvas_win, c->secorner.x - 2, c->secorner.y - 2, 5, 5, 0, 0);
  1061. X    set_marker(canvas_win, c->nwcorner.x - 2, c->secorner.y - 2, 5, 5, 0, 0);
  1062. X    set_marker(canvas_win, c->secorner.x - 2, c->nwcorner.y - 2, 5, 5, 0, 0);
  1063. X    if (c->tagged)
  1064. X    toggle_compoundhighlight(c);
  1065. X}
  1066. X
  1067. Xtoggle_compoundhighlight(c)
  1068. X    F_compound       *c;
  1069. X{
  1070. X    set_line_stuff(1, RUBBER_LINE, 0.0, (INV_PAINT), DEFAULT_COLOR);
  1071. X    set_marker(canvas_win, c->nwcorner.x, c->nwcorner.y, 1, 1, 0, 0);
  1072. X    set_marker(canvas_win, c->nwcorner.x - 1, c->nwcorner.y - 1, 3, 3, 0, 0);
  1073. X    set_marker(canvas_win, c->secorner.x, c->secorner.y, 1, 1, 0, 0);
  1074. X    set_marker(canvas_win, c->secorner.x - 1, c->secorner.y - 1, 3, 3, 0, 0);
  1075. X    set_marker(canvas_win, c->nwcorner.x, c->secorner.y, 1, 1, 0, 0);
  1076. X    set_marker(canvas_win, c->nwcorner.x - 1, c->secorner.y - 1, 3, 3, 0, 0);
  1077. X    set_marker(canvas_win, c->secorner.x, c->nwcorner.y, 1, 1, 0, 0);
  1078. X    set_marker(canvas_win, c->secorner.x - 1, c->nwcorner.y - 1, 3, 3, 0, 0);
  1079. X}
  1080. X
  1081. Xtoggle_linemarker(l)
  1082. X    F_line       *l;
  1083. X{
  1084. X    F_point       *p;
  1085. X    int            fx, fy, x, y;
  1086. X
  1087. X    set_line_stuff(1, RUBBER_LINE, 0.0, (INV_PAINT), DEFAULT_COLOR);
  1088. X    p = l->points;
  1089. X    fx = p->x;
  1090. X    fy = p->y;
  1091. X    for (p = p->next; p != NULL; p = p->next) {
  1092. X    x = p->x;
  1093. X    y = p->y;
  1094. X    set_marker(canvas_win, x - 2, y - 2, 5, 5, 0, 0);
  1095. X    }
  1096. X    if (x != fx || y != fy || l->points->next == NULL) {
  1097. X    set_marker(canvas_win, fx - 2, fy - 2, 5, 5, 0, 0);
  1098. X    }
  1099. X    if (l->tagged)
  1100. X    toggle_linehighlight(l);
  1101. X}
  1102. X
  1103. Xtoggle_linehighlight(l)
  1104. X    F_line       *l;
  1105. X{
  1106. X    F_point       *p;
  1107. X    int            fx, fy, x, y;
  1108. X
  1109. X    set_line_stuff(1, RUBBER_LINE, 0.0, (INV_PAINT), DEFAULT_COLOR);
  1110. X    p = l->points;
  1111. X    fx = p->x;
  1112. X    fy = p->y;
  1113. X    for (p = p->next; p != NULL; p = p->next) {
  1114. X    x = p->x;
  1115. X    y = p->y;
  1116. X    set_marker(canvas_win, x, y, 1, 1, 0, 0);
  1117. X    set_marker(canvas_win, x - 1, y - 1, 3, 3, 0, 0);
  1118. X    }
  1119. X    if (x != fx || y != fy) {
  1120. X    set_marker(canvas_win, fx, fy, 1, 1, 0, 0);
  1121. X    set_marker(canvas_win, fx - 1, fy - 1, 3, 3, 0, 0);
  1122. X    }
  1123. X}
  1124. X
  1125. Xtoggle_splinemarker(s)
  1126. X    F_spline       *s;
  1127. X{
  1128. X    F_point       *p;
  1129. X    int            fx, fy, x, y;
  1130. X
  1131. X    set_line_stuff(1, RUBBER_LINE, 0.0, (INV_PAINT), DEFAULT_COLOR);
  1132. X    p = s->points;
  1133. X    fx = p->x;
  1134. X    fy = p->y;
  1135. X    for (p = p->next; p != NULL; p = p->next) {
  1136. X    x = p->x;
  1137. X    y = p->y;
  1138. X    set_marker(canvas_win, x - 2, y - 2, 5, 5, 0, 0);
  1139. X    }
  1140. X    if (x != fx || y != fy) {
  1141. X    set_marker(canvas_win, fx - 2, fy - 2, 5, 5, 0, 0);
  1142. X    }
  1143. X    if (s->tagged)
  1144. X    toggle_splinehighlight(s);
  1145. X}
  1146. X
  1147. Xtoggle_splinehighlight(s)
  1148. X    F_spline       *s;
  1149. X{
  1150. X    F_point       *p;
  1151. X    int            fx, fy, x, y;
  1152. X
  1153. X    set_line_stuff(1, RUBBER_LINE, 0.0, (INV_PAINT), DEFAULT_COLOR);
  1154. X    p = s->points;
  1155. X    fx = p->x;
  1156. X    fy = p->y;
  1157. X    for (p = p->next; p != NULL; p = p->next) {
  1158. X    x = p->x;
  1159. X    y = p->y;
  1160. X    set_marker(canvas_win, x, y, 1, 1, 0, 0);
  1161. X    set_marker(canvas_win, x - 1, y - 1, 3, 3, 0, 0);
  1162. X    }
  1163. X    if (x != fx || y != fy) {
  1164. X    set_marker(canvas_win, fx, fy, 1, 1, 0, 0);
  1165. X    set_marker(canvas_win, fx - 1, fy - 1, 3, 3, 0, 0);
  1166. X    }
  1167. X}
  1168. END_OF_FILE
  1169. if test 13865 -ne `wc -c <'u_markers.c'`; then
  1170.     echo shar: \"'u_markers.c'\" unpacked with wrong size!
  1171. fi
  1172. # end of 'u_markers.c'
  1173. fi
  1174. if test -f 'w_export.c' -a "${1}" != "-c" ; then 
  1175.   echo shar: Will not clobber existing file \"'w_export.c'\"
  1176. else
  1177. echo shar: Extracting \"'w_export.c'\" \(13679 characters\)
  1178. sed "s/^X//" >'w_export.c' <<'END_OF_FILE'
  1179. X/*
  1180. X * FIG : Facility for Interactive Generation of figures
  1181. X * Copyright (c) 1985 by Supoj Sutanthavibul
  1182. X *
  1183. X * "Permission to use, copy, modify, distribute, and sell this software and its
  1184. X * documentation for any purpose is hereby granted without fee, provided that
  1185. X * the above copyright notice appear in all copies and that both the copyright
  1186. X * notice and this permission notice appear in supporting documentation. 
  1187. X * No representations are made about the suitability of this software for 
  1188. X * any purpose.  It is provided "as is" without express or implied warranty."
  1189. X */
  1190. X
  1191. X#include "fig.h"
  1192. X#include "figx.h"
  1193. X#include "mode.h"
  1194. X#include "resources.h"
  1195. X#include "w_dir.h"
  1196. X#include "w_drawprim.h"        /* for char_height */
  1197. X#include "w_setup.h"
  1198. X#include "w_util.h"
  1199. X
  1200. Xextern String    text_translations;
  1201. Xextern Widget    make_popup_menu();
  1202. Xextern char    *panel_get_value();
  1203. Xextern Widget    file_popup;
  1204. Xextern Widget    file_dir;
  1205. X
  1206. X/* global so w_file.c can access it */
  1207. Xchar        default_export_file[PATH_MAX];
  1208. Xchar        export_dir[PATH_MAX];
  1209. X
  1210. X/* LOCAL */
  1211. X
  1212. Xstatic String    file_name_translations =
  1213. X    "<Key>Return: ExportFile()\n";
  1214. Xvoid        do_export();
  1215. Xstatic XtActionsRec    file_name_actions[] =
  1216. X{
  1217. X    {"ExportFile", (XtActionProc) do_export},
  1218. X};
  1219. Xstatic String   export_translations =
  1220. X        "<Message>WM_PROTOCOLS: DismissExport()\n";
  1221. Xstatic void     export_panel_cancel();
  1222. Xstatic XtActionsRec     export_actions[] =
  1223. X{
  1224. X    {"DismissExport", (XtActionProc) export_panel_cancel},
  1225. X    {"cancel", (XtActionProc) export_panel_cancel},
  1226. X    {"export", (XtActionProc) do_export},
  1227. X};
  1228. X
  1229. Xstatic char    named_file[60];
  1230. X
  1231. Xstatic char    *orient_items[] = {
  1232. X    "Portrait ",
  1233. X    "Landscape"};
  1234. X
  1235. Xstatic char    *just_items[] = {
  1236. X    "Centered",
  1237. X    "Flush left"};
  1238. X
  1239. Xstatic void    orient_select();
  1240. Xstatic Widget    orient_panel, orient_menu, orient_lab;
  1241. X
  1242. Xstatic void    lang_select();
  1243. Xstatic Widget    lang_panel, lang_menu, lang_lab;
  1244. X
  1245. Xstatic void    just_select();
  1246. Xstatic Widget    just_panel, just_menu, just_lab;
  1247. X
  1248. Xstatic Widget    cancel_but, export_but;
  1249. Xstatic Widget    dfile_lab, dfile_text, nfile_lab;
  1250. Xstatic Widget    export_popup, mag_lab, mag_text, export_w;
  1251. Xstatic Position xposn, yposn;
  1252. X
  1253. X/* Global so w_dir.c can access us */
  1254. X
  1255. XWidget        export_panel,    /* so w_dir can access the scrollbars */
  1256. X        exp_selfile,    /* output (selected) file widget */
  1257. X        exp_mask,    /* mask widget */
  1258. X        exp_dir,    /* current directory widget */
  1259. X        exp_flist,    /* file list wiget */
  1260. X        exp_dlist;    /* dir list wiget */
  1261. X
  1262. XBoolean        export_up = False;
  1263. X
  1264. Xstatic void
  1265. Xexport_panel_dismiss()
  1266. X{
  1267. X    DeclareArgs(1);
  1268. X
  1269. X    FirstArg(XtNstring, "\0");
  1270. X    SetValues(exp_selfile);        /* clear ascii widget string */
  1271. X    XtPopdown(export_popup);
  1272. X    XtSetSensitive(export_w, True);
  1273. X    export_up = False;
  1274. X}
  1275. X
  1276. Xstatic void
  1277. Xexport_panel_cancel(w, ev)
  1278. X    Widget        w;
  1279. X    XButtonEvent   *ev;
  1280. X{
  1281. X    export_panel_dismiss();
  1282. X}
  1283. X
  1284. Xstatic char    export_msg[] = "EXPORT";
  1285. X
  1286. Xvoid
  1287. Xdo_export(w)
  1288. X    Widget        w;
  1289. X{
  1290. X    DeclareArgs(1);
  1291. X    float        mag;
  1292. X    char       *fval;
  1293. X
  1294. X    if (emptyfigure_msg(export_msg))
  1295. X        return;
  1296. X
  1297. X    if (!export_popup) 
  1298. X        create_export_panel(w);
  1299. X    FirstArg(XtNstring, &fval);
  1300. X    GetValues(exp_selfile);
  1301. X    if (emptyname(fval)) {        /* output filename is empty, use default */
  1302. X        fval = default_export_file;
  1303. X        warnexist = False;        /* don't warn if this file exists */
  1304. X    } else {
  1305. X        warnexist = True;        /* otherwise warn if the file exists */
  1306. X    }
  1307. X
  1308. X    /* if not absolute path, change directory */
  1309. X    if (*fval != '/') {
  1310. X        if (change_directory(export_dir) != 0)
  1311. X        return;
  1312. X    }
  1313. X
  1314. X    /* check for XBitmap first */
  1315. X    if (cur_exp_lang == LANG_XBITMAP) {
  1316. X        XtSetSensitive(export_but, False);
  1317. X        if (write_bitmap(fval) == 0)
  1318. X        {
  1319. X        FirstArg(XtNlabel, fval);
  1320. X        SetValues(dfile_text);        /* set the default filename */
  1321. X        if (strcmp(fval,default_export_file) != 0)
  1322. X            strcpy(default_export_file,fval); /* and copy to default */
  1323. X        export_panel_dismiss();
  1324. X        }
  1325. X        XtSetSensitive(export_but, True);
  1326. X    } else {
  1327. X        mag = (float) atof(panel_get_value(mag_text)) / 100.0;
  1328. X        if (mag <= 0.0)
  1329. X        mag = 1.0;
  1330. X        XtSetSensitive(export_but, False);
  1331. X        if (print_to_file(fval, lang_items[cur_exp_lang],
  1332. X                  mag, export_flushleft) == 0)
  1333. X        {
  1334. X        FirstArg(XtNlabel, fval);
  1335. X        SetValues(dfile_text);        /* set the default filename */
  1336. X        if (strcmp(fval,default_export_file) != 0)
  1337. X            strcpy(default_export_file,fval); /* and copy to default */
  1338. X        export_panel_dismiss();
  1339. X        }
  1340. X        XtSetSensitive(export_but, True);
  1341. X    }
  1342. X}
  1343. X
  1344. Xstatic void
  1345. Xorient_select(w, new_orient, garbage)
  1346. X    Widget        w;
  1347. X    XtPointer        new_orient, garbage;
  1348. X{
  1349. X    DeclareArgs(1);
  1350. X
  1351. X    FirstArg(XtNlabel, XtName(w));
  1352. X    SetValues(orient_panel);
  1353. X    print_landscape = (int) new_orient;
  1354. X}
  1355. X
  1356. Xstatic void
  1357. Xjust_select(w, new_just, garbage)
  1358. X    Widget        w;
  1359. X    XtPointer        new_just, garbage;
  1360. X{
  1361. X    DeclareArgs(1);
  1362. X
  1363. X    FirstArg(XtNlabel, XtName(w));
  1364. X    SetValues(just_panel);
  1365. X    export_flushleft = (new_just? True: False);
  1366. X}
  1367. X
  1368. Xstatic void
  1369. Xlang_select(w, new_lang, garbage)
  1370. X    Widget        w;
  1371. X    XtPointer        new_lang, garbage;
  1372. X{
  1373. X    DeclareArgs(1);
  1374. X
  1375. X    FirstArg(XtNlabel, XtName(w));
  1376. X    SetValues(lang_panel);
  1377. X    cur_exp_lang = (int) new_lang;
  1378. X    if (cur_exp_lang == LANG_XBITMAP) {
  1379. X    XtSetSensitive(mag_lab, False);
  1380. X    XtSetSensitive(mag_text, False);
  1381. X    XtSetSensitive(orient_lab, False);
  1382. X    XtSetSensitive(orient_panel, False);
  1383. X    } else {
  1384. X    XtSetSensitive(mag_lab, True);
  1385. X    XtSetSensitive(mag_text, True);
  1386. X    XtSetSensitive(orient_lab, True);
  1387. X    XtSetSensitive(orient_panel, True);
  1388. X    }
  1389. X
  1390. X    if (cur_exp_lang == LANG_PS) {
  1391. X    XtSetSensitive(just_lab, True);
  1392. X    XtSetSensitive(just_panel, True);
  1393. X    } else {
  1394. X    XtSetSensitive(just_lab, False);
  1395. X    XtSetSensitive(just_panel, False);
  1396. X    }
  1397. X
  1398. X    update_def_filename();
  1399. X    FirstArg(XtNlabel, default_export_file);
  1400. X    SetValues(dfile_text);
  1401. X}
  1402. X
  1403. Xpopup_export_panel(w)
  1404. X    Widget        w;
  1405. X{
  1406. X    extern Atom wm_delete_window;
  1407. X
  1408. X    DeclareArgs(10);
  1409. X
  1410. X    set_temp_cursor(wait_cursor);
  1411. X    XtSetSensitive(w, False);
  1412. X    export_up = True;
  1413. X
  1414. X    if (!export_popup)
  1415. X        create_export_panel(w);
  1416. X
  1417. X    /* set the directory widget to the current export directory */
  1418. X    FirstArg(XtNstring, export_dir);
  1419. X    SetValues(exp_dir);
  1420. X
  1421. X    Rescan(0, 0, 0, 0);
  1422. X
  1423. X    FirstArg(XtNlabel, default_export_file);
  1424. X    NextArg(XtNwidth, 250);
  1425. X    SetValues(dfile_text);
  1426. X    XtPopup(export_popup, XtGrabNonexclusive);
  1427. X        (void) XSetWMProtocols(XtDisplay(export_popup), XtWindow(export_popup),
  1428. X                   &wm_delete_window, 1);
  1429. X    reset_cursor();
  1430. X}
  1431. X
  1432. Xcreate_export_panel(w)
  1433. X    Widget        w;
  1434. X{
  1435. X    Widget            beside, below;
  1436. X    PIX_FONT    temp_font;
  1437. X    DeclareArgs(10);
  1438. X
  1439. X    export_w = w;
  1440. X    XtTranslateCoords(w, (Position) 0, (Position) 0, &xposn, &yposn);
  1441. X
  1442. X    FirstArg(XtNx, xposn);
  1443. X    NextArg(XtNy, yposn + 50);
  1444. X    NextArg(XtNtitle, "Xfig: Export menu");
  1445. X    export_popup = XtCreatePopupShell("xfig_export_menu",
  1446. X                      transientShellWidgetClass,
  1447. X                      tool, Args, ArgCount);
  1448. X    XtOverrideTranslations(export_popup,
  1449. X               XtParseTranslationTable(export_translations));
  1450. X    XtAppAddActions(tool_app, export_actions, XtNumber(export_actions));
  1451. X
  1452. X    export_panel = XtCreateManagedWidget("export_panel", formWidgetClass,
  1453. X                         export_popup, NULL, ZERO);
  1454. X
  1455. X    FirstArg(XtNlabel, "   Magnification%:");
  1456. X    NextArg(XtNjustify, XtJustifyLeft);
  1457. X    NextArg(XtNborderWidth, 0);
  1458. X    mag_lab = XtCreateManagedWidget("mag_label", labelWidgetClass,
  1459. X                    export_panel, Args, ArgCount);
  1460. X
  1461. X    FirstArg(XtNwidth, 40);
  1462. X    NextArg(XtNfromHoriz, mag_lab);
  1463. X    NextArg(XtNeditType, "edit");
  1464. X    NextArg(XtNstring, "100");
  1465. X    NextArg(XtNinsertPosition, 3);
  1466. X    NextArg(XtNborderWidth, INTERNAL_BW);
  1467. X    mag_text = XtCreateManagedWidget("magnification", asciiTextWidgetClass,
  1468. X                     export_panel, Args, ArgCount);
  1469. X    XtOverrideTranslations(mag_text,
  1470. X               XtParseTranslationTable(text_translations));
  1471. X
  1472. X    FirstArg(XtNlabel, "      Orientation:");
  1473. X    NextArg(XtNjustify, XtJustifyLeft);
  1474. X    NextArg(XtNborderWidth, 0);
  1475. X    NextArg(XtNfromVert, mag_text);
  1476. X    orient_lab = XtCreateManagedWidget("orient_label", labelWidgetClass,
  1477. X                       export_panel, Args, ArgCount);
  1478. X
  1479. X    FirstArg(XtNlabel, orient_items[print_landscape]);
  1480. X    NextArg(XtNfromHoriz, orient_lab);
  1481. X    NextArg(XtNfromVert, mag_text);
  1482. X    NextArg(XtNborderWidth, INTERNAL_BW);
  1483. X    orient_panel = XtCreateManagedWidget("orientation",
  1484. X                         menuButtonWidgetClass,
  1485. X                         export_panel, Args, ArgCount);
  1486. X    orient_menu = make_popup_menu(orient_items, XtNumber(orient_items),
  1487. X                      orient_panel, orient_select);
  1488. X
  1489. X    FirstArg(XtNlabel, "    Justification:");
  1490. X    NextArg(XtNjustify, XtJustifyLeft);
  1491. X    NextArg(XtNborderWidth, 0);
  1492. X    NextArg(XtNfromVert, orient_panel);
  1493. X    just_lab = XtCreateManagedWidget("just_label", labelWidgetClass,
  1494. X                     export_panel, Args, ArgCount);
  1495. X
  1496. X    FirstArg(XtNlabel, just_items[export_flushleft? 1 : 0]);
  1497. X    NextArg(XtNfromHoriz, just_lab);
  1498. X    NextArg(XtNfromVert, orient_panel);
  1499. X    NextArg(XtNborderWidth, INTERNAL_BW);
  1500. X    NextArg(XtNresizable, True);
  1501. X    just_panel = XtCreateManagedWidget("justify",
  1502. X                       menuButtonWidgetClass,
  1503. X                       export_panel, Args, ArgCount);
  1504. X    just_menu = make_popup_menu(just_items, XtNumber(just_items),
  1505. X                    just_panel, just_select);
  1506. X
  1507. X    FirstArg(XtNlabel, "         Language:");
  1508. X    NextArg(XtNjustify, XtJustifyLeft);
  1509. X    NextArg(XtNborderWidth, 0);
  1510. X    NextArg(XtNfromVert, just_panel);
  1511. X    lang_lab = XtCreateManagedWidget("lang_label", labelWidgetClass,
  1512. X                     export_panel, Args, ArgCount);
  1513. X
  1514. X    FirstArg(XtNlabel, lang_texts[cur_exp_lang]);
  1515. X    NextArg(XtNfromHoriz, lang_lab);
  1516. X    NextArg(XtNfromVert, just_panel);
  1517. X    NextArg(XtNborderWidth, INTERNAL_BW);
  1518. X    lang_panel = XtCreateManagedWidget("language",
  1519. X                       menuButtonWidgetClass,
  1520. X                       export_panel, Args, ArgCount);
  1521. X    lang_menu = make_popup_menu(lang_texts, XtNumber(lang_texts),
  1522. X                    lang_panel, lang_select);
  1523. X
  1524. X    FirstArg(XtNlabel, " Default Filename:");
  1525. X    NextArg(XtNfromVert, lang_panel);
  1526. X    NextArg(XtNvertDistance, 15);
  1527. X    NextArg(XtNjustify, XtJustifyLeft);
  1528. X    NextArg(XtNborderWidth, 0);
  1529. X    dfile_lab = XtCreateManagedWidget("def_file_label", labelWidgetClass,
  1530. X                      export_panel, Args, ArgCount);
  1531. X
  1532. X    FirstArg(XtNlabel, default_export_file);
  1533. X    NextArg(XtNfromVert, lang_panel);
  1534. X    NextArg(XtNfromHoriz, dfile_lab);
  1535. X    NextArg(XtNvertDistance, 15);
  1536. X    NextArg(XtNjustify, XtJustifyLeft);
  1537. X    NextArg(XtNborderWidth, 0);
  1538. X    NextArg(XtNwidth, 250);
  1539. X    dfile_text = XtCreateManagedWidget("def_file_name", labelWidgetClass,
  1540. X                       export_panel, Args, ArgCount);
  1541. X
  1542. X    FirstArg(XtNlabel, "  Output Filename:");
  1543. X    NextArg(XtNfromVert, dfile_text);
  1544. X    NextArg(XtNjustify, XtJustifyLeft);
  1545. X    NextArg(XtNborderWidth, 0);
  1546. X    nfile_lab = XtCreateManagedWidget("out_file_name", labelWidgetClass,
  1547. X                      export_panel, Args, ArgCount);
  1548. X
  1549. X    FirstArg(XtNfont, &temp_font);
  1550. X    GetValues(nfile_lab);
  1551. X
  1552. X    FirstArg(XtNwidth, 350);
  1553. X    NextArg(XtNheight, char_height(temp_font) * 2 + 4);
  1554. X    NextArg(XtNfromHoriz, nfile_lab);
  1555. X    NextArg(XtNfromVert, dfile_text);
  1556. X    NextArg(XtNeditType, "edit");
  1557. X    NextArg(XtNborderWidth, INTERNAL_BW);
  1558. X    NextArg(XtNstring, named_file);
  1559. X    NextArg(XtNinsertPosition, strlen(named_file));
  1560. X    NextArg(XtNscrollHorizontal, XawtextScrollWhenNeeded);
  1561. X    exp_selfile = XtCreateManagedWidget("file", asciiTextWidgetClass,
  1562. X                        export_panel, Args, ArgCount);
  1563. X    XtOverrideTranslations(exp_selfile,
  1564. X               XtParseTranslationTable(text_translations));
  1565. X
  1566. X    /* add action to export file for following translation */
  1567. X    XtAppAddActions(tool_app, file_name_actions, XtNumber(file_name_actions));
  1568. X
  1569. X    /* make <return> in the filename window export the file */
  1570. X    XtOverrideTranslations(exp_selfile,
  1571. X               XtParseTranslationTable(file_name_translations));
  1572. X
  1573. X    create_dirinfo(export_panel, exp_selfile, &beside, &below,
  1574. X               &exp_mask, &exp_dir, &exp_flist, &exp_dlist);
  1575. X    /* make <return> in the file list window export the file */
  1576. X    XtOverrideTranslations(exp_flist,
  1577. X               XtParseTranslationTable(file_name_translations));
  1578. X
  1579. X    FirstArg(XtNlabel, "Cancel");
  1580. X    NextArg(XtNfromHoriz, beside);
  1581. X    NextArg(XtNfromVert, below);
  1582. X    NextArg(XtNvertDistance, 15);
  1583. X    NextArg(XtNhorizDistance, 25);
  1584. X    NextArg(XtNheight, 25);
  1585. X    NextArg(XtNborderWidth, INTERNAL_BW);
  1586. X    cancel_but = XtCreateManagedWidget("cancel", commandWidgetClass,
  1587. X                       export_panel, Args, ArgCount);
  1588. X    XtAddEventHandler(cancel_but, ButtonReleaseMask, (Boolean) 0,
  1589. X              (XtEventHandler)export_panel_cancel, (XtPointer) NULL);
  1590. X
  1591. X    FirstArg(XtNlabel, "Export");
  1592. X    NextArg(XtNfromVert, below);
  1593. X    NextArg(XtNfromHoriz, cancel_but);
  1594. X    NextArg(XtNvertDistance, 15);
  1595. X    NextArg(XtNhorizDistance, 25);
  1596. X    NextArg(XtNheight, 25);
  1597. X    NextArg(XtNborderWidth, INTERNAL_BW);
  1598. X    export_but = XtCreateManagedWidget("export", commandWidgetClass,
  1599. X                       export_panel, Args, ArgCount);
  1600. X    XtAddEventHandler(export_but, ButtonReleaseMask, (Boolean) 0,
  1601. X              (XtEventHandler)do_export, (XtPointer) NULL);
  1602. X
  1603. X    XtInstallAccelerators(export_panel, cancel_but);
  1604. X    XtInstallAccelerators(export_panel, export_but);
  1605. X
  1606. X    if (cur_exp_lang == LANG_XBITMAP) {
  1607. X        XtSetSensitive(mag_lab, False);
  1608. X        XtSetSensitive(mag_text, False);
  1609. X        XtSetSensitive(orient_lab, False);
  1610. X        XtSetSensitive(orient_panel, False);
  1611. X    }
  1612. X    if (cur_exp_lang != LANG_PS) {
  1613. X        XtSetSensitive(just_lab, False);
  1614. X        XtSetSensitive(just_panel, False);
  1615. X    }
  1616. X    update_def_filename();
  1617. X}
  1618. X
  1619. Xupdate_def_filename()
  1620. X{
  1621. X    int            i;
  1622. X    DeclareArgs(1);
  1623. X    char       *dval;
  1624. X
  1625. X    (void) strcpy(default_export_file, cur_filename);
  1626. X    if (default_export_file[0] != '\0') {
  1627. X    i = strlen(default_export_file);
  1628. X    if (i >= 4 && strcmp(&default_export_file[i - 4], ".fig") == 0)
  1629. X        default_export_file[i - 4] = '\0';
  1630. X    (void) strcat(default_export_file, ".");
  1631. X    (void) strcat(default_export_file, lang_items[cur_exp_lang]);
  1632. X    }
  1633. X    /* remove trailing blanks */
  1634. X    for (i = strlen(default_export_file) - 1; i >= 0; i--)
  1635. X    if (default_export_file[i] == ' ')
  1636. X        default_export_file[i] = '\0';
  1637. X    else
  1638. X        i = 0;
  1639. X    /* set the current directory from the file popup directory */
  1640. X    if (file_popup) {
  1641. X    FirstArg(XtNstring, &dval);
  1642. X    GetValues(file_dir);
  1643. X    strcpy(export_dir,dval);
  1644. X    }
  1645. X}
  1646. END_OF_FILE
  1647. if test 13679 -ne `wc -c <'w_export.c'`; then
  1648.     echo shar: \"'w_export.c'\" unpacked with wrong size!
  1649. fi
  1650. # end of 'w_export.c'
  1651. fi
  1652. if test -f 'w_modepanel.c' -a "${1}" != "-c" ; then 
  1653.   echo shar: Will not clobber existing file \"'w_modepanel.c'\"
  1654. else
  1655. echo shar: Extracting \"'w_modepanel.c'\" \(13698 characters\)
  1656. sed "s/^X//" >'w_modepanel.c' <<'END_OF_FILE'
  1657. X/*
  1658. X * FIG : Facility for Interactive Generation of figures
  1659. X * Copyright (c) 1991 by Paul King
  1660. X *
  1661. X * "Permission to use, copy, modify, distribute, and sell this software and its
  1662. X * documentation for any purpose is hereby granted without fee, provided that
  1663. X * the above copyright notice appear in all copies and that both the copyright
  1664. X * notice and this permission notice appear in supporting documentation. 
  1665. X * No representations are made about the suitability of this software for 
  1666. X * any purpose.  It is provided "as is" without express or implied warranty."
  1667. X */
  1668. X
  1669. X#include "fig.h"
  1670. X#include "figx.h"
  1671. X#include "resources.h"
  1672. X#include "mode.h"
  1673. X#include "object.h"
  1674. X#include "paintop.h"
  1675. X#include "w_drawprim.h"
  1676. X#include "w_icons.h"
  1677. X#include "w_indpanel.h"
  1678. X#include "w_util.h"
  1679. X#include "w_mousefun.h"
  1680. X#include "w_setup.h"
  1681. X
  1682. Xextern          finish_text_input();
  1683. Xextern          erase_objecthighlight();
  1684. X
  1685. Xextern          circlebyradius_drawing_selected();
  1686. Xextern          circlebydiameter_drawing_selected();
  1687. Xextern          ellipsebyradius_drawing_selected();
  1688. Xextern          ellipsebydiameter_drawing_selected();
  1689. Xextern          box_drawing_selected();
  1690. Xextern          arcbox_drawing_selected();
  1691. Xextern          line_drawing_selected();
  1692. Xextern          regpoly_drawing_selected();
  1693. Xextern          epsobj_drawing_selected();
  1694. Xextern          text_drawing_selected();
  1695. Xextern          arc_drawing_selected();
  1696. Xextern          spline_drawing_selected();
  1697. Xextern          intspline_drawing_selected();
  1698. Xextern          align_selected();
  1699. Xextern          compound_selected();
  1700. Xextern          break_selected();
  1701. Xextern          scale_selected();
  1702. Xextern          point_adding_selected();
  1703. Xextern          delete_point_selected();
  1704. Xextern          move_selected();
  1705. Xextern          move_point_selected();
  1706. Xextern          delete_selected();
  1707. Xextern          copy_selected();
  1708. Xextern          rotate_cw_selected();
  1709. Xextern          rotate_ccw_selected();
  1710. Xextern          flip_ud_selected();
  1711. Xextern          flip_lr_selected();
  1712. Xextern          convert_selected();
  1713. Xextern          arrow_head_selected();
  1714. Xextern          edit_item_selected();
  1715. Xextern          update_selected();
  1716. X
  1717. X/**************        local variables and routines   **************/
  1718. X
  1719. X#define MAX_MODEMSG_LEN 80
  1720. Xtypedef struct mode_switch_struct {
  1721. X    PIXRECT         icon;
  1722. X    int             mode;
  1723. X    int             (*setmode_func) ();
  1724. X    int             objmask;
  1725. X    int             indmask;
  1726. X    char            modemsg[MAX_MODEMSG_LEN];
  1727. X    TOOL            widget;
  1728. X    Pixmap          normalPM, reversePM;
  1729. X}               mode_sw_info;
  1730. X
  1731. X#define        setmode_action(z)    (z->setmode_func)(z)
  1732. X
  1733. XDeclareStaticArgs(13);
  1734. X/* pointer to current mode switch */
  1735. Xstatic mode_sw_info *current = NULL;
  1736. X
  1737. X/* button selection event handler */
  1738. Xstatic void     sel_mode_but();
  1739. Xstatic void     turn_on();
  1740. X
  1741. Xstatic mode_sw_info mode_switches[] = {
  1742. X    {&cirrad_ic, F_CIRCLE_BY_RAD, circlebyradius_drawing_selected, M_NONE,
  1743. X    I_BOX, "CIRCLE drawing: specify RADIUS",},
  1744. X    {&cirdia_ic, F_CIRCLE_BY_DIA, circlebydiameter_drawing_selected, M_NONE,
  1745. X    I_BOX, "CIRCLE drawing: specify DIAMETER",},
  1746. X    {&ellrad_ic, F_ELLIPSE_BY_RAD, ellipsebyradius_drawing_selected, M_NONE,
  1747. X    I_ELLIPSE, "ELLIPSE drawing: specify RADII",},
  1748. X    {&elldia_ic, F_ELLIPSE_BY_DIA, ellipsebydiameter_drawing_selected, M_NONE,
  1749. X    I_ELLIPSE, "ELLIPSE drawing: specify DIAMETERS",},
  1750. X    {&c_spl_ic, F_CLOSED_SPLINE, spline_drawing_selected, M_NONE,
  1751. X    I_CLOSED, "CLOSED SPLINE drawing: specify control points",},
  1752. X    {&spl_ic, F_SPLINE, spline_drawing_selected, M_NONE,
  1753. X    I_OPEN, "SPLINE drawing: specify control points",},
  1754. X    {&c_intspl_ic, F_CLOSED_INTSPLINE, intspline_drawing_selected, M_NONE,
  1755. X    I_CLOSED, "CLOSED INTERPOLATED SPLINE drawing",},
  1756. X    {&intspl_ic, F_INTSPLINE, intspline_drawing_selected, M_NONE,
  1757. X    I_OPEN, "INTERPOLATED SPLINE drawing",},
  1758. X    {&polygon_ic, F_POLYGON, line_drawing_selected, M_NONE,
  1759. X    I_CLOSED, "POLYGON drawing",},
  1760. X    {&line_ic, F_POLYLINE, line_drawing_selected, M_NONE,
  1761. X    I_OPEN, "POLYLINE drawing",},
  1762. X    {&box_ic, F_BOX, box_drawing_selected, M_NONE,
  1763. X    I_BOX, "Rectangular BOX drawing",},
  1764. X    {&arc_box_ic, F_ARC_BOX, arcbox_drawing_selected, M_NONE,
  1765. X    I_ARCBOX, "Rectangular BOX drawing with ROUNDED CORNERS",},
  1766. X    {®poly_ic, F_REGPOLY, regpoly_drawing_selected, M_NONE,
  1767. X    I_REGPOLY, "Regular Polygon",},
  1768. X    {&arc_ic, F_CIRCULAR_ARC, arc_drawing_selected, M_NONE,
  1769. X    I_ARC, "ARC drawing: specify three points on the arc",},
  1770. X    {&epsobj_ic, F_EPSOBJ, epsobj_drawing_selected, M_NONE,
  1771. X    I_EPSOBJ, "Encapsulated Postscript Object",},
  1772. X    {&text_ic, F_TEXT, text_drawing_selected, M_TEXT_NORMAL,
  1773. X    I_TEXT, "TEXT input (from keyboard)",},
  1774. X    {&glue_ic, F_GLUE, compound_selected, M_ALL,
  1775. X    I_MIN2, "GLUE objects into COMPOUND object",},
  1776. X    {&break_ic, F_BREAK, break_selected, M_COMPOUND,
  1777. X    I_MIN1, "BREAK COMPOUND object",},
  1778. X    {&scale_ic, F_SCALE, scale_selected, M_NO_TEXT,
  1779. X    I_MIN2, "SCALE objects",},
  1780. X    {&align_ic, F_ALIGN, align_selected, M_COMPOUND,
  1781. X    I_ALIGN, "ALIGN objects within a COMPOUND or to CANVAS",},
  1782. X    {&movept_ic, F_MOVE_POINT, move_point_selected, M_NO_TEXT,
  1783. X    I_ADDMOVPT, "MOVE POINTs",},
  1784. X    {&move_ic, F_MOVE, move_selected, M_ALL,
  1785. X    I_MIN3, "MOVE objects",},
  1786. X    {&addpt_ic, F_ADD_POINT, point_adding_selected, M_VARPTS_OBJECT,
  1787. X    I_ADDMOVPT, "ADD POINTs (to lines, polygons and splines)",},
  1788. X    {©_ic, F_COPY, copy_selected, M_ALL,
  1789. X    I_MIN3, "COPY objects",},
  1790. X    {&deletept_ic, F_DELETE_POINT, delete_point_selected, M_VARPTS_OBJECT,
  1791. X    I_MIN1, "DELETE POINTs (from lines, polygons and splines)",},
  1792. X    {&delete_ic, F_DELETE, delete_selected, M_ALL,
  1793. X    I_MIN1, "DELETE objects",},
  1794. X    {&update_ic, F_UPDATE, update_selected, M_ALL,
  1795. X    I_OBJECT, "UPDATE object <-> current settings",},
  1796. X    {&change_ic, F_EDIT, edit_item_selected, M_ALL,
  1797. X    I_MIN1, "CHANGE OBJECT via EDIT pane",},
  1798. X    {&flip_x_ic, F_FLIP, flip_ud_selected, M_NO_TEXT,
  1799. X    I_MIN1, "FLIP objects up or down",},
  1800. X    {&flip_y_ic, F_FLIP, flip_lr_selected, M_NO_TEXT,
  1801. X    I_MIN1, "FLIP objects left or right",},
  1802. X    {&rotCW_ic, F_ROTATE, rotate_cw_selected, M_ALL,
  1803. X    I_ROTATE, "ROTATE objects clockwise",},
  1804. X    {&rotCCW_ic, F_ROTATE, rotate_ccw_selected, M_ALL,
  1805. X    I_ROTATE, "ROTATE objects counter-clockwise",},
  1806. X    {&convert_ic, F_CONVERT, convert_selected,
  1807. X    (M_POLYLINE_LINE | M_POLYLINE_POLYGON | M_SPLINE_INTERP), I_MIN1,
  1808. X    "CONVERT lines (polygons) into splines (closed-splines) or vice versa",},
  1809. X    {&autoarrow_ic, F_AUTOARROW, arrow_head_selected, M_OPEN_OBJECT,
  1810. X    I_MIN1 | I_LINEWIDTH, "ADD/DELETE ARROWs",},
  1811. X};
  1812. X
  1813. X#define        NUM_MODE_SW    (sizeof(mode_switches) / sizeof(mode_sw_info))
  1814. X
  1815. Xstatic Arg      button_args[] =
  1816. X{
  1817. X     /* 0 */ {XtNlabel, (XtArgVal) "    "},
  1818. X     /* 1 */ {XtNwidth, (XtArgVal) 0},
  1819. X     /* 2 */ {XtNheight, (XtArgVal) 0},
  1820. X     /* 3 */ {XtNresizable, (XtArgVal) False},
  1821. X     /* 4 */ {XtNborderWidth, (XtArgVal) 0},
  1822. X     /* 5 */ {XtNresize, (XtArgVal) False},    /* keeps buttons from being
  1823. X                         * resized when there are not
  1824. X                         * a multiple of three of
  1825. X                         * them */
  1826. X     /* 6 */ {XtNbackgroundPixmap, (XtArgVal) NULL},
  1827. X};
  1828. X
  1829. Xstatic XtActionsRec mode_actions[] =
  1830. X{
  1831. X    {"EnterModeSw", (XtActionProc) draw_mousefun_mode},
  1832. X    {"LeaveModeSw", (XtActionProc) clear_mousefun},
  1833. X    {"PressMiddle", (XtActionProc) notused_middle},
  1834. X    {"ReleaseMiddle", (XtActionProc) clear_middle},
  1835. X    {"PressRight", (XtActionProc) notused_right},
  1836. X    {"ReleaseRight", (XtActionProc) clear_right},
  1837. X};
  1838. X
  1839. Xstatic String   mode_translations =
  1840. X"<EnterWindow>:EnterModeSw()highlight()\n\
  1841. X    <Btn1Down>:\n\
  1842. X    <Btn1Up>:\n\
  1843. X    <Btn2Down>:PressMiddle()\n\
  1844. X    <Btn2Up>:ReleaseMiddle()\n\
  1845. X    <Btn3Down>:PressRight()\n\
  1846. X    <Btn3Up>:ReleaseRight()\n\
  1847. X    <LeaveWindow>:LeaveModeSw()unhighlight()\n";
  1848. X
  1849. Xint
  1850. Xinit_mode_panel(tool)
  1851. X    TOOL            tool;
  1852. X{
  1853. X    register int    i;
  1854. X    register mode_sw_info *sw;
  1855. X
  1856. X    FirstArg(XtNwidth, MODEPANEL_WD);
  1857. X    NextArg(XtNhSpace, INTERNAL_BW);
  1858. X    NextArg(XtNvSpace, INTERNAL_BW);
  1859. X    NextArg(XtNtop, XtChainTop);
  1860. X    NextArg(XtNbottom, XtChainTop);
  1861. X    NextArg(XtNfromVert, msg_form);
  1862. X    NextArg(XtNvertDistance, -INTERNAL_BW);
  1863. X    NextArg(XtNleft, XtChainLeft);
  1864. X    NextArg(XtNright, XtChainLeft);
  1865. X    NextArg(XtNresizable, False);
  1866. X    NextArg(XtNborderWidth, 0);
  1867. X    NextArg(XtNmappedWhenManaged, False);
  1868. X
  1869. X    mode_panel = XtCreateWidget("mode_panel", boxWidgetClass, tool,
  1870. X                Args, ArgCount);
  1871. X
  1872. X    XtAppAddActions(tool_app, mode_actions, XtNumber(mode_actions));
  1873. X
  1874. X    for (i = 0; i < NUM_MODE_SW; ++i) {
  1875. X    sw = &mode_switches[i];
  1876. X    if (sw->mode == FIRST_DRAW_MODE) {
  1877. X        FirstArg(XtNwidth, MODE_SW_WD * SW_PER_ROW +
  1878. X             INTERNAL_BW * (SW_PER_ROW - 1));
  1879. X        NextArg(XtNborderWidth, 0);
  1880. X        NextArg(XtNresize, False);
  1881. X        NextArg(XtNheight, (MODEPANEL_SPACE + 1) / 2);
  1882. X        NextArg(XtNlabel, "Drawing\n modes");
  1883. X        d_label = XtCreateManagedWidget("label", labelWidgetClass,
  1884. X                        mode_panel, Args, ArgCount);
  1885. X    } else if (sw->mode == FIRST_EDIT_MODE) {
  1886. X        /* assume Args still set up from d_label */
  1887. X        ArgCount -= 2;
  1888. X        NextArg(XtNheight, (MODEPANEL_SPACE) / 2);
  1889. X        NextArg(XtNlabel, "Editing\n modes");
  1890. X        e_label = XtCreateManagedWidget("label", labelWidgetClass,
  1891. X                        mode_panel, Args, ArgCount);
  1892. X    }
  1893. X    button_args[1].value = sw->icon->width;
  1894. X    button_args[2].value = sw->icon->height;
  1895. X    sw->widget = XtCreateManagedWidget("button", commandWidgetClass,
  1896. X                mode_panel, button_args, XtNumber(button_args));
  1897. X
  1898. X    /* left button changes mode */
  1899. X    XtAddEventHandler(sw->widget, ButtonPressMask, (Boolean) 0,
  1900. X              sel_mode_but, (XtPointer) sw);
  1901. X    XtOverrideTranslations(sw->widget,
  1902. X                   XtParseTranslationTable(mode_translations));
  1903. X    }
  1904. X    return;
  1905. X}
  1906. X
  1907. X/*
  1908. X * after panel widget is realized (in main) put some bitmaps etc. in it
  1909. X */
  1910. X
  1911. Xsetup_mode_panel()
  1912. X{
  1913. X    register int    i;
  1914. X    register mode_sw_info *msw;
  1915. X    register Display *d = tool_d;
  1916. X    register Screen *s = tool_s;
  1917. X
  1918. X    blank_gc = XCreateGC(tool_d, XtWindow(mode_panel), (unsigned long) 0, NULL);
  1919. X    button_gc = XCreateGC(tool_d, XtWindow(mode_panel), (unsigned long) 0, NULL);
  1920. X    FirstArg(XtNforeground, &but_fg);
  1921. X    NextArg(XtNbackground, &but_bg);
  1922. X    GetValues(mode_switches[0].widget);
  1923. X
  1924. X    XSetBackground(tool_d, blank_gc, but_bg);
  1925. X    XSetForeground(tool_d, blank_gc, but_bg);
  1926. X
  1927. X    FirstArg(XtNfont, button_font);
  1928. X    SetValues(d_label);
  1929. X    SetValues(e_label);
  1930. X
  1931. X    if (appres.INVERSE) {
  1932. X    FirstArg(XtNbackground, WhitePixelOfScreen(tool_s));
  1933. X    } else {
  1934. X    FirstArg(XtNbackground, BlackPixelOfScreen(tool_s));
  1935. X    }
  1936. X    SetValues(mode_panel);
  1937. X
  1938. X    for (i = 0; i < NUM_MODE_SW; ++i) {
  1939. X    msw = &mode_switches[i];
  1940. X    /* create normal bitmaps */
  1941. X    msw->normalPM = XCreatePixmapFromBitmapData(d, XtWindow(msw->widget),
  1942. X               (char *) msw->icon->data, msw->icon->width, msw->icon->height,
  1943. X                   but_fg, but_bg, DefaultDepthOfScreen(s));
  1944. X
  1945. X    FirstArg(XtNbackgroundPixmap, msw->normalPM);
  1946. X    SetValues(msw->widget);
  1947. X
  1948. X    /* create reverse bitmaps */
  1949. X    msw->reversePM = XCreatePixmapFromBitmapData(d, XtWindow(msw->widget),
  1950. X               (char *) msw->icon->data, msw->icon->width, msw->icon->height,
  1951. X                   but_bg, but_fg, DefaultDepthOfScreen(s));
  1952. X    /* install the accelerators in the buttons */
  1953. X    XtInstallAllAccelerators(msw->widget, tool);
  1954. X    }
  1955. X    /* install the accelerators for the surrounding parts */
  1956. X    XtInstallAllAccelerators(mode_panel, tool);
  1957. X    XtInstallAllAccelerators(d_label, tool);
  1958. X    XtInstallAllAccelerators(e_label, tool);
  1959. X
  1960. X    XDefineCursor(d, XtWindow(mode_panel), arrow_cursor);
  1961. X    FirstArg(XtNmappedWhenManaged, True);
  1962. X    SetValues(mode_panel);
  1963. X}
  1964. X
  1965. X/* come here when a button is pressed in the mode panel */
  1966. X
  1967. Xstatic void
  1968. Xsel_mode_but(widget, closure, event, continue_to_dispatch)
  1969. X    Widget          widget;
  1970. X    XtPointer        closure;
  1971. X    XEvent*        event;
  1972. X    Boolean*        continue_to_dispatch;
  1973. X{
  1974. X    XButtonEvent    xbutton;
  1975. X    mode_sw_info    *msw = (mode_sw_info *) closure;
  1976. X    int             new_objmask;
  1977. X
  1978. X    xbutton = event->xbutton;
  1979. X    if (action_on) {
  1980. X    if (cur_mode == F_TEXT)
  1981. X        finish_text_input();/* finish up any text input */
  1982. X    else {
  1983. X        put_msg("Please finish (or cancel) the current operation before changing modes");
  1984. X        return;
  1985. X    }
  1986. X    } else if (highlighting)
  1987. X    erase_objecthighlight();
  1988. X    if (xbutton.button == Button1) {    /* left button */
  1989. X    turn_off_current();
  1990. X    turn_on(msw);
  1991. X    /* turn off the update boxes if not in update mode */
  1992. X    if (msw->mode != F_UPDATE)
  1993. X        unmanage_update_buts();
  1994. X    update_indpanel(msw->indmask);
  1995. X    put_msg(msw->modemsg);
  1996. X    if ((cur_mode == F_GLUE || cur_mode == F_BREAK) &&
  1997. X        msw->mode != F_GLUE &&
  1998. X        msw->mode != F_BREAK)
  1999. X        /*
  2000. X         * reset tagged items when changing modes, perhaps this is not
  2001. X         * really necessary
  2002. X         */
  2003. X        set_tags(&objects, 0);
  2004. X    cur_mode = msw->mode;
  2005. X    anypointposn = !(msw->indmask & I_POINTPOSN);
  2006. X    new_objmask = msw->objmask;
  2007. X    if (cur_mode == F_ROTATE && cur_rotnangle != 90)
  2008. X        new_objmask = M_ROTATE_ANGLE;
  2009. X    update_markers(new_objmask);
  2010. X    current = msw;
  2011. X    setmode_action(msw);
  2012. X    }
  2013. X}
  2014. X
  2015. Xvoid
  2016. Xforce_positioning()
  2017. X{
  2018. X    update_indpanel(current->indmask | I_POINTPOSN);
  2019. X    anypointposn = 0;
  2020. X}
  2021. X
  2022. Xvoid
  2023. Xforce_nopositioning()
  2024. X{
  2025. X    update_indpanel(current->indmask & ~I_POINTPOSN);
  2026. X    anypointposn = 1;
  2027. X}
  2028. X
  2029. Xvoid
  2030. Xforce_anglegeom()
  2031. X{
  2032. X    update_indpanel(current->indmask | I_ANGLEGEOM);
  2033. X}
  2034. X
  2035. Xvoid
  2036. Xforce_noanglegeom()
  2037. X{
  2038. X    update_indpanel(current->indmask & ~I_ANGLEGEOM);
  2039. X}
  2040. X
  2041. Xstatic void
  2042. Xturn_on(msw)
  2043. X    mode_sw_info   *msw;
  2044. X{
  2045. X    FirstArg(XtNbackgroundPixmap, msw->reversePM);
  2046. X    SetValues(msw->widget);
  2047. X}
  2048. X
  2049. Xturn_on_current()
  2050. X{
  2051. X    if (current)
  2052. X    turn_on(current);
  2053. X}
  2054. X
  2055. Xturn_off_current()
  2056. X{
  2057. X    if (current) {
  2058. X    FirstArg(XtNbackgroundPixmap, current->normalPM);
  2059. X    SetValues(current->widget);
  2060. X    }
  2061. X}
  2062. END_OF_FILE
  2063. if test 13698 -ne `wc -c <'w_modepanel.c'`; then
  2064.     echo shar: \"'w_modepanel.c'\" unpacked with wrong size!
  2065. fi
  2066. # end of 'w_modepanel.c'
  2067. fi
  2068. echo shar: End of archive 11 \(of 27\).
  2069. cp /dev/null ark11isdone
  2070. MISSING=""
  2071. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 ; do
  2072.     if test ! -f ark${I}isdone ; then
  2073.     MISSING="${MISSING} ${I}"
  2074.     fi
  2075. done
  2076. if test "${MISSING}" = "" ; then
  2077.     echo You have unpacked all 27 archives.
  2078.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2079. else
  2080.     echo You still need to unpack the following archives:
  2081.     echo "        " ${MISSING}
  2082. fi
  2083. ##  End of shell archive.
  2084. exit 0
  2085.  
  2086. exit 0 # Just in case...
  2087. -- 
  2088.   // chris@IMD.Sterling.COM       | Send comp.sources.x submissions to:
  2089. \X/  Amiga - The only way to fly! |    sources-x@imd.sterling.com
  2090.  "It's intuitively obvious to the |
  2091.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  2092.