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

  1. Newsgroups: comp.sources.x
  2. From: envbvs@epb9.lbl.gov (Brian V. Smith)
  3. Subject: v19i114:  xfig - Draw amd manipulate objects in an X-Window, Part02/27
  4. Message-ID: <1993May21.021225.4829@sparky.imd.sterling.com>
  5. X-Md4-Signature: e623c7e44416a99c655c9aa7ee78712f
  6. Sender: chris@sparky.imd.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Fri, 21 May 1993 02:12:25 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 114
  13. Archive-name: xfig/part02
  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 2 (of 27)."
  24. # Contents:  Examples/dresser.fig.uu Examples/roundboxes.fig.uu
  25. #   Examples/shades.fig.uu Examples/thermal.fig.uu Imakefile
  26. #   d_arcbox.c d_box.c d_epsobj.c d_regpoly.c d_spline.c e_move.c
  27. #   f_load.c f_util.c fig.icon.X mode.c u_error.c u_translate.c
  28. #   w_cursor.c w_icons.h w_indpanel.h w_setup.c
  29. # Wrapped by envbvs@epb9.lbl.gov.lbl.gov on Mon May  3 12:05:44 1993
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f 'Examples/dresser.fig.uu' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'Examples/dresser.fig.uu'\"
  33. else
  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`S
  66. XM-"`Q,C0@,S0@,3(T(#<T(#DY.3D@.3DY.0HR(#0@,"`Q("TQ(#$@,"`U(#`N
  67. XM,#`P(#,@,"`P"@D@,3(V(#,T(#(R,B`S-"`R,C(@,C0R(#$R-B`R-#(@,3(V
  68. XM(#,T(#DY.3D@.3DY.0HR(#0@,"`Q("TQ(#$@,"`U(#`N,#`P(#,@,"`P"@D@
  69. XM,S@Y(#<T(#(R-"`W-"`R,C0@,S0@,S@Y(#,T(#,X.2`W-"`Y.3DY(#DY.3D*
  70. XM,B`T(#`@,2`M,2`Q(#`@-2`P+C`P,"`S(#`@,`H)(#,X.2`Q,38@,C(T(#$Q
  71. XM-B`R,C0@-S8@,S@Y(#<V(#,X.2`Q,38@.3DY.2`Y.3DY"C(@-"`P(#$@+3$@
  72. XM,2`P(#4@,"XP,#`@,R`P(#`*"2`S.#D@,34X(#(R-"`Q-3@@,C(T(#$Q."`S
  73. XM.#D@,3$X(#,X.2`Q-3@@.3DY.2`Y.3DY"C(@-"`P(#$@+3$@,2`P(#4@,"XP
  74. XM,#`@,R`P(#`*"2`S.#D@,C`P(#(R-"`R,#`@,C(T(#$V,"`S.#D@,38P(#,X
  75. XM.2`R,#`@.3DY.2`Y.3DY"C(@-"`P(#$@+3$@,2`P(#4@,"XP,#`@,R`P(#`*
  76. XM"2`S.#D@,C0R(#(R-"`R-#(@,C(T(#(P,B`S.#D@,C`R(#,X.2`R-#(@.3DY
  77. X'.2`Y.3DY"C0R
  78. X`
  79. Xend
  80. END_OF_FILE
  81. if test 2522 -ne `wc -c <'Examples/dresser.fig.uu'`; then
  82.     echo shar: \"'Examples/dresser.fig.uu'\" unpacked with wrong size!
  83. fi
  84. # end of 'Examples/dresser.fig.uu'
  85. fi
  86. if test -f 'Examples/roundboxes.fig.uu' -a "${1}" != "-c" ; then 
  87.   echo shar: Will not clobber existing file \"'Examples/roundboxes.fig.uu'\"
  88. else
  89. echo shar: Extracting \"'Examples/roundboxes.fig.uu'\" \(3397 characters\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P(#`*
  136. XM"2`R,SD@,CDY(#(S.2`T,3D@,S4Y(#0Q.2`S-3D@,CDY(#(S.2`R.3D@.3DY
  137. XM.2`Y.3DY"C(@-"`P(#$@+3$@,"`P(#<@,"XP,#`@,3(@,"`P"@D@,S4T(#0Q
  138. XM-"`S-30@-#8T(#0P-"`T-C0@-#`T(#0Q-"`S-30@-#$T(#DY.3D@.3DY.0HR
  139. XM(#0@,"`Q("TQ(#`@,"`P(#`N,#`P(#$P(#`@,`H)(#(S.2`T,C0@,C,Y(#0U
  140. XM-"`S-#D@-#4T(#,T.2`T,C0@,C,Y(#0R-"`Y.3DY(#DY.3D*,B`T(#`@,2`M
  141. XM,2`P(#`@,"`P+C`P,"`Q,"`P(#`*"2`S-C0@,CDY(#,V-"`T,#D@,SDT(#0P
  142. XM.2`S.30@,CDY(#,V-"`R.3D@.3DY.2`Y.3DY"C(@-"`P(#$@+3$@,"`P(#`@
  143. XM,"XP,#`@,3`@,"`P"@D@-#`Y(#0R-"`T,#D@-#4T(#4Q.2`T-30@-3$Y(#0R
  144. XM-"`T,#D@-#(T(#DY.3D@.3DY.0HR(#0@,"`Q("TQ(#`@,"`P(#`N,#`P(#$P
  145. XM(#`@,`H)(#,V-"`T-CD@,S8T(#4W.2`S.30@-3<Y(#,Y-"`T-CD@,S8T(#0V
  146. X,.2`Y.3DY(#DY.3D*
  147. X`
  148. Xend
  149. END_OF_FILE
  150. if test 3397 -ne `wc -c <'Examples/roundboxes.fig.uu'`; then
  151.     echo shar: \"'Examples/roundboxes.fig.uu'\" unpacked with wrong size!
  152. fi
  153. # end of 'Examples/roundboxes.fig.uu'
  154. fi
  155. if test -f 'Examples/shades.fig.uu' -a "${1}" != "-c" ; then 
  156.   echo shar: Will not clobber existing file \"'Examples/shades.fig.uu'\"
  157. else
  158. echo shar: Extracting \"'Examples/shades.fig.uu'\" \(2425 characters\)
  159. sed "s/^X//" >'Examples/shades.fig.uu' <<'END_OF_FILE'
  160. Xbegin 444 shades.fig
  161.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,2`P(#`@-"`P+C`P,"`P(#`@,`H)(#4T-"`W.2`U-S`@-SD@
  192. XM-3<P(#(S.2`U-#0@,C,Y(#4T-"`W.2`Y.3DY(#DY.3D*,B`R(#`@,2`M,2`P
  193. XM(#`@,R`P+C`P,"`P(#`@,`H)(#4Y-R`W.2`U-S`@-SD@-3<P(#(S.2`U.3<@
  194. XM,C,Y(#4Y-R`W.2`Y.3DY(#DY.3D*,B`R(#`@,2`M,2`P(#`@,B`P+C`P,"`P
  195. XM(#`@,`H)(#4Y-R`W.2`V,C4@-SD@-C(U(#(S.2`U.3<@,C,Y(#4Y-R`W.2`Y
  196. XM.3DY(#DY.3D*,B`R(#`@,2`M,2`P(#`@,2`P+C`P,"`P(#`@,`H)(#8U,B`W
  197. XM.2`V,C4@-SD@-C(U(#(S.2`V-3(@,C,Y(#8U,B`W.2`Y.3DY(#DY.3D*,B`R
  198. XM(#`@,2`M,2`P(#`@,"`P+C`P,"`P(#`@,`H)(#8U,B`W.2`V-SD@-SD@-C<Y
  199. X>(#(S.2`V-3(@,C,Y(#8U,B`W.2`Y.3DY(#DY.3D*
  200. X`
  201. Xend
  202. END_OF_FILE
  203. if test 2425 -ne `wc -c <'Examples/shades.fig.uu'`; then
  204.     echo shar: \"'Examples/shades.fig.uu'\" unpacked with wrong size!
  205. fi
  206. # end of 'Examples/shades.fig.uu'
  207. fi
  208. if test -f 'Examples/thermal.fig.uu' -a "${1}" != "-c" ; then 
  209.   echo shar: Will not clobber existing file \"'Examples/thermal.fig.uu'\"
  210. else
  211. echo shar: Extracting \"'Examples/thermal.fig.uu'\" \(3088 characters\)
  212. sed "s/^X//" >'Examples/thermal.fig.uu' <<'END_OF_FILE'
  213. Xbegin 444 thermal.fig
  214. XM(T9)1R`R+C$*.#`@,@HQ(#,@,"`Q("TQ(#`@,"`R,2`P+C`P,"`Q(#`N,#`P
  215. XM(#,T-"`Q-CD@-2`U(#,T-"`Q-CD@,S0Y(#$V.0HQ(#,@,"`Q("TQ(#`@,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B`P("TQ
  261. XM(#`@,"XP,#`@-"`Y(#<@,C4Y(#$X.2!0`0HT(#`@,"`Q,B`P("TQ(#`@,"XP
  262. XM,#`@-"`V(#8@,3@U(#$Y-2!A`0HT(#`@,"`Q,B`P("TQ(#`@,"XP,#`@-"`Y
  263. X.(#<@,3<Y(#$X.2!0`0HY
  264. X`
  265. Xend
  266. END_OF_FILE
  267. if test 3088 -ne `wc -c <'Examples/thermal.fig.uu'`; then
  268.     echo shar: \"'Examples/thermal.fig.uu'\" unpacked with wrong size!
  269. fi
  270. # end of 'Examples/thermal.fig.uu'
  271. fi
  272. if test -f 'Imakefile' -a "${1}" != "-c" ; then 
  273.   echo shar: Will not clobber existing file \"'Imakefile'\"
  274. else
  275. echo shar: Extracting \"'Imakefile'\" \(3259 characters\)
  276. sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
  277. X#ifdef InstallManPage
  278. X#undef InstallManPage
  279. X#endif
  280. X#define InstallManPage(file,dest)                                       @@\
  281. XInstallManPageLong(Doc/file,dest,file)
  282. X
  283. X# Uncomment the following if needed for DECstations running older X11R4 
  284. X#INCROOT=/usr/include/mit
  285. X
  286. XSYS_LIBRARIES=         -lm
  287. XDEPLIBS =         XawClientDepLibs
  288. X# use the following if NOT using DPS
  289. XLOCAL_LIBRARIES =     XawClientLibs
  290. X# use the following if using DPS, *** and add -DDPS to the DEFINES line ***
  291. X#LOCAL_LIBRARIES =     -ldps XawClientLibs
  292. X# use (and change) the following if you want the multi-key data base file
  293. X# somewhere other than the standard X11 library directory
  294. X#XFIGLIBDIR =        /usr/local/lib/X11/xfig
  295. X# use this if you want the multi-key data base file in the standard X11 tree
  296. XXFIGLIBDIR =        $(LIBDIR)/xfig
  297. XDIR_DEFS=        -DXFIGLIBDIR=\"$(XFIGLIBDIR)\"
  298. X#if (defined(VaxArchitecture) && !defined(UltrixArchitecture)) || \
  299. X    (defined(RtArchitecture) && !defined(AIXArchitecture)) || \
  300. X    defined(titan) || \
  301. X    (defined(SunOSPlatform) && (OSMinorVersion==0))
  302. XSTRSTRDEFINES = -DNOSTRSTR
  303. X#endif
  304. X# remove -DGSBIT from the DEFINES if you DON'T want to have gs (ghostscript)
  305. X# generate a preview bitmap.  If you do use ghostscript you will need 
  306. X# version 2.4 or later.
  307. XDEFINES =             $(STRSTRDEFINES) -DGSBIT
  308. X
  309. XXFIGSRC =    d_arc.c d_arcbox.c d_box.c d_ellipse.c d_epsobj.c \
  310. X        d_intspline.c d_line.c d_regpoly.c d_spline.c d_text.c \
  311. X        e_addpt.c e_align.c e_arrow.c e_break.c \
  312. X        e_convert.c e_copy.c e_delete.c e_deletept.c \
  313. X        e_edit.c e_flip.c e_glue.c e_move.c \
  314. X        e_movept.c e_rotate.c e_scale.c e_update.c \
  315. X        f_load.c f_read.c f_epsobj.c \
  316. X        f_readold.c f_save.c f_util.c f_xbitmap.c \
  317. X        main.c mode.c object.c resources.c \
  318. X        u_bound.c u_create.c u_drag.c u_draw.c \
  319. X        u_elastic.c u_error.c u_fonts.c u_free.c u_geom.c \
  320. X        u_list.c u_markers.c u_pan.c u_print.c \
  321. X        u_redraw.c u_search.c u_translate.c u_undo.c \
  322. X        w_canvas.c w_cmdpanel.c w_cursor.c w_dir.c w_drawprim.c \
  323. X        w_export.c w_file.c w_fontbits.c w_fontpanel.c w_grid.c \
  324. X        w_icons.c w_indpanel.c w_modepanel.c w_mousefun.c w_msgpanel.c \
  325. X        w_print.c w_rottext.c w_rulers.c w_setup.c w_util.c w_zoom.c
  326. X
  327. XXFIGOBJ =    d_arc.o d_arcbox.o d_box.o d_ellipse.o d_epsobj.o \
  328. X        d_intspline.o d_line.o d_regpoly.o d_spline.o d_text.o \
  329. X        e_addpt.o e_align.o e_arrow.o e_break.o \
  330. X        e_convert.o e_copy.o e_delete.o e_deletept.o \
  331. X        e_edit.o e_flip.o e_glue.o e_move.o \
  332. X        e_movept.o e_rotate.o e_scale.o e_update.o \
  333. X        f_load.o f_read.o f_epsobj.o \
  334. X        f_readold.o f_save.o f_util.o f_xbitmap.o \
  335. X        main.o mode.o object.o resources.o \
  336. X        u_bound.o u_create.o u_drag.o u_draw.o \
  337. X        u_elastic.o u_error.o u_fonts.o u_free.o u_geom.o \
  338. X        u_list.o u_markers.o u_pan.o u_print.o \
  339. X        u_redraw.o u_search.o u_translate.o u_undo.o \
  340. X        w_canvas.o w_cmdpanel.o w_cursor.o w_dir.o w_drawprim.o \
  341. X        w_export.o w_file.o w_fontbits.o w_fontpanel.o w_grid.o \
  342. X        w_icons.o w_indpanel.o w_modepanel.o w_mousefun.o w_msgpanel.o \
  343. X        w_print.o w_rottext.o w_rulers.o w_setup.o w_util.o w_zoom.o
  344. X
  345. XSRCS = $(XFIGSRC)
  346. XOBJS = $(XFIGOBJ)
  347. X
  348. XComplexProgramTarget(xfig)
  349. XMakeDirectories(install,$(XFIGLIBDIR))
  350. XInstallNonExec(CompKeyDB,$(XFIGLIBDIR))
  351. XInstallAppDefaults(Fig)
  352. XInstallAppDefaults(Fig-color)
  353. XSpecialObjectRule(w_canvas.o, $(ICONFIGFILES), $(DIR_DEFS))
  354. END_OF_FILE
  355. if test 3259 -ne `wc -c <'Imakefile'`; then
  356.     echo shar: \"'Imakefile'\" unpacked with wrong size!
  357. fi
  358. # end of 'Imakefile'
  359. fi
  360. if test -f 'd_arcbox.c' -a "${1}" != "-c" ; then 
  361.   echo shar: Will not clobber existing file \"'d_arcbox.c'\"
  362. else
  363. echo shar: Extracting \"'d_arcbox.c'\" \(2849 characters\)
  364. sed "s/^X//" >'d_arcbox.c' <<'END_OF_FILE'
  365. X/*
  366. X * FIG : Facility for Interactive Generation of figures
  367. X * Copyright (c) 1985 by Supoj Sutanthavibul
  368. X *
  369. X * "Permission to use, copy, modify, distribute, and sell this software and its
  370. X * documentation for any purpose is hereby granted without fee, provided that
  371. X * the above copyright notice appear in all copies and that both the copyright
  372. X * notice and this permission notice appear in supporting documentation. 
  373. X * No representations are made about the suitability of this software for 
  374. X * any purpose.  It is provided "as is" without express or implied warranty."
  375. X */
  376. X
  377. X#include "fig.h"
  378. X#include "resources.h"
  379. X#include "mode.h"
  380. X#include "object.h"
  381. X#include "paintop.h"
  382. X#include "u_create.h"
  383. X#include "u_elastic.h"
  384. X#include "u_list.h"
  385. X#include "w_canvas.h"
  386. X#include "w_mousefun.h"
  387. X
  388. X/*************************** local procedures *********************/
  389. X
  390. Xstatic int    create_arc_boxobject(), cancel_arc_boxobject();
  391. Xstatic int    init_arc_box_drawing();
  392. X
  393. Xarcbox_drawing_selected()
  394. X{
  395. X    set_mousefun("corner point", "", "");
  396. X    canvas_kbd_proc = null_proc;
  397. X    canvas_locmove_proc = null_proc;
  398. X    canvas_leftbut_proc = init_arc_box_drawing;
  399. X    canvas_middlebut_proc = null_proc;
  400. X    canvas_rightbut_proc = null_proc;
  401. X    set_cursor(arrow_cursor);
  402. X    reset_action_on();
  403. X}
  404. X
  405. Xstatic
  406. Xinit_arc_box_drawing(x, y)
  407. X    int            x, y;
  408. X{
  409. X    cur_x = fix_x = x;
  410. X    cur_y = fix_y = y;
  411. X    set_mousefun("final point", "", "cancel");
  412. X    draw_mousefun_canvas();
  413. X    canvas_locmove_proc = resizing_box;
  414. X    canvas_leftbut_proc = create_arc_boxobject;
  415. X    canvas_middlebut_proc = null_proc;
  416. X    canvas_rightbut_proc = cancel_arc_boxobject;
  417. X    elastic_box(fix_x, fix_y, cur_x, cur_y);
  418. X    set_temp_cursor(null_cursor);
  419. X    set_action_on();
  420. X}
  421. X
  422. Xstatic
  423. Xcancel_arc_boxobject()
  424. X{
  425. X    elastic_box(fix_x, fix_y, cur_x, cur_y);
  426. X    arcbox_drawing_selected();
  427. X    draw_mousefun_canvas();
  428. X}
  429. X
  430. Xstatic
  431. Xcreate_arc_boxobject(x, y)
  432. X    int            x, y;
  433. X{
  434. X    F_line       *box;
  435. X    F_point       *point;
  436. X
  437. X    elastic_box(fix_x, fix_y, cur_x, cur_y);
  438. X
  439. X    if ((point = create_point()) == NULL)
  440. X    return;
  441. X
  442. X    point->x = x;
  443. X    point->y = y;
  444. X    point->next = NULL;
  445. X
  446. X    if ((box = create_line()) == NULL) {
  447. X    free((char *) point);
  448. X    return;
  449. X    }
  450. X    box->type = T_ARC_BOX;
  451. X    box->style = cur_linestyle;
  452. X    box->thickness = cur_linewidth;
  453. X    box->color = cur_color;
  454. X    box->depth = cur_depth;
  455. X    box->pen = 0;
  456. X    box->fill_style = cur_fillstyle;
  457. X    /* multiply     dash length by line thickness */
  458. X    box->style_val = cur_styleval * (cur_linewidth + 1) / 2;
  459. X    box->radius = cur_boxradius;/* corner radius */
  460. X    box->points = point;
  461. X    append_point(x, fix_y, &point);
  462. X    append_point(fix_x, fix_y, &point);
  463. X    append_point(fix_x, y, &point);
  464. X    append_point(x, y, &point);
  465. X    draw_line(box, PAINT);
  466. X    add_line(box);
  467. X    arcbox_drawing_selected();
  468. X    draw_mousefun_canvas();
  469. X}
  470. END_OF_FILE
  471. if test 2849 -ne `wc -c <'d_arcbox.c'`; then
  472.     echo shar: \"'d_arcbox.c'\" unpacked with wrong size!
  473. fi
  474. # end of 'd_arcbox.c'
  475. fi
  476. if test -f 'd_box.c' -a "${1}" != "-c" ; then 
  477.   echo shar: Will not clobber existing file \"'d_box.c'\"
  478. else
  479. echo shar: Extracting \"'d_box.c'\" \(2733 characters\)
  480. sed "s/^X//" >'d_box.c' <<'END_OF_FILE'
  481. X/*
  482. X * FIG : Facility for Interactive Generation of figures
  483. X * Copyright (c) 1985 by Supoj Sutanthavibul
  484. X *
  485. X * "Permission to use, copy, modify, distribute, and sell this software and its
  486. X * documentation for any purpose is hereby granted without fee, provided that
  487. X * the above copyright notice appear in all copies and that both the copyright
  488. X * notice and this permission notice appear in supporting documentation. 
  489. X * No representations are made about the suitability of this software for 
  490. X * any purpose.  It is provided "as is" without express or implied warranty."
  491. X */
  492. X
  493. X#include "fig.h"
  494. X#include "resources.h"
  495. X#include "mode.h"
  496. X#include "object.h"
  497. X#include "paintop.h"
  498. X#include "u_create.h"
  499. X#include "u_elastic.h"
  500. X#include "u_list.h"
  501. X#include "w_canvas.h"
  502. X#include "w_mousefun.h"
  503. X
  504. X/*************************** local declarations *********************/
  505. X
  506. Xint        init_box_drawing();
  507. Xstatic        create_boxobject(), cancel_box();
  508. X
  509. Xbox_drawing_selected()
  510. X{
  511. X    set_mousefun("corner point", "", "");
  512. X    canvas_kbd_proc = null_proc;
  513. X    canvas_locmove_proc = null_proc;
  514. X    canvas_leftbut_proc = init_box_drawing;
  515. X    canvas_middlebut_proc = null_proc;
  516. X    canvas_rightbut_proc = null_proc;
  517. X    set_cursor(arrow_cursor);
  518. X    reset_action_on();
  519. X}
  520. X
  521. Xinit_box_drawing(x, y)
  522. X    int            x, y;
  523. X{
  524. X    cur_x = fix_x = x;
  525. X    cur_y = fix_y = y;
  526. X    set_mousefun("final point", "", "cancel");
  527. X    draw_mousefun_canvas();
  528. X    canvas_locmove_proc = resizing_box;
  529. X    canvas_leftbut_proc = create_boxobject;
  530. X    canvas_middlebut_proc = null_proc;
  531. X    canvas_rightbut_proc = cancel_box;
  532. X    elastic_box(fix_x, fix_y, cur_x, cur_y);
  533. X    set_temp_cursor(null_cursor);
  534. X    set_action_on();
  535. X}
  536. X
  537. Xstatic
  538. Xcancel_box()
  539. X{
  540. X    elastic_box(fix_x, fix_y, cur_x, cur_y);
  541. X    box_drawing_selected();
  542. X    draw_mousefun_canvas();
  543. X}
  544. X
  545. Xstatic
  546. Xcreate_boxobject(x, y)
  547. X    int            x, y;
  548. X{
  549. X    F_line       *box;
  550. X    F_point       *point;
  551. X
  552. X    elastic_box(fix_x, fix_y, cur_x, cur_y);
  553. X
  554. X    if ((point = create_point()) == NULL)
  555. X    return;
  556. X
  557. X    point->x = x;
  558. X    point->y = y;
  559. X    point->next = NULL;
  560. X
  561. X    if ((box = create_line()) == NULL) {
  562. X    free((char *) point);
  563. X    return;
  564. X    }
  565. X    box->type = T_BOX;
  566. X    box->style = cur_linestyle;
  567. X    box->thickness = cur_linewidth;
  568. X    box->color = cur_color;
  569. X    box->depth = cur_depth;
  570. X    box->pen = 0;
  571. X    box->fill_style = cur_fillstyle;
  572. X    /* scale dash length by line thickness */
  573. X    box->style_val = cur_styleval * (cur_linewidth + 1) / 2;
  574. X    box->radius = 0;
  575. X    box->points = point;
  576. X    append_point(x, fix_y, &point);
  577. X    append_point(fix_x, fix_y, &point);
  578. X    append_point(fix_x, y, &point);
  579. X    append_point(x, y, &point);
  580. X    draw_line(box, PAINT);
  581. X    add_line(box);
  582. X    box_drawing_selected();
  583. X    draw_mousefun_canvas();
  584. X}
  585. END_OF_FILE
  586. if test 2733 -ne `wc -c <'d_box.c'`; then
  587.     echo shar: \"'d_box.c'\" unpacked with wrong size!
  588. fi
  589. # end of 'd_box.c'
  590. fi
  591. if test -f 'd_epsobj.c' -a "${1}" != "-c" ; then 
  592.   echo shar: Will not clobber existing file \"'d_epsobj.c'\"
  593. else
  594. echo shar: Extracting \"'d_epsobj.c'\" \(2918 characters\)
  595. sed "s/^X//" >'d_epsobj.c' <<'END_OF_FILE'
  596. X/*
  597. X * FIG : Facility for Interactive Generation of figures
  598. X * Copyright (c) 1985 by Supoj Sutanthavibul
  599. X *
  600. X * "Permission to use, copy, modify, distribute, and sell this software and its
  601. X * documentation for any purpose is hereby granted without fee, provided that
  602. X * the above copyright notice appear in all copies and that both the copyright
  603. X * notice and this permission notice appear in supporting documentation. 
  604. X * No representations are made about the suitability of this software for 
  605. X * any purpose.  It is provided "as is" without express or implied warranty."
  606. X */
  607. X
  608. X#include "fig.h"
  609. X#include "resources.h"
  610. X#include "mode.h"
  611. X#include "object.h"
  612. X#include "paintop.h"
  613. X#include "u_create.h"
  614. X#include "u_elastic.h"
  615. X#include "u_list.h"
  616. X#include "w_canvas.h"
  617. X#include "w_mousefun.h"
  618. X
  619. X/*************************** local declarations *********************/
  620. X
  621. Xstatic
  622. X        init_epsobj_drawing(), create_epsobj(),
  623. X        cancel_epsobj();
  624. X
  625. Xepsobj_drawing_selected()
  626. X{
  627. X    set_mousefun("corner point", "", "");
  628. X    canvas_kbd_proc = null_proc;
  629. X    canvas_locmove_proc = null_proc;
  630. X    canvas_leftbut_proc = init_epsobj_drawing;
  631. X    canvas_middlebut_proc = null_proc;
  632. X    canvas_rightbut_proc = null_proc;
  633. X    set_cursor(arrow_cursor);
  634. X    reset_action_on();
  635. X}
  636. X
  637. Xstatic
  638. Xinit_epsobj_drawing(x, y)
  639. X    int            x, y;
  640. X{
  641. X    init_box_drawing(x, y);
  642. X    canvas_leftbut_proc = create_epsobj;
  643. X    canvas_rightbut_proc = cancel_epsobj;
  644. X}
  645. X
  646. Xstatic
  647. Xcancel_epsobj()
  648. X{
  649. X    elastic_box(fix_x, fix_y, cur_x, cur_y);
  650. X    epsobj_drawing_selected();
  651. X    draw_mousefun_canvas();
  652. X}
  653. X
  654. Xstatic
  655. Xcreate_epsobj(x, y)
  656. X    int            x, y;
  657. X{
  658. X    F_line       *box;
  659. X    F_point       *point;
  660. X
  661. X    elastic_box(fix_x, fix_y, cur_x, cur_y);
  662. X
  663. X    if ((point = create_point()) == NULL)
  664. X    return;
  665. X
  666. X    point->x = fix_x;
  667. X    point->y = fix_y;
  668. X    point->next = NULL;
  669. X
  670. X    if ((box = create_line()) == NULL) {
  671. X    free((char *) point);
  672. X    return;
  673. X    }
  674. X    box->type = T_EPS_BOX;
  675. X    box->style = SOLID_LINE;
  676. X    box->thickness = 1;
  677. X    box->color = cur_color;
  678. X    box->depth = cur_depth;
  679. X    box->pen = 0;
  680. X    box->fill_style = 0;
  681. X    box->style_val = 0;
  682. X    box->radius = 0;
  683. X
  684. X    if ((box->eps = create_eps()) == NULL) {
  685. X    free((char *) point);
  686. X    free((char *) box);
  687. X    return;
  688. X    }
  689. X    box->eps->file[0] = '\0';
  690. X    box->eps->bitmap = NULL;
  691. X    box->eps->bit_size.x = 0;
  692. X    box->eps->bit_size.y = 0;
  693. X    box->eps->flipped = 0;
  694. X    box->eps->hw_ratio = 0.0;
  695. X    box->eps->pixmap = 0;
  696. X    box->eps->pix_width = 0;
  697. X    box->eps->pix_height = 0;
  698. X    box->eps->pix_rotation = 0;
  699. X    box->eps->pix_flipped = 0;
  700. X
  701. X    box->points = point;
  702. X    append_point(fix_x, y, &point);
  703. X    append_point(x, y, &point);
  704. X    append_point(x, fix_y, &point);
  705. X    append_point(fix_x, fix_y, &point);
  706. X    draw_line(box, PAINT);
  707. X    add_line(box);
  708. X    put_msg("Please enter name of EPS file in EDIT window");
  709. X    edit_item((char *) box, O_POLYLINE);
  710. X    epsobj_drawing_selected();
  711. X    draw_mousefun_canvas();
  712. X}
  713. END_OF_FILE
  714. if test 2918 -ne `wc -c <'d_epsobj.c'`; then
  715.     echo shar: \"'d_epsobj.c'\" unpacked with wrong size!
  716. fi
  717. # end of 'd_epsobj.c'
  718. fi
  719. if test -f 'd_regpoly.c' -a "${1}" != "-c" ; then 
  720.   echo shar: Will not clobber existing file \"'d_regpoly.c'\"
  721. else
  722. echo shar: Extracting \"'d_regpoly.c'\" \(3401 characters\)
  723. sed "s/^X//" >'d_regpoly.c' <<'END_OF_FILE'
  724. X/*
  725. X * FIG : Facility for Interactive Generation of figures
  726. X * Copyright (c) 1985 by Supoj Sutanthavibul
  727. X *
  728. X * "Permission to use, copy, modify, distribute, and sell this software and its
  729. X * documentation for any purpose is hereby granted without fee, provided that
  730. X * the above copyright notice appear in all copies and that both the copyright
  731. X * notice and this permission notice appear in supporting documentation. 
  732. X * No representations are made about the suitability of this software for 
  733. X * any purpose.  It is provided "as is" without express or implied warranty."
  734. X */
  735. X
  736. X#include "fig.h"
  737. X#include "resources.h"
  738. X#include "mode.h"
  739. X#include "object.h"
  740. X#include "paintop.h"
  741. X#include "u_create.h"
  742. X#include "u_elastic.h"
  743. X#include "u_list.h"
  744. X#include "w_canvas.h"
  745. X#include "w_mousefun.h"
  746. X
  747. Xextern float    compute_angle();
  748. X
  749. X/*************************** local declarations *********************/
  750. X
  751. Xstatic        init_regpoly_drawing(), create_regpoly(), cancel_regpoly();
  752. X
  753. Xregpoly_drawing_selected()
  754. X{
  755. X    set_mousefun("center point", "", "");
  756. X    canvas_kbd_proc = null_proc;
  757. X    canvas_locmove_proc = null_proc;
  758. X    canvas_leftbut_proc = init_regpoly_drawing;
  759. X    canvas_middlebut_proc = null_proc;
  760. X    canvas_rightbut_proc = null_proc;
  761. X    set_cursor(arrow_cursor);
  762. X    reset_action_on();
  763. X}
  764. X
  765. Xstatic
  766. Xinit_regpoly_drawing(x, y)
  767. X    int            x, y;
  768. X{
  769. X    cur_x = fix_x = x;
  770. X    cur_y = fix_y = y;
  771. X    work_numsides = cur_numsides;
  772. X    set_mousefun("final point", "", "cancel");
  773. X    draw_mousefun_canvas();
  774. X    canvas_locmove_proc = resizing_poly;
  775. X    canvas_leftbut_proc = create_regpoly;
  776. X    canvas_middlebut_proc = null_proc;
  777. X    canvas_rightbut_proc = cancel_regpoly;
  778. X    elastic_poly(fix_x, fix_y, cur_x, cur_y, work_numsides);
  779. X    set_temp_cursor(null_cursor);
  780. X    set_action_on();
  781. X}
  782. X
  783. Xstatic
  784. Xcancel_regpoly()
  785. X{
  786. X    elastic_poly(fix_x, fix_y, cur_x, cur_y, work_numsides);
  787. X    regpoly_drawing_selected();
  788. X    draw_mousefun_canvas();
  789. X}
  790. X
  791. Xstatic
  792. Xcreate_regpoly(x, y)
  793. X    int            x, y;
  794. X{
  795. X    register float  angle;
  796. X    register int    nx, ny, dx, dy, i;
  797. X    float        init_angle, mag;
  798. X    F_line       *poly;
  799. X    F_point       *point;
  800. X
  801. X    elastic_poly(fix_x, fix_y, cur_x, cur_y, work_numsides);
  802. X    if (fix_x == x && fix_y == y)
  803. X    return;            /* 0 size */
  804. X
  805. X    if ((point = create_point()) == NULL)
  806. X    return;
  807. X
  808. X    point->x = x;
  809. X    point->y = y;
  810. X    point->next = NULL;
  811. X
  812. X    if ((poly = create_line()) == NULL) {
  813. X    free((char *) point);
  814. X    return;
  815. X    }
  816. X    poly->type = T_POLYGON;
  817. X    poly->style = cur_linestyle;
  818. X    poly->thickness = cur_linewidth;
  819. X    poly->color = cur_color;
  820. X    poly->depth = cur_depth;
  821. X    poly->pen = 0;
  822. X    poly->fill_style = cur_fillstyle;
  823. X    /* scale dash length by line thickness */
  824. X    poly->style_val = cur_styleval * (cur_linewidth + 1) / 2;
  825. X    poly->radius = 0;
  826. X    poly->points = point;
  827. X
  828. X    dx = x - fix_x;
  829. X    dy = y - fix_y;
  830. X    mag = sqrt((double) (dx * dx + dy * dy));
  831. X    init_angle = compute_angle((float) dx, (float) dy);
  832. X
  833. X    /* now append cur_numsides points */
  834. X    for (i = 1; i < cur_numsides; i++) {
  835. X    angle = init_angle - M_2PI * (float) i / (float) cur_numsides;
  836. X    if (angle < 0)
  837. X        angle += M_2PI;
  838. X    nx = fix_x + round(mag * cos((double) angle));
  839. X    ny = fix_y + round(mag * sin((double) angle));
  840. X    append_point(nx, ny, &point);
  841. X    }
  842. X    append_point(x, y, &point);
  843. X
  844. X    draw_line(poly, PAINT);
  845. X    add_line(poly);
  846. X    regpoly_drawing_selected();
  847. X    draw_mousefun_canvas();
  848. X}
  849. END_OF_FILE
  850. if test 3401 -ne `wc -c <'d_regpoly.c'`; then
  851.     echo shar: \"'d_regpoly.c'\" unpacked with wrong size!
  852. fi
  853. # end of 'd_regpoly.c'
  854. fi
  855. if test -f 'd_spline.c' -a "${1}" != "-c" ; then 
  856.   echo shar: Will not clobber existing file \"'d_spline.c'\"
  857. else
  858. echo shar: Extracting \"'d_spline.c'\" \(3213 characters\)
  859. sed "s/^X//" >'d_spline.c' <<'END_OF_FILE'
  860. X/*
  861. X * FIG : Facility for Interactive Generation of figures
  862. X * Copyright (c) 1985 by Supoj Sutanthavibul
  863. X *
  864. X * "Permission to use, copy, modify, distribute, and sell this software and its
  865. X * documentation for any purpose is hereby granted without fee, provided that
  866. X * the above copyright notice appear in all copies and that both the copyright
  867. X * notice and this permission notice appear in supporting documentation. 
  868. X * No representations are made about the suitability of this software for 
  869. X * any purpose.  It is provided "as is" without express or implied warranty."
  870. X */
  871. X
  872. X#include "fig.h"
  873. X#include "resources.h"
  874. X#include "mode.h"
  875. X#include "object.h"
  876. X#include "paintop.h"
  877. X#include "u_create.h"
  878. X#include "u_elastic.h"
  879. X#include "u_list.h"
  880. X#include "w_canvas.h"
  881. X#include "w_mousefun.h"
  882. X
  883. Xstatic int    create_splineobject();
  884. Xstatic int    init_spline_drawing();
  885. X
  886. Xspline_drawing_selected()
  887. X{
  888. X    set_mousefun("first point", "", "");
  889. X    canvas_kbd_proc = null_proc;
  890. X    canvas_locmove_proc = null_proc;
  891. X    canvas_leftbut_proc = init_spline_drawing;
  892. X    canvas_middlebut_proc = null_proc;
  893. X    canvas_rightbut_proc = null_proc;
  894. X    set_cursor(arrow_cursor);
  895. X    reset_action_on();
  896. X}
  897. X
  898. Xstatic
  899. Xinit_spline_drawing(x, y)
  900. X    int            x, y;
  901. X{
  902. X    if (cur_mode == F_CLOSED_SPLINE) {
  903. X    min_num_points = 3;
  904. X    init_trace_drawing(x, y);
  905. X    canvas_middlebut_save = create_splineobject;
  906. X    } else {
  907. X    min_num_points = 2;
  908. X    init_trace_drawing(x, y);
  909. X    canvas_middlebut_proc = create_splineobject;
  910. X    }
  911. X    return_proc = spline_drawing_selected;
  912. X}
  913. X
  914. Xstatic
  915. Xcreate_splineobject(x, y)
  916. X    int            x, y;
  917. X{
  918. X    F_spline       *spline;
  919. X
  920. X    if (x != fix_x || y != fix_y || num_point < min_num_points) {
  921. X    get_intermediatepoint(x, y);
  922. X    }
  923. X    elastic_line();
  924. X    if ((spline = create_spline()) == NULL)
  925. X    return;
  926. X
  927. X    spline->style = cur_linestyle;
  928. X    spline->thickness = cur_linewidth;
  929. X    spline->style_val = cur_styleval * (cur_linewidth + 1) / 2;
  930. X    spline->color = cur_color;
  931. X    spline->depth = cur_depth;
  932. X    spline->pen = 0;
  933. X    spline->fill_style = cur_fillstyle;
  934. X    /*
  935. X     * The current fill style is saved in all spline objects (but support for
  936. X     * filling may not be available in all fig2dev languages).
  937. X     */
  938. X    spline->points = first_point;
  939. X    spline->controls = NULL;
  940. X    spline->next = NULL;
  941. X    /* initialise for no arrows - updated below if necessary */
  942. X    spline->for_arrow = NULL;
  943. X    spline->back_arrow = NULL;
  944. X    cur_x = cur_y = fix_x = fix_y = 0;    /* used in elastic_moveline */
  945. X    elastic_moveline(spline->points);    /* erase control vector */
  946. X    if (cur_mode == F_CLOSED_SPLINE) {
  947. X    spline->type = T_CLOSED_NORMAL;
  948. X    num_point++;
  949. X    append_point(first_point->x, first_point->y, &cur_point);
  950. X    draw_closed_spline(spline, PAINT);
  951. X    } else {            /* It must be F_SPLINE */
  952. X    if (autoforwardarrow_mode)
  953. X        spline->for_arrow = forward_arrow();
  954. X    if (autobackwardarrow_mode)
  955. X        spline->back_arrow = backward_arrow();
  956. X    spline->type = T_OPEN_NORMAL;
  957. X    draw_open_spline(spline, PAINT);
  958. X    }
  959. X    if (appres.DEBUG) {
  960. X    int        xmin, ymin, xmax, ymax;
  961. X
  962. X    spline_bound(spline, &xmin, &ymin, &xmax, &ymax);
  963. X    elastic_box(xmin, ymin, xmax, ymax);
  964. X    }
  965. X    add_spline(spline);
  966. X    spline_drawing_selected();
  967. X    draw_mousefun_canvas();
  968. X}
  969. END_OF_FILE
  970. if test 3213 -ne `wc -c <'d_spline.c'`; then
  971.     echo shar: \"'d_spline.c'\" unpacked with wrong size!
  972. fi
  973. # end of 'd_spline.c'
  974. fi
  975. if test -f 'e_move.c' -a "${1}" != "-c" ; then 
  976.   echo shar: Will not clobber existing file \"'e_move.c'\"
  977. else
  978. echo shar: Extracting \"'e_move.c'\" \(3428 characters\)
  979. sed "s/^X//" >'e_move.c' <<'END_OF_FILE'
  980. X/*
  981. X * FIG : Facility for Interactive Generation of figures
  982. X * Copyright (c) 1985 by Supoj Sutanthavibul
  983. X *
  984. X * "Permission to use, copy, modify, distribute, and sell this software and its
  985. X * documentation for any purpose is hereby granted without fee, provided that
  986. X * the above copyright notice appear in all copies and that both the copyright
  987. X * notice and this permission notice appear in supporting documentation. 
  988. X * No representations are made about the suitability of this software for 
  989. X * any purpose.  It is provided "as is" without express or implied warranty."
  990. X */
  991. X
  992. X#include "fig.h"
  993. X#include "resources.h"
  994. X#include "object.h"
  995. X#include "paintop.h"
  996. X#include "u_draw.h"
  997. X#include "u_elastic.h"
  998. X#include "u_list.h"
  999. X#include "u_search.h"
  1000. X#include "w_canvas.h"
  1001. X#include "w_mousefun.h"
  1002. X
  1003. Xstatic        init_move(), init_arb_move(), init_constrained_move();
  1004. X
  1005. Xmove_selected()
  1006. X{
  1007. X    set_mousefun("move object", "horiz/vert move", "");
  1008. X    canvas_kbd_proc = null_proc;
  1009. X    canvas_locmove_proc = null_proc;
  1010. X    init_searchproc_left(init_arb_move);
  1011. X    init_searchproc_middle(init_constrained_move);
  1012. X    canvas_leftbut_proc = object_search_left;
  1013. X    canvas_middlebut_proc = object_search_middle;
  1014. X    canvas_rightbut_proc = null_proc;
  1015. X    return_proc = move_selected;
  1016. X    set_cursor(pick9_cursor);
  1017. X    reset_action_on();
  1018. X}
  1019. X
  1020. Xstatic
  1021. Xinit_arb_move(p, type, x, y, px, py)
  1022. X    char       *p;
  1023. X    int            type;
  1024. X    int            x, y, px, py;
  1025. X{
  1026. X    constrained = MOVE_ARB;
  1027. X    init_move(p, type, x, y, px, py);
  1028. X    canvas_middlebut_proc = null_proc;
  1029. X    set_mousefun("place object", "", "cancel");
  1030. X    draw_mousefun_canvas();
  1031. X}
  1032. X
  1033. Xstatic
  1034. Xinit_constrained_move(p, type, x, y, px, py)
  1035. X    char       *p;
  1036. X    int            type;
  1037. X    int            x, y, px, py;
  1038. X{
  1039. X    constrained = MOVE_HORIZ_VERT;
  1040. X    init_move(p, type, x, y, px, py);
  1041. X    canvas_middlebut_proc = canvas_leftbut_proc;
  1042. X    canvas_leftbut_proc = null_proc;
  1043. X    set_mousefun("", "place object", "cancel");
  1044. X    draw_mousefun_canvas();
  1045. X}
  1046. X
  1047. Xstatic
  1048. Xinit_move(p, type, x, y, px, py)
  1049. X    char       *p;
  1050. X    int            type;
  1051. X    int            x, y, px, py;
  1052. X{
  1053. X    switch (type) {
  1054. X    case O_COMPOUND:
  1055. X    set_temp_cursor(wait_cursor);
  1056. X    cur_c = (F_compound *) p;
  1057. X    list_delete_compound(&objects.compounds, cur_c);
  1058. X    redisplay_compound(cur_c);
  1059. X    set_temp_cursor(null_cursor);
  1060. X    init_compounddragging(cur_c, px, py);
  1061. X    break;
  1062. X    case O_POLYLINE:
  1063. X    set_temp_cursor(wait_cursor);
  1064. X    cur_l = (F_line *) p;
  1065. X    list_delete_line(&objects.lines, cur_l);
  1066. X    redisplay_line(cur_l);
  1067. X    set_temp_cursor(null_cursor);
  1068. X    init_linedragging(cur_l, px, py);
  1069. X    break;
  1070. X    case O_TEXT:
  1071. X    set_temp_cursor(wait_cursor);
  1072. X    cur_t = (F_text *) p;
  1073. X    list_delete_text(&objects.texts, cur_t);
  1074. X    redisplay_text(cur_t);
  1075. X    set_temp_cursor(null_cursor);
  1076. X    init_textdragging(cur_t, x, y);
  1077. X    break;
  1078. X    case O_ELLIPSE:
  1079. X    set_temp_cursor(wait_cursor);
  1080. X    cur_e = (F_ellipse *) p;
  1081. X    list_delete_ellipse(&objects.ellipses, cur_e);
  1082. X    redisplay_ellipse(cur_e);
  1083. X    set_temp_cursor(null_cursor);
  1084. X    init_ellipsedragging(cur_e, px, py);
  1085. X    break;
  1086. X    case O_ARC:
  1087. X    set_temp_cursor(wait_cursor);
  1088. X    cur_a = (F_arc *) p;
  1089. X    list_delete_arc(&objects.arcs, cur_a);
  1090. X    redisplay_arc(cur_a);
  1091. X    set_temp_cursor(null_cursor);
  1092. X    init_arcdragging(cur_a, px, py);
  1093. X    break;
  1094. X    case O_SPLINE:
  1095. X    set_temp_cursor(wait_cursor);
  1096. X    cur_s = (F_spline *) p;
  1097. X    list_delete_spline(&objects.splines, cur_s);
  1098. X    redisplay_spline(cur_s);
  1099. X    set_temp_cursor(null_cursor);
  1100. X    init_splinedragging(cur_s, px, py);
  1101. X    break;
  1102. X    default:
  1103. X    return;
  1104. X    }
  1105. X}
  1106. END_OF_FILE
  1107. if test 3428 -ne `wc -c <'e_move.c'`; then
  1108.     echo shar: \"'e_move.c'\" unpacked with wrong size!
  1109. fi
  1110. # end of 'e_move.c'
  1111. fi
  1112. if test -f 'f_load.c' -a "${1}" != "-c" ; then 
  1113.   echo shar: Will not clobber existing file \"'f_load.c'\"
  1114. else
  1115. echo shar: Extracting \"'f_load.c'\" \(2557 characters\)
  1116. sed "s/^X//" >'f_load.c' <<'END_OF_FILE'
  1117. X/*
  1118. X * FIG : Facility for Interactive Generation of figures
  1119. X * Copyright (c) 1985 by Supoj Sutanthavibul
  1120. X *
  1121. X * "Permission to use, copy, modify, distribute, and sell this software and its
  1122. X * documentation for any purpose is hereby granted without fee, provided that
  1123. X * the above copyright notice appear in all copies and that both the copyright
  1124. X * notice and this permission notice appear in supporting documentation. 
  1125. X * No representations are made about the suitability of this software for 
  1126. X * any purpose.  It is provided "as is" without express or implied warranty."
  1127. X */
  1128. X
  1129. X#include "fig.h"
  1130. X#include "resources.h"
  1131. X#include "mode.h"
  1132. X#include "object.h"
  1133. X#include "u_undo.h"
  1134. X#include "w_setup.h"
  1135. X
  1136. Xextern int    num_object;
  1137. X
  1138. Xint
  1139. Xload_file(file)
  1140. X    char       *file;
  1141. X{
  1142. X    int            s;
  1143. X    F_compound        c;
  1144. X
  1145. X    c.arcs = NULL;
  1146. X    c.compounds = NULL;
  1147. X    c.ellipses = NULL;
  1148. X    c.lines = NULL;
  1149. X    c.splines = NULL;
  1150. X    c.texts = NULL;
  1151. X    c.next = NULL;
  1152. X    set_temp_cursor(wait_cursor);
  1153. X    s = read_fig(file, &c);
  1154. X    if (s == 0) {        /* Successful read */
  1155. X    clean_up();
  1156. X    (void) strcpy(save_filename, cur_filename);
  1157. X    update_cur_filename(file);
  1158. X    saved_objects = objects;
  1159. X    objects = c;
  1160. X    redisplay_canvas();
  1161. X    put_msg("Current figure \"%s\" (%d objects)", file, num_object);
  1162. X    set_action(F_LOAD);
  1163. X    reset_cursor();
  1164. X    reset_modifiedflag();
  1165. X    return (0);
  1166. X    } else if (s == ENOENT) {
  1167. X    clean_up();
  1168. X    saved_objects = objects;
  1169. X    objects = c;
  1170. X    redisplay_canvas();
  1171. X    put_msg("Current figure \"%s\" (new file)", file);
  1172. X    (void) strcpy(save_filename, cur_filename);
  1173. X    update_cur_filename(file);
  1174. X    set_action(F_LOAD);
  1175. X    reset_cursor();
  1176. X    reset_modifiedflag();
  1177. X    return (0);
  1178. X    }
  1179. X    read_fail_message(file, s);
  1180. X    reset_modifiedflag();
  1181. X    reset_cursor();
  1182. X    return (1);
  1183. X}
  1184. X
  1185. Xint
  1186. Xmerge_file(file)
  1187. X    char       *file;
  1188. X{
  1189. X    F_compound        c;
  1190. X    int            s;
  1191. X
  1192. X    c.arcs = NULL;
  1193. X    c.compounds = NULL;
  1194. X    c.ellipses = NULL;
  1195. X    c.lines = NULL;
  1196. X    c.splines = NULL;
  1197. X    c.texts = NULL;
  1198. X    c.next = NULL;
  1199. X    set_temp_cursor(wait_cursor);
  1200. X
  1201. X    s = read_fig(file, &c);
  1202. X    if (s == 0) {        /* Successful read */
  1203. X    int        xmin, ymin, xmax, ymax;
  1204. X
  1205. X    compound_bound(&c, &xmin, &ymin, &xmax, &ymax);
  1206. X    clean_up();
  1207. X    saved_objects = c;
  1208. X    tail(&objects, &object_tails);
  1209. X    append_objects(&objects, &saved_objects, &object_tails);
  1210. X    redisplay_zoomed_region(xmin, ymin, xmax, ymax);
  1211. X    put_msg("%d object(s) read from \"%s\"", num_object, file);
  1212. X    set_action_object(F_ADD, O_ALL_OBJECT);
  1213. X    reset_cursor();
  1214. X    set_modifiedflag();
  1215. X    return (0);
  1216. X    }
  1217. X    read_fail_message(file, s);
  1218. X    reset_cursor();
  1219. X    return (1);
  1220. X}
  1221. END_OF_FILE
  1222. if test 2557 -ne `wc -c <'f_load.c'`; then
  1223.     echo shar: \"'f_load.c'\" unpacked with wrong size!
  1224. fi
  1225. # end of 'f_load.c'
  1226. fi
  1227. if test -f 'f_util.c' -a "${1}" != "-c" ; then 
  1228.   echo shar: Will not clobber existing file \"'f_util.c'\"
  1229. else
  1230. echo shar: Extracting \"'f_util.c'\" \(3434 characters\)
  1231. sed "s/^X//" >'f_util.c' <<'END_OF_FILE'
  1232. X/*
  1233. X * FIG : Facility for Interactive Generation of figures
  1234. X * Copyright (c) 1985 by Supoj Sutanthavibul
  1235. X *
  1236. X * "Permission to use, copy, modify, distribute, and sell this software and its
  1237. X * documentation for any purpose is hereby granted without fee, provided that
  1238. X * the above copyright notice appear in all copies and that both the copyright
  1239. X * notice and this permission notice appear in supporting documentation. 
  1240. X * No representations are made about the suitability of this software for 
  1241. X * any purpose.  It is provided "as is" without express or implied warranty."
  1242. X */
  1243. X
  1244. X#include "fig.h"
  1245. X#include "resources.h"
  1246. X#include "object.h"
  1247. X#include "mode.h"
  1248. X#include "w_util.h"
  1249. X
  1250. Xint
  1251. Xemptyname(name)
  1252. X    char        name[];
  1253. X
  1254. X{
  1255. X    if (*name == '\0') {
  1256. X    return (1);
  1257. X    } else {
  1258. X    return (0);
  1259. X    }
  1260. X}
  1261. X
  1262. Xint
  1263. Xemptyname_msg(name, msg)
  1264. X    char        name[], msg[];
  1265. X
  1266. X{
  1267. X    int            returnval;
  1268. X
  1269. X    if (returnval = emptyname(name))
  1270. X    put_msg("No file name specified, %s command ignored", msg);
  1271. X    return (returnval);
  1272. X}
  1273. X
  1274. Xint
  1275. Xemptyfigure()
  1276. X{
  1277. X    if (objects.texts != NULL)
  1278. X    return (0);
  1279. X    if (objects.lines != NULL)
  1280. X    return (0);
  1281. X    if (objects.ellipses != NULL)
  1282. X    return (0);
  1283. X    if (objects.splines != NULL)
  1284. X    return (0);
  1285. X    if (objects.arcs != NULL)
  1286. X    return (0);
  1287. X    if (objects.compounds != NULL)
  1288. X    return (0);
  1289. X    return (1);
  1290. X}
  1291. X
  1292. Xint
  1293. Xemptyfigure_msg(msg)
  1294. X    char        msg[];
  1295. X
  1296. X{
  1297. X    int            returnval;
  1298. X
  1299. X    if (returnval = emptyfigure())
  1300. X    put_msg("Empty figure, %s command ignored", msg);
  1301. X    return (returnval);
  1302. X}
  1303. X
  1304. Xint
  1305. Xchange_directory(path)
  1306. X    char       *path;
  1307. X{
  1308. X    if (path == NULL) {
  1309. X    *cur_dir = '\0';
  1310. X    return (0);
  1311. X    }
  1312. X    if (chdir(path) == -1) {
  1313. X    put_msg("Can't go to directory %s, : %s", path, sys_errlist[errno]);
  1314. X    return (1);
  1315. X    }
  1316. X    if (get_directory(cur_dir)) /* get cwd */
  1317. X    return (0);
  1318. X    else
  1319. X    return (1);
  1320. X}
  1321. X
  1322. Xget_directory(direct)
  1323. X    char       *direct;
  1324. X{
  1325. X#if defined(SYSV) || defined(SVR4)
  1326. X    extern char       *getcwd();
  1327. X
  1328. X#else
  1329. X    extern char       *getwd();
  1330. X
  1331. X#endif
  1332. X
  1333. X#if defined(SYSV) || defined(SVR4)
  1334. X    if (getcwd(direct, 1024) == NULL) {    /* get current working dir */
  1335. X    put_msg("Can't get current directory");
  1336. X#else
  1337. X    if (getwd(direct) == NULL) {/* get current working dir */
  1338. X    put_msg("%s", direct);    /* err msg is in directory */
  1339. X#endif
  1340. X    *direct = '\0';
  1341. X    return NULL;
  1342. X    }
  1343. X    return 1;
  1344. X}
  1345. X
  1346. X#ifndef S_IWUSR
  1347. X#define S_IWUSR 0000200
  1348. X#endif
  1349. X#ifndef S_IWGRP
  1350. X#define S_IWGRP 0000020
  1351. X#endif
  1352. X#ifndef S_IWOTH
  1353. X#define S_IWOTH 0000002
  1354. X#endif
  1355. X
  1356. Xint
  1357. Xok_to_write(file_name, op_name)
  1358. X    char       *file_name, *op_name;
  1359. X{
  1360. X    struct stat        file_status;
  1361. X    char        string[180];
  1362. X
  1363. X    if (stat(file_name, &file_status) == 0) {    /* file exists */
  1364. X    if (file_status.st_mode & S_IFDIR) {
  1365. X        put_msg("\"%s\" is a directory", file_name);
  1366. X        return (0);
  1367. X    }
  1368. X    if (file_status.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)) {
  1369. X        /* writing is permitted by SOMEONE */
  1370. X        if (access(file_name, W_OK)) {
  1371. X        put_msg("Write permission for \"%s\" is denied", file_name);
  1372. X        return (0);
  1373. X        } else {
  1374. X        if (warnexist) {
  1375. X            sprintf(string, "\"%s\" already exists.\nDo you want to overwrite it?", file_name);
  1376. X            if (!popup_query(QUERY_YES, string)) {
  1377. X            put_msg("%s cancelled", op_name);
  1378. X            return (0);
  1379. X            }
  1380. X        }
  1381. X        /* !warnexist */
  1382. X        else {
  1383. X            return(1);
  1384. X        }
  1385. X        }
  1386. X    } else {
  1387. X        put_msg("\"%s\" is read only", file_name);
  1388. X        return (0);
  1389. X    }
  1390. X    } else {
  1391. X    if (errno != ENOENT)
  1392. X        return (0);        /* file does exist but stat fails */
  1393. X    }
  1394. X
  1395. X    return (1);
  1396. X}
  1397. END_OF_FILE
  1398. if test 3434 -ne `wc -c <'f_util.c'`; then
  1399.     echo shar: \"'f_util.c'\" unpacked with wrong size!
  1400. fi
  1401. # end of 'f_util.c'
  1402. fi
  1403. if test -f 'fig.icon.X' -a "${1}" != "-c" ; then 
  1404.   echo shar: Will not clobber existing file \"'fig.icon.X'\"
  1405. else
  1406. echo shar: Extracting \"'fig.icon.X'\" \(3323 characters\)
  1407. sed "s/^X//" >'fig.icon.X' <<'END_OF_FILE'
  1408. X#define fig_width 64
  1409. X#define fig_height 64
  1410. X#define fig_x_hot -1
  1411. X#define fig_y_hot -1
  1412. Xstatic unsigned char fig_bits[] = {
  1413. X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
  1414. X   0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x80,
  1415. X   0x01, 0x7f, 0x8e, 0x0f, 0x00, 0x60, 0x03, 0x80, 0x01, 0x42, 0x44, 0x08,
  1416. X   0x00, 0x10, 0x04, 0x80, 0x01, 0x12, 0x44, 0x00, 0x00, 0x18, 0x08, 0x80,
  1417. X   0x01, 0x1e, 0x44, 0x1e, 0x00, 0x04, 0x08, 0x80, 0x01, 0x12, 0x44, 0x08,
  1418. X   0x00, 0x04, 0x10, 0x80, 0x01, 0x02, 0x44, 0x08, 0x00, 0x03, 0x10, 0x80,
  1419. X   0x01, 0x02, 0x44, 0x0c, 0x00, 0x01, 0x10, 0x80, 0x01, 0x07, 0x8e, 0x0b,
  1420. X   0x80, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x00, 0x08, 0x83,
  1421. X   0x01, 0x00, 0x00, 0x00, 0x40, 0x00, 0x88, 0x8c, 0x61, 0x00, 0x00, 0x00,
  1422. X   0x40, 0x00, 0x48, 0xf0, 0x81, 0x07, 0x00, 0x00, 0x40, 0x40, 0x38, 0xc0,
  1423. X   0x01, 0x78, 0x00, 0x00, 0x38, 0x20, 0x00, 0x80, 0x01, 0x80, 0x07, 0xfc,
  1424. X   0x47, 0x20, 0x00, 0x80, 0xe1, 0x00, 0xf8, 0x03, 0x40, 0x10, 0x00, 0x81,
  1425. X   0x01, 0x0f, 0x00, 0x00, 0x0e, 0x0c, 0xd0, 0x80, 0x01, 0xf0, 0xe0, 0xe0,
  1426. X   0x87, 0x00, 0x06, 0x80, 0x01, 0x00, 0xbf, 0xff, 0x40, 0xf1, 0x00, 0x80,
  1427. X   0x01, 0x00, 0x90, 0x38, 0xa0, 0x06, 0x00, 0x80, 0x01, 0x00, 0x58, 0x08,
  1428. X   0x80, 0x08, 0x00, 0x80, 0x01, 0x00, 0x48, 0x08, 0x18, 0x11, 0x00, 0x80,
  1429. X   0x01, 0x00, 0x4c, 0x08, 0x04, 0x21, 0xe0, 0x83, 0x01, 0x00, 0x22, 0x04,
  1430. X   0x03, 0x41, 0x10, 0x82, 0x01, 0x00, 0x21, 0x02, 0x00, 0x01, 0x10, 0x84,
  1431. X   0x01, 0x00, 0x11, 0x01, 0x00, 0x81, 0xe1, 0xe4, 0x01, 0x80, 0x90, 0x00,
  1432. X   0x1c, 0x00, 0x01, 0x99, 0x01, 0x80, 0x90, 0x80, 0x23, 0x01, 0x02, 0x82,
  1433. X   0x01, 0x40, 0x90, 0x81, 0x38, 0x01, 0x02, 0x82, 0x01, 0x20, 0x10, 0x7f,
  1434. X   0x04, 0x01, 0x04, 0x84, 0x01, 0x10, 0x20, 0x00, 0x82, 0x00, 0x04, 0x84,
  1435. X   0x01, 0x08, 0x20, 0x80, 0x81, 0x00, 0x00, 0x88, 0x01, 0x08, 0x40, 0x40,
  1436. X   0x80, 0x00, 0x08, 0x90, 0x01, 0x04, 0x40, 0x40, 0x40, 0x00, 0x00, 0x90,
  1437. X   0x01, 0x02, 0x80, 0x40, 0x20, 0x0c, 0x10, 0x90, 0x01, 0x01, 0x80, 0x20,
  1438. X   0x10, 0x12, 0x10, 0xa0, 0x01, 0x01, 0x00, 0x21, 0x00, 0x11, 0x10, 0xa0,
  1439. X   0x81, 0x20, 0x00, 0x31, 0x00, 0x09, 0x10, 0xa0, 0x81, 0x10, 0x00, 0x12,
  1440. X   0x00, 0x09, 0x00, 0xa0, 0x41, 0x00, 0x00, 0x12, 0x00, 0x05, 0x20, 0xa0,
  1441. X   0x41, 0x08, 0x00, 0x12, 0x80, 0x04, 0x00, 0xa0, 0x21, 0x00, 0x00, 0x12,
  1442. X   0x40, 0x04, 0x20, 0xa0, 0x21, 0x04, 0x00, 0x14, 0x20, 0x04, 0x20, 0xa0,
  1443. X   0x11, 0x00, 0x00, 0x24, 0x18, 0x04, 0x00, 0xa0, 0x11, 0x04, 0x00, 0xc4,
  1444. X   0x07, 0x04, 0x00, 0xa0, 0x11, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x90,
  1445. X   0x09, 0x04, 0x00, 0x08, 0x00, 0x04, 0x00, 0x90, 0x09, 0x00, 0x00, 0x08,
  1446. X   0x00, 0x04, 0x00, 0x98, 0x09, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x88,
  1447. X   0x11, 0x00, 0x00, 0x08, 0x00, 0x18, 0x00, 0x88, 0x11, 0x00, 0x00, 0x08,
  1448. X   0x00, 0x10, 0x00, 0x84, 0x11, 0x00, 0x00, 0x04, 0x00, 0x20, 0x00, 0x86,
  1449. X   0x11, 0xe0, 0x00, 0x04, 0x00, 0x60, 0x00, 0x81, 0x21, 0x20, 0x01, 0x02,
  1450. X   0x00, 0x80, 0x81, 0x80, 0x21, 0xc0, 0x00, 0x01, 0x00, 0x00, 0xc1, 0x80,
  1451. X   0x41, 0x00, 0x80, 0x00, 0x00, 0x00, 0x62, 0x80, 0x81, 0x00, 0xc0, 0x00,
  1452. X   0x00, 0x00, 0x1c, 0x80, 0x01, 0x01, 0x70, 0x00, 0x00, 0x00, 0x00, 0x80,
  1453. X   0x01, 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0xf8, 0x01, 0x00,
  1454. X   0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
  1455. X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
  1456. END_OF_FILE
  1457. if test 3323 -ne `wc -c <'fig.icon.X'`; then
  1458.     echo shar: \"'fig.icon.X'\" unpacked with wrong size!
  1459. fi
  1460. # end of 'fig.icon.X'
  1461. fi
  1462. if test -f 'mode.c' -a "${1}" != "-c" ; then 
  1463.   echo shar: Will not clobber existing file \"'mode.c'\"
  1464. else
  1465. echo shar: Extracting \"'mode.c'\" \(3545 characters\)
  1466. sed "s/^X//" >'mode.c' <<'END_OF_FILE'
  1467. X/*
  1468. X * FIG : Facility for Interactive Generation of figures
  1469. X * Copyright (c) 1985 by Supoj Sutanthavibul
  1470. X *
  1471. X * "Permission to use, copy, modify, distribute, and sell this software and its
  1472. X * documentation for any purpose is hereby granted without fee, provided that
  1473. X * the above copyright notice appear in all copies and that both the copyright
  1474. X * notice and this permission notice appear in supporting documentation. 
  1475. X * No representations are made about the suitability of this software for 
  1476. X * any purpose.  It is provided "as is" without express or implied warranty."
  1477. X */
  1478. X
  1479. X#include "fig.h"
  1480. X#include "mode.h"
  1481. X#include "resources.h"
  1482. X#include "object.h"
  1483. X#include "w_indpanel.h"
  1484. X
  1485. Xint        cur_mode = F_NULL;
  1486. Xint        cur_halign = NONE;
  1487. Xint        cur_valign = NONE;
  1488. Xint        manhattan_mode = 0;
  1489. Xint        mountain_mode = 0;
  1490. Xint        latexline_mode = 0;
  1491. Xint        latexarrow_mode = 0;
  1492. Xint        autoforwardarrow_mode = 0;
  1493. Xint        autobackwardarrow_mode = 0;
  1494. Xint        cur_gridmode = GRID_0;
  1495. Xint        cur_pointposn = P_MAGNET;
  1496. Xint        posn_rnd[P_GRID2 + 1];
  1497. Xint        posn_hlf[P_GRID2 + 1];
  1498. Xint        grid_fine[P_GRID2 + 1];
  1499. Xint        grid_coarse[P_GRID2 + 1];
  1500. Xchar           *grid_name[P_GRID2 + 1];
  1501. Xint        cur_rotnangle = 90;
  1502. Xint        cur_linkmode = 0;
  1503. Xint        cur_numsides = 6;
  1504. Xint        action_on = 0;
  1505. Xint        highlighting = 0;
  1506. Xint        aborting = 0;
  1507. Xint        anypointposn = 0;
  1508. Xint        figure_modified = 0;
  1509. Xchar        cur_fig_units[32];
  1510. XBoolean        warnexist = True;
  1511. X
  1512. X/**********************     global mode variables    ************************/
  1513. X
  1514. Xint        num_point;
  1515. Xint        min_num_points;
  1516. X
  1517. X/***************************  Export Settings  ****************************/
  1518. X
  1519. XBoolean        export_flushleft;    /* flush left (true) or center (false) */
  1520. X
  1521. X/***************************  Print Settings  ****************************/
  1522. X
  1523. Xint        print_landscape = 0;    /* def. orientation for printer */
  1524. XBoolean        print_flushleft;    /* flush left (true) or center (false) */
  1525. Xint        cur_exp_lang = LANG_EPS; /* actually gets set up in main.c */
  1526. XBoolean        batch_exists = False;
  1527. Xchar        batch_file[32];
  1528. X
  1529. Xchar           *lang_items[] = {
  1530. X    "box",     "latex",  "epic", "eepic", "eepicemu",
  1531. X    "pictex",  "ibmgl",  "eps",  "ps",    "pstex", 
  1532. X    "pstex_t", "textyl", "tpic", "pic",   "xbm"};
  1533. X
  1534. Xchar           *lang_texts[] = {
  1535. X    "LaTeX box (figure boundary)    ",
  1536. X    "LaTeX picture                  ",
  1537. X    "LaTeX picture + epic macros    ",
  1538. X    "LaTeX picture + eepic macros   ",
  1539. X    "LaTeX picture + eepicemu macros",
  1540. X    "PiCTeX macros                  ",
  1541. X    "IBMGL (or HPGL)                ",
  1542. X    "Encapsulated Postscript        ",
  1543. X    "Postscript                     ",
  1544. X    "Combined PS/LaTeX (PS part)    ",
  1545. X    "Combined PS/LaTeX (LaTeX part) ",
  1546. X    "Textyl \\special commands       ",
  1547. X    "TPIC                           ",
  1548. X    "PIC                            ",
  1549. X    "X11 Bitmap                     "};
  1550. X
  1551. X/***************************  Mode Settings  ****************************/
  1552. X
  1553. Xint        cur_objmask = M_NONE;
  1554. Xint        cur_updatemask = I_UPDATEMASK;
  1555. Xint        cur_depth = 0;
  1556. X
  1557. X/***************************  Text Settings  ****************************/
  1558. X
  1559. Xint        hidden_text_length;
  1560. Xfloat        cur_textstep = 1.2;
  1561. X
  1562. X/***************************  File Settings  ****************************/
  1563. X
  1564. Xchar        cur_dir[1024];
  1565. Xchar        cur_filename[200] = "";
  1566. Xchar        save_filename[200] = "";    /* to undo load */
  1567. Xchar        cut_buf_name[100];
  1568. Xchar        file_header[32] = "#FIG ";
  1569. X
  1570. X/*************************** routines ***********************/
  1571. X
  1572. Xvoid
  1573. Xreset_modifiedflag()
  1574. X{
  1575. X    figure_modified = 0;
  1576. X}
  1577. X
  1578. Xvoid
  1579. Xset_modifiedflag()
  1580. X{
  1581. X    figure_modified = 1;
  1582. X}
  1583. X
  1584. Xvoid
  1585. Xset_action_on()
  1586. X{
  1587. X    action_on = 1;
  1588. X}
  1589. X
  1590. Xvoid
  1591. Xreset_action_on()
  1592. X{
  1593. X    action_on = 0;
  1594. X}
  1595. END_OF_FILE
  1596. if test 3545 -ne `wc -c <'mode.c'`; then
  1597.     echo shar: \"'mode.c'\" unpacked with wrong size!
  1598. fi
  1599. # end of 'mode.c'
  1600. fi
  1601. if test -f 'u_error.c' -a "${1}" != "-c" ; then 
  1602.   echo shar: Will not clobber existing file \"'u_error.c'\"
  1603. else
  1604. echo shar: Extracting \"'u_error.c'\" \(2761 characters\)
  1605. sed "s/^X//" >'u_error.c' <<'END_OF_FILE'
  1606. X/*
  1607. X * FIG : Facility for Interactive Generation of figures
  1608. X * Copyright (c) 1985 by Supoj Sutanthavibul
  1609. X *
  1610. X * "Permission to use, copy, modify, distribute, and sell this software and its
  1611. X * documentation for any purpose is hereby granted without fee, provided that
  1612. X * the above copyright notice appear in all copies and that both the copyright
  1613. X * notice and this permission notice appear in supporting documentation. 
  1614. X * No representations are made about the suitability of this software for 
  1615. X * any purpose.  It is provided "as is" without express or implied warranty."
  1616. X */
  1617. X
  1618. X#include "fig.h"
  1619. X#include "mode.h"
  1620. X#include "resources.h"
  1621. X
  1622. X#define MAXERRORS 6
  1623. X#define MAXERRMSGLEN 512
  1624. X
  1625. Xstatic int    error_cnt = 0;
  1626. X
  1627. X/* VARARGS1 */
  1628. Xput_err(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
  1629. X    char       *format, *arg1, *arg2, *arg3, *arg4, *arg5, *arg6, *arg7,
  1630. X           *arg8;
  1631. X{
  1632. X    fprintf(stderr, format, arg1, arg2, arg3, arg4, arg5,
  1633. X        arg6, arg7, arg8);
  1634. X    put_msg(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
  1635. X}
  1636. X
  1637. Xerror_handler(err_sig)
  1638. X    int            err_sig;
  1639. X{
  1640. X    switch (err_sig) {
  1641. X    case SIGHUP:
  1642. X    fprintf(stderr, "\nxfig: SIGHUP signal trapped\n");
  1643. X    break;
  1644. X    case SIGFPE:
  1645. X    fprintf(stderr, "\nxfig: SIGFPE signal trapped\n");
  1646. X    break;
  1647. X#ifndef NO_SIBGUS
  1648. X    case SIGBUS:
  1649. X    fprintf(stderr, "\nxfig: SIGBUS signal trapped\n");
  1650. X    break;
  1651. X#endif
  1652. X    case SIGSEGV:
  1653. X    fprintf(stderr, "\nxfig: SIGSEGV signal trapped\n");
  1654. X    break;
  1655. X    }
  1656. X    emergency_quit();
  1657. X}
  1658. X
  1659. XX_error_handler(d, err_ev)
  1660. X    Display       *d;
  1661. X    XErrorEvent       *err_ev;
  1662. X{
  1663. X    char        err_msg[MAXERRMSGLEN];
  1664. X
  1665. X    XGetErrorText(tool_d, (int) (err_ev->error_code), err_msg, MAXERRMSGLEN - 1);
  1666. X    (void) fprintf(stderr,
  1667. X       "xfig: X error trapped - error message follows:\n%s\n", err_msg);
  1668. X    emergency_quit();
  1669. X}
  1670. X
  1671. Xemergency_quit()
  1672. X{
  1673. X    if (++error_cnt > MAXERRORS) {
  1674. X    fprintf(stderr, "xfig: too many errors - giving up.\n");
  1675. X    exit(-1);
  1676. X    }
  1677. X    signal(SIGHUP, SIG_DFL);
  1678. X    signal(SIGFPE, SIG_DFL);
  1679. X#ifndef NO_SIBGUS
  1680. X    signal(SIGBUS, SIG_DFL);
  1681. X#endif
  1682. X    signal(SIGSEGV, SIG_DFL);
  1683. X
  1684. X    aborting = 1;
  1685. X    if (figure_modified && !emptyfigure()) {
  1686. X    fprintf(stderr, "xfig: attempting to save figure\n");
  1687. X    if (emergency_save("xfig.SAVE") == -1)
  1688. X        if (emergency_save(strcat(TMPDIR,"/xfig.SAVE")) == -1)
  1689. X        fprintf(stderr, "xfig: unable to save figure\n");
  1690. X    } else
  1691. X    fprintf(stderr, "xfig: figure empty or not modified - exiting\n");
  1692. X
  1693. X    quit();
  1694. X}
  1695. X
  1696. X/* ARGSUSED */
  1697. Xvoid my_quit(w, event, params, num_params)
  1698. XWidget w;
  1699. XXEvent *event;
  1700. XString *params;
  1701. XCardinal *num_params;
  1702. X{
  1703. X    extern Atom wm_delete_window;
  1704. X    if (event && event->type == ClientMessage &&
  1705. X    event->xclient.data.l[0] != wm_delete_window)
  1706. X    {
  1707. X    return;
  1708. X    }
  1709. X    /* free all the GC's */
  1710. X    free_GCs();
  1711. X    emergency_quit();
  1712. X}
  1713. END_OF_FILE
  1714. if test 2761 -ne `wc -c <'u_error.c'`; then
  1715.     echo shar: \"'u_error.c'\" unpacked with wrong size!
  1716. fi
  1717. # end of 'u_error.c'
  1718. fi
  1719. if test -f 'u_translate.c' -a "${1}" != "-c" ; then 
  1720.   echo shar: Will not clobber existing file \"'u_translate.c'\"
  1721. else
  1722. echo shar: Extracting \"'u_translate.c'\" \(3480 characters\)
  1723. sed "s/^X//" >'u_translate.c' <<'END_OF_FILE'
  1724. X/*
  1725. X * FIG : Facility for Interactive Generation of figures
  1726. X * Copyright (c) 1985 by Supoj Sutanthavibul
  1727. X *
  1728. X * "Permission to use, copy, modify, distribute, and sell this software and its
  1729. X * documentation for any purpose is hereby granted without fee, provided that
  1730. X * the above copyright notice appear in all copies and that both the copyright
  1731. X * notice and this permission notice appear in supporting documentation. 
  1732. X * No representations are made about the suitability of this software for 
  1733. X * any purpose.  It is provided "as is" without express or implied warranty."
  1734. X */
  1735. X
  1736. X#include "fig.h"
  1737. X#include "resources.h"
  1738. X#include "object.h"
  1739. X
  1740. Xtranslate_ellipse(ellipse, dx, dy)
  1741. X    F_ellipse       *ellipse;
  1742. X    int            dx, dy;
  1743. X{
  1744. X    ellipse->center.x += dx;
  1745. X    ellipse->center.y += dy;
  1746. X    ellipse->start.x += dx;
  1747. X    ellipse->start.y += dy;
  1748. X    ellipse->end.x += dx;
  1749. X    ellipse->end.y += dy;
  1750. X}
  1751. X
  1752. Xtranslate_arc(arc, dx, dy)
  1753. X    F_arc       *arc;
  1754. X    int            dx, dy;
  1755. X{
  1756. X    arc->center.x += (float) dx;
  1757. X    arc->center.y += (float) dy;
  1758. X    arc->point[0].x += dx;
  1759. X    arc->point[0].y += dy;
  1760. X    arc->point[1].x += dx;
  1761. X    arc->point[1].y += dy;
  1762. X    arc->point[2].x += dx;
  1763. X    arc->point[2].y += dy;
  1764. X}
  1765. X
  1766. Xtranslate_line(line, dx, dy)
  1767. X    F_line       *line;
  1768. X    int            dx, dy;
  1769. X{
  1770. X    F_point       *point;
  1771. X
  1772. X    for (point = line->points; point != NULL; point = point->next) {
  1773. X    point->x += dx;
  1774. X    point->y += dy;
  1775. X    }
  1776. X}
  1777. X
  1778. Xtranslate_text(text, dx, dy)
  1779. X    F_text       *text;
  1780. X    int            dx, dy;
  1781. X{
  1782. X    text->base_x += dx;
  1783. X    text->base_y += dy;
  1784. X}
  1785. X
  1786. Xtranslate_spline(spline, dx, dy)
  1787. X    F_spline       *spline;
  1788. X    int            dx, dy;
  1789. X{
  1790. X    F_point       *point;
  1791. X    F_control       *cp;
  1792. X
  1793. X    for (point = spline->points; point != NULL; point = point->next) {
  1794. X    point->x += dx;
  1795. X    point->y += dy;
  1796. X    }
  1797. X    for (cp = spline->controls; cp != NULL; cp = cp->next) {
  1798. X    cp->lx += dx;
  1799. X    cp->ly += dy;
  1800. X    cp->rx += dx;
  1801. X    cp->ry += dy;
  1802. X    }
  1803. X}
  1804. X
  1805. Xtranslate_compound(compound, dx, dy)
  1806. X    F_compound       *compound;
  1807. X    int            dx, dy;
  1808. X{
  1809. X    compound->nwcorner.x += dx;
  1810. X    compound->nwcorner.y += dy;
  1811. X    compound->secorner.x += dx;
  1812. X    compound->secorner.y += dy;
  1813. X
  1814. X    translate_lines(compound->lines, dx, dy);
  1815. X    translate_splines(compound->splines, dx, dy);
  1816. X    translate_ellipses(compound->ellipses, dx, dy);
  1817. X    translate_arcs(compound->arcs, dx, dy);
  1818. X    translate_texts(compound->texts, dx, dy);
  1819. X    translate_compounds(compound->compounds, dx, dy);
  1820. X}
  1821. X
  1822. Xtranslate_arcs(arcs, dx, dy)
  1823. X    F_arc       *arcs;
  1824. X    int            dx, dy;
  1825. X{
  1826. X    F_arc       *a;
  1827. X
  1828. X    for (a = arcs; a != NULL; a = a->next)
  1829. X    translate_arc(a, dx, dy);
  1830. X}
  1831. X
  1832. Xtranslate_compounds(compounds, dx, dy)
  1833. X    F_compound       *compounds;
  1834. X    int            dx, dy;
  1835. X{
  1836. X    F_compound       *c;
  1837. X
  1838. X    for (c = compounds; c != NULL; c = c->next)
  1839. X    translate_compound(c, dx, dy);
  1840. X}
  1841. X
  1842. Xtranslate_ellipses(ellipses, dx, dy)
  1843. X    F_ellipse       *ellipses;
  1844. X    int            dx, dy;
  1845. X{
  1846. X    F_ellipse       *e;
  1847. X
  1848. X    for (e = ellipses; e != NULL; e = e->next)
  1849. X    translate_ellipse(e, dx, dy);
  1850. X}
  1851. X
  1852. Xtranslate_lines(lines, dx, dy)
  1853. X    F_line       *lines;
  1854. X    int            dx, dy;
  1855. X{
  1856. X    F_line       *l;
  1857. X
  1858. X    for (l = lines; l != NULL; l = l->next)
  1859. X    translate_line(l, dx, dy);
  1860. X}
  1861. X
  1862. Xtranslate_splines(splines, dx, dy)
  1863. X    F_spline       *splines;
  1864. X    int            dx, dy;
  1865. X{
  1866. X    F_spline       *s;
  1867. X
  1868. X    for (s = splines; s != NULL; s = s->next)
  1869. X    translate_spline(s, dx, dy);
  1870. X}
  1871. X
  1872. Xtranslate_texts(texts, dx, dy)
  1873. X    F_text       *texts;
  1874. X    int            dx, dy;
  1875. X{
  1876. X    F_text       *t;
  1877. X
  1878. X    for (t = texts; t != NULL; t = t->next)
  1879. X    translate_text(t, dx, dy);
  1880. X}
  1881. END_OF_FILE
  1882. if test 3480 -ne `wc -c <'u_translate.c'`; then
  1883.     echo shar: \"'u_translate.c'\" unpacked with wrong size!
  1884. fi
  1885. # end of 'u_translate.c'
  1886. fi
  1887. if test -f 'w_cursor.c' -a "${1}" != "-c" ; then 
  1888.   echo shar: Will not clobber existing file \"'w_cursor.c'\"
  1889. else
  1890. echo shar: Extracting \"'w_cursor.c'\" \(3086 characters\)
  1891. sed "s/^X//" >'w_cursor.c' <<'END_OF_FILE'
  1892. X/*
  1893. X * FIG : Facility for Interactive Generation of figures
  1894. X * Copyright (c) 1985 by Supoj Sutanthavibul
  1895. X *
  1896. X * "Permission to use, copy, modify, distribute, and sell this software and its
  1897. X * documentation for any purpose is hereby granted without fee, provided that
  1898. X * the above copyright notice appear in all copies and that both the copyright
  1899. X * notice and this permission notice appear in supporting documentation. 
  1900. X * No representations are made about the suitability of this software for 
  1901. X * any purpose.  It is provided "as is" without express or implied warranty."
  1902. X */
  1903. X
  1904. X#include "fig.h"
  1905. X#include "figx.h"
  1906. X#include "resources.h"
  1907. X#include "paintop.h"
  1908. X
  1909. Xinit_cursor()
  1910. X{
  1911. X    register Display *d = tool_d;
  1912. X    cur_cursor        = arrow_cursor;  /* current cursor */
  1913. X
  1914. X    arrow_cursor    = XCreateFontCursor(d, XC_left_ptr);
  1915. X    bull_cursor        = XCreateFontCursor(d, XC_circle);
  1916. X    buster_cursor    = XCreateFontCursor(d, XC_pirate);
  1917. X    crosshair_cursor    = XCreateFontCursor(d, XC_crosshair);
  1918. X    null_cursor        = XCreateFontCursor(d, XC_tcross);
  1919. X    pencil_cursor    = XCreateFontCursor(d, XC_pencil);
  1920. X    pick15_cursor    = XCreateFontCursor(d, XC_dotbox);
  1921. X    pick9_cursor    = XCreateFontCursor(d, XC_hand1);
  1922. X    wait_cursor        = XCreateFontCursor(d, XC_watch);
  1923. X    panel_cursor    = XCreateFontCursor(d, XC_icon);
  1924. X    lr_arrow_cursor    = XCreateFontCursor(d, XC_sb_h_double_arrow);
  1925. X    l_arrow_cursor    = XCreateFontCursor(d, XC_sb_left_arrow);
  1926. X    r_arrow_cursor    = XCreateFontCursor(d, XC_sb_right_arrow);
  1927. X    ud_arrow_cursor    = XCreateFontCursor(d, XC_sb_v_double_arrow);
  1928. X    u_arrow_cursor    = XCreateFontCursor(d, XC_sb_up_arrow);
  1929. X    d_arrow_cursor    = XCreateFontCursor(d, XC_sb_down_arrow);
  1930. X}
  1931. X
  1932. Xrecolor_cursors()
  1933. X{
  1934. X    register Display *d = tool_d;
  1935. X
  1936. X    XRecolorCursor(d, arrow_cursor,     &x_fg_color, &x_bg_color);
  1937. X    XRecolorCursor(d, bull_cursor,      &x_fg_color, &x_bg_color);
  1938. X    XRecolorCursor(d, buster_cursor,    &x_fg_color, &x_bg_color);
  1939. X    XRecolorCursor(d, crosshair_cursor, &x_fg_color, &x_bg_color);
  1940. X    XRecolorCursor(d, null_cursor,      &x_fg_color, &x_bg_color);
  1941. X    XRecolorCursor(d, pencil_cursor,    &x_fg_color, &x_bg_color);
  1942. X    XRecolorCursor(d, pick15_cursor,    &x_fg_color, &x_bg_color);
  1943. X    XRecolorCursor(d, pick9_cursor,     &x_fg_color, &x_bg_color);
  1944. X    XRecolorCursor(d, wait_cursor,      &x_fg_color, &x_bg_color);
  1945. X    XRecolorCursor(d, panel_cursor,     &x_fg_color, &x_bg_color);
  1946. X    XRecolorCursor(d, l_arrow_cursor,   &x_fg_color, &x_bg_color);
  1947. X    XRecolorCursor(d, r_arrow_cursor,   &x_fg_color, &x_bg_color);
  1948. X    XRecolorCursor(d, lr_arrow_cursor,  &x_fg_color, &x_bg_color);
  1949. X    XRecolorCursor(d, u_arrow_cursor,   &x_fg_color, &x_bg_color);
  1950. X    XRecolorCursor(d, d_arrow_cursor,   &x_fg_color, &x_bg_color);
  1951. X    XRecolorCursor(d, ud_arrow_cursor,  &x_fg_color, &x_bg_color);
  1952. X}
  1953. X
  1954. Xreset_cursor()
  1955. X{
  1956. X    XDefineCursor(tool_d, canvas_win, cur_cursor);
  1957. X}
  1958. X
  1959. Xset_temp_cursor(cursor)
  1960. X    Cursor        cursor;
  1961. X{
  1962. X    XDefineCursor(tool_d, canvas_win, cursor);
  1963. X}
  1964. X
  1965. Xset_cursor(cursor)
  1966. X    Cursor        cursor;
  1967. X{
  1968. X    cur_cursor = cursor;
  1969. X    XDefineCursor(tool_d, canvas_win, cursor);
  1970. X}
  1971. X
  1972. END_OF_FILE
  1973. if test 3086 -ne `wc -c <'w_cursor.c'`; then
  1974.     echo shar: \"'w_cursor.c'\" unpacked with wrong size!
  1975. fi
  1976. # end of 'w_cursor.c'
  1977. fi
  1978. if test -f 'w_icons.h' -a "${1}" != "-c" ; then 
  1979.   echo shar: Will not clobber existing file \"'w_icons.h'\"
  1980. else
  1981. echo shar: Extracting \"'w_icons.h'\" \(2427 characters\)
  1982. sed "s/^X//" >'w_icons.h' <<'END_OF_FILE'
  1983. X/*
  1984. X * FIG : Facility for Interactive Generation of figures
  1985. X * Copyright (c) 1985 by Supoj Sutanthavibul
  1986. X *
  1987. X * "Permission to use, copy, modify, distribute, and sell this software and its
  1988. X * documentation for any purpose is hereby granted without fee, provided that
  1989. X * the above copyright notice appear in all copies and that both the copyright
  1990. X * notice and this permission notice appear in supporting documentation. 
  1991. X * No representations are made about the suitability of this software for 
  1992. X * any purpose.  It is provided "as is" without express or implied warranty."
  1993. X */
  1994. X
  1995. Xextern XImage    addpt_ic;
  1996. X
  1997. X#ifdef notdef            /* not used yet */
  1998. Xextern XImage    raise_ic;
  1999. Xextern XImage    kbd_ic;
  2000. X
  2001. X#endif
  2002. Xextern XImage    smartoff_ic;
  2003. Xextern XImage    smartmove_ic;
  2004. Xextern XImage    smartslide_ic;
  2005. Xextern XImage    arc_ic;
  2006. Xextern XImage    autoarrow_ic;
  2007. Xextern XImage    backarrow_ic;
  2008. Xextern XImage    box_ic;
  2009. Xextern XImage    regpoly_ic;
  2010. Xextern XImage    epsobj_ic;
  2011. Xextern XImage    arc_box_ic;
  2012. Xextern XImage    break_ic;
  2013. Xextern XImage    cirrad_ic;
  2014. Xextern XImage    cirdia_ic;
  2015. Xextern XImage    c_spl_ic;
  2016. Xextern XImage    copy_ic;
  2017. Xextern XImage    glue_ic;
  2018. Xextern XImage    solidline_ic;
  2019. Xextern XImage    dashline_ic;
  2020. Xextern XImage    dottedline_ic;
  2021. Xextern XImage    deletept_ic;
  2022. Xextern XImage    ellrad_ic;
  2023. Xextern XImage    elldia_ic;
  2024. Xextern XImage    flip_x_ic;
  2025. Xextern XImage    flip_y_ic;
  2026. Xextern XImage    forarrow_ic;
  2027. Xextern XImage    grid1_ic;
  2028. Xextern XImage    grid2_ic;
  2029. Xextern XImage    intspl_ic;
  2030. Xextern XImage    c_intspl_ic;
  2031. Xextern XImage    line_ic;
  2032. Xextern XImage    fine_grid_ic;
  2033. Xextern XImage    unconstrained_ic;
  2034. Xextern XImage    latexline_ic;
  2035. Xextern XImage    latexarrow_ic;
  2036. Xextern XImage    mounthattan_ic;
  2037. Xextern XImage    manhattan_ic;
  2038. Xextern XImage    mountain_ic;
  2039. Xextern XImage    move_ic;
  2040. Xextern XImage    movept_ic;
  2041. Xextern XImage    polygon_ic;
  2042. Xextern XImage    delete_ic;
  2043. Xextern XImage    rotCW_ic;
  2044. Xextern XImage    rotCCW_ic;
  2045. Xextern XImage    scale_ic;
  2046. Xextern XImage    convert_ic;
  2047. Xextern XImage    spl_ic;
  2048. Xextern XImage    text_ic;
  2049. Xextern XImage    update_ic;
  2050. Xextern XImage    change_ic;
  2051. Xextern XImage    halignl_ic;
  2052. Xextern XImage    halignr_ic;
  2053. Xextern XImage    halignc_ic;
  2054. Xextern XImage    valignt_ic;
  2055. Xextern XImage    valignb_ic;
  2056. Xextern XImage    valignc_ic;
  2057. Xextern XImage    align_ic;
  2058. Xextern XImage    any_ic;
  2059. Xextern XImage    none_ic;
  2060. Xextern XImage    fill_ic;
  2061. Xextern XImage    blank_ic;
  2062. Xextern XImage    textL_ic;
  2063. Xextern XImage    textC_ic;
  2064. Xextern XImage    textR_ic;
  2065. Xextern XImage    printer_ic;
  2066. Xextern XImage    noarrows_ic;
  2067. Xextern XImage    farrows_ic;
  2068. Xextern XImage    barrows_ic;
  2069. Xextern XImage    fbarrows_ic;
  2070. END_OF_FILE
  2071. if test 2427 -ne `wc -c <'w_icons.h'`; then
  2072.     echo shar: \"'w_icons.h'\" unpacked with wrong size!
  2073. fi
  2074. # end of 'w_icons.h'
  2075. fi
  2076. if test -f 'w_indpanel.h' -a "${1}" != "-c" ; then 
  2077.   echo shar: Will not clobber existing file \"'w_indpanel.h'\"
  2078. else
  2079. echo shar: Extracting \"'w_indpanel.h'\" \(3123 characters\)
  2080. sed "s/^X//" >'w_indpanel.h' <<'END_OF_FILE'
  2081. X/*
  2082. X * FIG : Facility for Interactive Generation of figures
  2083. X * Copyright (c) 1991 by Paul King
  2084. X *
  2085. X * "Permission to use, copy, modify, distribute, and sell this software and its
  2086. X * documentation for any purpose is hereby granted without fee, provided that
  2087. X * the above copyright notice appear in all copies and that both the copyright
  2088. X * notice and this permission notice appear in supporting documentation. 
  2089. X * No representations are made about the suitability of this software for 
  2090. X * any purpose.  It is provided "as is" without express or implied warranty."
  2091. X */
  2092. X
  2093. X/* indicator button selection */
  2094. X
  2095. X#define I_ANGLEGEOM    0x000001
  2096. X#define I_VALIGN    0x000002
  2097. X#define I_HALIGN    0x000004
  2098. X#define I_GRIDMODE    0x000008
  2099. X#define I_POINTPOSN    0x000010
  2100. X#define I_FILLSTYLE    0x000020
  2101. X#define I_BOXRADIUS    0x000040
  2102. X#define I_LINEWIDTH    0x000080
  2103. X#define I_LINESTYLE    0x000100
  2104. X#define I_ARROWMODE    0x000200
  2105. X#define I_TEXTJUST    0x000400
  2106. X#define I_FONTSIZE    0x000800
  2107. X#define I_FONT        0x001000
  2108. X#define I_TEXTSTEP    0x002000
  2109. X#define I_ZOOM        0x004000
  2110. X#define I_ROTNANGLE    0x008000
  2111. X#define I_NUMSIDES    0x010000
  2112. X#define I_COLOR        0x020000
  2113. X#define I_LINKMODE    0x040000
  2114. X#define I_DEPTH        0x080000
  2115. X#define I_ELLTEXTANGLE    0x100000
  2116. X#define I_TEXTFLAGS    0x200000
  2117. X
  2118. X#define I_NONE        0x000000
  2119. X#define I_ALL        0x3fffff
  2120. X#define I_MIN1        (I_GRIDMODE | I_ZOOM)
  2121. X#define I_MIN2        (I_MIN1 | I_POINTPOSN)
  2122. X#define I_MIN3        (I_MIN2 | I_LINKMODE)
  2123. X#define I_ADDMOVPT    (I_MIN2 | I_ANGLEGEOM)
  2124. X#define I_TEXT0        (I_TEXTJUST | I_FONT | I_FONTSIZE | I_COLOR | \
  2125. X                I_DEPTH | I_ELLTEXTANGLE | I_TEXTFLAGS)
  2126. X#define I_TEXT        (I_MIN2 | I_TEXTSTEP | I_TEXT0)
  2127. X#define I_LINE0        (I_FILLSTYLE | I_LINESTYLE | I_LINEWIDTH | \
  2128. X                I_COLOR | I_DEPTH)
  2129. X#define I_BOX        (I_MIN2 | I_LINE0 | I_DEPTH)
  2130. X#define I_ELLIPSE    (I_MIN2 | I_LINE0 | I_DEPTH | I_ELLTEXTANGLE)
  2131. X#define I_ARC        (I_BOX | I_ARROWMODE)
  2132. X#define I_REGPOLY    (I_BOX | I_NUMSIDES)
  2133. X#define I_CLOSED    (I_BOX | I_ANGLEGEOM)
  2134. X#define I_OPEN        (I_CLOSED | I_ARROWMODE)
  2135. X#define I_ARCBOX    (I_BOX | I_BOXRADIUS)
  2136. X#define I_EPSOBJ    (I_MIN2 | I_DEPTH)
  2137. X#define I_OBJECT    (I_MIN1 | I_TEXT0 | I_LINE0 | I_ARROWMODE | \
  2138. X                I_BOXRADIUS | I_DEPTH)
  2139. X#define I_ALIGN        (I_MIN1 | I_HALIGN | I_VALIGN)
  2140. X#define I_ROTATE    (I_MIN1 | I_ROTNANGLE)
  2141. X/* for checking which parts to update */
  2142. X#define I_UPDATEMASK    (I_OBJECT & ~I_GRIDMODE & ~I_ZOOM)
  2143. X
  2144. Xtypedef struct choice_struct {
  2145. X    int            value;
  2146. X    PIXRECT        icon;
  2147. X    Pixmap        normalPM,blackPM;
  2148. X}        choice_info;
  2149. X
  2150. Xtypedef struct ind_sw_struct {
  2151. X    int            type;    /* one of I_CHOICE .. I_FVAL */
  2152. X    int            func;
  2153. X    char        line1[14], line2[6];
  2154. X    int            sw_width;
  2155. X    int           *i_varadr;
  2156. X    float       *f_varadr;
  2157. X    int            (*inc_func) ();
  2158. X    int            (*dec_func) ();
  2159. X    int            (*show_func) ();
  2160. X    choice_info       *choices;    /* specific to I_CHOICE */
  2161. X    int            numchoices; /* specific to I_CHOICE */
  2162. X    int            sw_per_row; /* specific to I_CHOICE */
  2163. X    Bool        update;    /* whether this object component is updated by update */
  2164. X    TOOL        button;
  2165. X    TOOL        formw;
  2166. X    TOOL        updbut;
  2167. X    Pixmap        normalPM;
  2168. X}        ind_sw_info;
  2169. X
  2170. X#define ZOOM_SWITCH_INDEX    0    /* used by w_zoom.c */
  2171. Xextern ind_sw_info ind_switches[];
  2172. END_OF_FILE
  2173. if test 3123 -ne `wc -c <'w_indpanel.h'`; then
  2174.     echo shar: \"'w_indpanel.h'\" unpacked with wrong size!
  2175. fi
  2176. # end of 'w_indpanel.h'
  2177. fi
  2178. if test -f 'w_setup.c' -a "${1}" != "-c" ; then 
  2179.   echo shar: Will not clobber existing file \"'w_setup.c'\"
  2180. else
  2181. echo shar: Extracting \"'w_setup.c'\" \(2592 characters\)
  2182. sed "s/^X//" >'w_setup.c' <<'END_OF_FILE'
  2183. X/*
  2184. X * FIG : Facility for Interactive Generation of figures
  2185. X * Copyright (c) 1985 by Supoj Sutanthavibul
  2186. X *
  2187. X * "Permission to use, copy, modify, distribute, and sell this software and its
  2188. X * documentation for any purpose is hereby granted without fee, provided that
  2189. X * the above copyright notice appear in all copies and that both the copyright
  2190. X * notice and this permission notice appear in supporting documentation. 
  2191. X * No representations are made about the suitability of this software for 
  2192. X * any purpose.  It is provided "as is" without express or implied warranty."
  2193. X */
  2194. X
  2195. X#include "fig.h"
  2196. X#include "resources.h"
  2197. X#include "w_setup.h"
  2198. X#include "w_util.h"
  2199. X
  2200. Xint        TOOL_WD, TOOL_HT;
  2201. Xint        CMDPANEL_WD, CMDPANEL_HT = 22;
  2202. Xint        MODEPANEL_WD, MODEPANEL_HT;
  2203. Xint        MODEPANEL_SPACE;
  2204. Xint        MSGFORM_WD, MSGFORM_HT = 18;
  2205. Xint        MSGPANEL_WD = 600;
  2206. Xint        MOUSEFUN_WD, MOUSEFUN_HT;
  2207. Xint        INDPANEL_WD;
  2208. Xint        CANVAS_WD, CANVAS_HT;
  2209. Xint        INTERNAL_BW;
  2210. Xint        TOPRULER_WD, TOPRULER_HT;
  2211. Xint        SIDERULER_WD, SIDERULER_HT;
  2212. Xint        SW_PER_ROW, SW_PER_COL;
  2213. X
  2214. Xsetup_sizes(new_canv_wd, new_canv_ht)
  2215. X    int            new_canv_wd, new_canv_ht;
  2216. X{
  2217. X    int            NUM_CMD_SW;
  2218. X
  2219. X    /*
  2220. X     * make the width of the mousefun panel about 1/3 of the size of the
  2221. X     * canvas width and the cmdpanel the remaining width. Be sure to set it
  2222. X     * up so that cmdpanel buttons can be allocated a size which divides
  2223. X     * evenly into the remaining space.
  2224. X     */
  2225. X    CANVAS_WD = new_canv_wd;
  2226. X    if (CANVAS_WD < 10)
  2227. X    CANVAS_WD = 10;
  2228. X    CANVAS_HT = new_canv_ht;
  2229. X    if (CANVAS_HT < 10)
  2230. X    CANVAS_HT = 10;
  2231. X
  2232. X    SIDERULER_WD = RULER_WD + 8;    /* allow for 100's numbers */
  2233. X    TOPRULER_HT = RULER_WD;
  2234. X    TOPRULER_WD = CANVAS_WD;
  2235. X    SIDERULER_HT = CANVAS_HT;
  2236. X    if (TOPRULER_WD > MAX_TOPRULER_WD)
  2237. X    TOPRULER_WD = MAX_TOPRULER_WD;
  2238. X    if (SIDERULER_HT > MAX_SIDERULER_HT)
  2239. X    SIDERULER_HT = MAX_SIDERULER_HT;
  2240. X
  2241. X    MODEPANEL_WD = (MODE_SW_WD + INTERNAL_BW) * SW_PER_ROW + INTERNAL_BW;
  2242. X    NUM_CMD_SW = num_cmd_sw();    /* kludge - NUM_CMD_SW local to w_cmdpanel.c */
  2243. X    CMDPANEL_WD = (((2 * CANVAS_WD) / 3 + MODEPANEL_WD +
  2244. X            SIDERULER_WD) / NUM_CMD_SW) * NUM_CMD_SW;
  2245. X    MOUSEFUN_WD = (MODEPANEL_WD + CANVAS_WD + SIDERULER_WD - CMDPANEL_WD);
  2246. X    while (MOUSEFUN_WD < MIN_MOUSEFUN_WD) {
  2247. X    MOUSEFUN_WD += NUM_CMD_SW;
  2248. X    CMDPANEL_WD -= NUM_CMD_SW;
  2249. X    }
  2250. X    if (CMDPANEL_WD < 5 * NUM_CMD_SW)
  2251. X    CMDPANEL_WD = 5 * NUM_CMD_SW;
  2252. X    MSGFORM_WD = CMDPANEL_WD;
  2253. X
  2254. X    MODEPANEL_SPACE = CANVAS_HT + RULER_WD -
  2255. X    SW_PER_COL * (MODE_SW_HT + INTERNAL_BW);
  2256. X    if (MODEPANEL_SPACE < 2)
  2257. X    MODEPANEL_SPACE = 2;
  2258. X    INDPANEL_WD = MODEPANEL_WD + CANVAS_WD + SIDERULER_WD + INTERNAL_BW*2;
  2259. X}
  2260. END_OF_FILE
  2261. if test 2592 -ne `wc -c <'w_setup.c'`; then
  2262.     echo shar: \"'w_setup.c'\" unpacked with wrong size!
  2263. fi
  2264. # end of 'w_setup.c'
  2265. fi
  2266. echo shar: End of archive 2 \(of 27\).
  2267. cp /dev/null ark2isdone
  2268. MISSING=""
  2269. 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
  2270.     if test ! -f ark${I}isdone ; then
  2271.     MISSING="${MISSING} ${I}"
  2272.     fi
  2273. done
  2274. if test "${MISSING}" = "" ; then
  2275.     echo You have unpacked all 27 archives.
  2276.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2277. else
  2278.     echo You still need to unpack the following archives:
  2279.     echo "        " ${MISSING}
  2280. fi
  2281. ##  End of shell archive.
  2282. exit 0
  2283.  
  2284. exit 0 # Just in case...
  2285. -- 
  2286.   // chris@IMD.Sterling.COM       | Send comp.sources.x submissions to:
  2287. \X/  Amiga - The only way to fly! |    sources-x@imd.sterling.com
  2288.  "It's intuitively obvious to the |
  2289.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  2290.