home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume21 / xfig / patch02m < prev    next >
Encoding:
Text File  |  1993-10-21  |  31.0 KB  |  1,062 lines

  1. Newsgroups: comp.sources.x
  2. From: envbvs@epb12.lbl.gov (Brian V. Smith)
  3. Subject: v21i033:  xfig - Draw amd manipulate objects in an X-Window, Patch02m/16
  4. Message-ID: <1993Oct21.185936.7476@sparky.sterling.com>
  5. X-Md4-Signature: 2f9eb5158728bb260d3339baaaf200c6
  6. Sender: chris@sparky.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Thu, 21 Oct 1993 18:59:36 GMT
  9. Approved: chris@sterling.com
  10.  
  11. Submitted-by: envbvs@epb12.lbl.gov (Brian V. Smith)
  12. Posting-number: Volume 21, Issue 33
  13. Archive-name: xfig/patch02m
  14. Environment: patch, X11, xfig
  15. Patch-To: xfig: Volume 19, Issue 113-139
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  xfig.08
  22. # Wrapped by chris@sparky on Thu Oct 21 13:40:07 1993
  23. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 13 (of 16)."'
  26. if test -f 'xfig.08' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'xfig.08'\"
  28. else
  29.   echo shar: Extracting \"'xfig.08'\" \(28511 characters\)
  30.   sed "s/^X//" >'xfig.08' <<'END_OF_FILE'
  31. X  };
  32. X  
  33. X  #define NUM_VALIGN_CHOICES (sizeof(valign_choices)/sizeof(choice_info))
  34. X  
  35. X  static choice_info halign_choices[] = {
  36. X!     {ALIGN_NONE, &none_ic,},
  37. X!     {ALIGN_LEFT, &halignl_ic,},
  38. X!     {ALIGN_CENTER, &halignc_ic,},
  39. X!     {ALIGN_RIGHT, &halignr_ic,},
  40. X  };
  41. X  
  42. X  #define NUM_HALIGN_CHOICES (sizeof(halign_choices)/sizeof(choice_info))
  43. X***************
  44. X*** 299,321 ****
  45. X  "<EnterWindow>:EnterIndSw()highlight()\n\
  46. X      <LeaveWindow>:LeaveIndSw()unhighlight()\n";
  47. X  
  48. X  init_ind_panel(tool)
  49. X      TOOL        tool;
  50. X  {
  51. X!     int        i;
  52. X      ind_sw_info    *sw;
  53. X  
  54. X      /* does he want to always see ALL of the indicator buttons? */
  55. X      if (appres.ShowAllButtons) {
  56. X      cur_indmask = I_ALL;    /* yes */
  57. X!     i = 2*DEF_IND_SW_HT+2*INTERNAL_BW+6;  /* two rows high when showing all buttons */
  58. X      } else {
  59. X!     i = DEF_IND_SW_HT+4*INTERNAL_BW+14;   /* allow for thickness of scrollbar */
  60. X      }
  61. X- 
  62. X-     /* make a scrollable viewport in case all the buttons don't fit */
  63. X-     FirstArg(XtNallowHoriz, True);
  64. X-     NextArg(XtNwidth, INDPANEL_WD);
  65. X      NextArg(XtNheight, i);
  66. X      NextArg(XtNborderWidth, 0);
  67. X      NextArg(XtNresizable, False);
  68. X--- 303,338 ----
  69. X  "<EnterWindow>:EnterIndSw()highlight()\n\
  70. X      <LeaveWindow>:LeaveIndSw()unhighlight()\n";
  71. X  
  72. X+ /* bitmaps for set/clear and toggle buttons */
  73. X+ static unsigned char set_bits[] = {
  74. X+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  75. X+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
  76. X+ static unsigned char clr_bits[] = {
  77. X+    0xff, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
  78. X+    0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xff, 0x03};
  79. X+ static unsigned char tog_bits[] = {
  80. X+    0xff, 0x03, 0x01, 0x02, 0x03, 0x02, 0x07, 0x02, 0x0f, 0x02, 0x1f, 0x02,
  81. X+    0x3f, 0x02, 0x7f, 0x02, 0xff, 0x02, 0xff, 0x03};
  82. X+ 
  83. X  init_ind_panel(tool)
  84. X      TOOL        tool;
  85. X  {
  86. X!     int         i;
  87. X      ind_sw_info    *sw;
  88. X+     Widget     tw; /* temporary widget to get scrollbar widget */
  89. X  
  90. X+ 
  91. X+     /* make a scrollable viewport in case all the buttons don't fit */
  92. X+     FirstArg(XtNallowHoriz, True);
  93. X+     NextArg(XtNwidth, INDPANEL_WD);
  94. X      /* does he want to always see ALL of the indicator buttons? */
  95. X      if (appres.ShowAllButtons) {
  96. X      cur_indmask = I_ALL;    /* yes */
  97. X!     i = 2*DEF_IND_SW_HT+5*INTERNAL_BW; /* two rows high when showing all buttons */
  98. X      } else {
  99. X!     i = DEF_IND_SW_HT+2*INTERNAL_BW+MAX_SCROLL_WD;   /* allow for thickness of scrollbar */
  100. X!     NextArg(XtNforceBars, True);
  101. X      }
  102. X      NextArg(XtNheight, i);
  103. X      NextArg(XtNborderWidth, 0);
  104. X      NextArg(XtNresizable, False);
  105. X***************
  106. X*** 345,350 ****
  107. X--- 362,420 ----
  108. X      ind_panel = XtCreateManagedWidget("ind_panel", boxWidgetClass, ind_viewp,
  109. X                     Args, ArgCount);
  110. X  
  111. X+     /* make a widget which contains the label and toggle/set/clear form */
  112. X+ 
  113. X+     FirstArg(XtNdefaultDistance, 0);
  114. X+     NextArg(XtNborderWidth, INTERNAL_BW);
  115. X+     NextArg(XtNorientation, XtorientVertical);
  116. X+     NextArg(XtNhSpace, 0);
  117. X+     NextArg(XtNvSpace, 1);
  118. X+     NextArg(XtNheight, DEF_IND_SW_HT);
  119. X+     NextArg(XtNwidth, DEF_IND_SW_WD);
  120. X+     upd_ctrl = XtCreateWidget("upd_ctrl_form", boxWidgetClass,
  121. X+             ind_panel, Args, ArgCount);
  122. X+ 
  123. X+     /* make a widget which contains the buttons to toggle/set/clear
  124. X+        the update buttons in the indicator panel buttons */
  125. X+ 
  126. X+     FirstArg(XtNborderWidth, 0);
  127. X+     NextArg(XtNheight, 13);
  128. X+     NextArg(XtNwidth, 50);
  129. X+     NextArg(XtNjustify, XtJustifyCenter);
  130. X+     NextArg(XtNfont, button_font);
  131. X+     NextArg(XtNlabel, "Control");
  132. X+     upd_ctrl_lab = XtCreateManagedWidget("upd_ctrl_label", labelWidgetClass,
  133. X+             upd_ctrl, Args, ArgCount);
  134. X+ 
  135. X+     /* make a widget which contains the buttons to toggle/set/clear
  136. X+        the update buttons in the indicator panel buttons */
  137. X+ 
  138. X+     FirstArg(XtNdefaultDistance, 0);
  139. X+     NextArg(XtNborderWidth, 0);
  140. X+     NextArg(XtNorientation, XtorientHorizontal);
  141. X+     NextArg(XtNhSpace, 3);
  142. X+     NextArg(XtNvSpace, 0);
  143. X+     upd_ctrl_btns = XtCreateManagedWidget("upd_ctrl_btns", boxWidgetClass,
  144. X+             upd_ctrl, Args, ArgCount);
  145. X+ 
  146. X+     FirstArg(XtNheight, 9);
  147. X+     NextArg(XtNwidth, 9);
  148. X+     NextArg(XtNinternalWidth, 2);
  149. X+     NextArg(XtNinternalHeight, 2);
  150. X+     NextArg(XtNborderWidth, 1);
  151. X+     set_upd = XtCreateManagedWidget("set_upd", commandWidgetClass,
  152. X+             upd_ctrl_btns, Args, ArgCount);
  153. X+     XtAddEventHandler(set_upd, ButtonReleaseMask, (Boolean) 0,
  154. X+             set_all_update, (XtPointer) 0);
  155. X+     clr_upd = XtCreateManagedWidget("clr_upd", commandWidgetClass,
  156. X+             upd_ctrl_btns, Args, ArgCount);
  157. X+     XtAddEventHandler(clr_upd, ButtonReleaseMask, (Boolean) 0,
  158. X+             clr_all_update, (XtPointer) 0);
  159. X+     tog_upd = XtCreateManagedWidget("tog_upd", commandWidgetClass,
  160. X+             upd_ctrl_btns, Args, ArgCount);
  161. X+     XtAddEventHandler(tog_upd, ButtonReleaseMask, (Boolean) 0,
  162. X+             tog_all_update, (XtPointer) 0);
  163. X+ 
  164. X      /* start with all components affected by update */
  165. X      cur_updatemask = I_UPDATEMASK;
  166. X  
  167. X***************
  168. X*** 389,394 ****
  169. X--- 459,485 ----
  170. X      XtOverrideTranslations(sw->button,
  171. X                     XtParseTranslationTable(ind_translations));
  172. X      }
  173. X+ 
  174. X+     /* now get the real height of the scrollbar and resize the ind_panel if necessary */
  175. X+     tw = XtNameToWidget(ind_viewp, "horizontal");
  176. X+     if (!appres.ShowAllButtons && tw != NULL) {
  177. X+     Dimension    td1; /* temporary variable to get scrollbar thickness */
  178. X+     Dimension    td2; /* temporary variable to get indpanel height */
  179. X+     Dimension    bdw; /* temporary variable to get scrollbar border width */
  180. X+     FirstArg(XtNthickness, &td1);
  181. X+     NextArg(XtNborderWidth, &bdw);
  182. X+     GetValues(tw);
  183. X+     FirstArg(XtNheight, &td2);
  184. X+     GetValues(ind_panel);
  185. X+     td2 = td2 - MAX_SCROLL_WD /* initial kludge value */ + td1 + 4 + bdw;
  186. X+     XtUnmanageChild(ind_panel);
  187. X+     FirstArg(XtNheight, td2);
  188. X+     SetValues(ind_viewp);
  189. X+     SetValues(ind_panel);
  190. X+     FirstArg(XtNforceBars, False);
  191. X+     SetValues(ind_viewp);
  192. X+     XtManageChild(ind_panel);
  193. X+     }
  194. X      update_indpanel(cur_indmask);
  195. X  }
  196. X  
  197. X***************
  198. X*** 414,419 ****
  199. X--- 505,561 ----
  200. X      cur_updatemask &= ~sw->func;    /* turn off update status */
  201. X  }
  202. X  
  203. X+ /* toggle the update buttons in all the widgets */
  204. X+ static void
  205. X+ tog_all_update()
  206. X+ {
  207. X+     int i;
  208. X+ 
  209. X+     cur_updatemask = ~cur_updatemask;    /* tuggle all */
  210. X+     for (i = 0; i < NUM_IND_SW; ++i) {
  211. X+     if (ind_switches[i].updbut == NULL)
  212. X+         continue;
  213. X+     ind_switches[i].update = !ind_switches[i].update;
  214. X+     FirstArg(XtNstate, &ind_switches[i].update);
  215. X+     SetValues(ind_switches[i].updbut);
  216. X+     }
  217. X+     put_msg("Update command status TOGGLED for all buttons");
  218. X+ }
  219. X+ 
  220. X+ /* turn on the update buttons in all the widgets */
  221. X+ static void
  222. X+ set_all_update()
  223. X+ {
  224. X+     int i;
  225. X+ 
  226. X+     cur_updatemask = I_UPDATEMASK;    /* turn all on */
  227. X+     for (i = 0; i < NUM_IND_SW; ++i) {
  228. X+     if (ind_switches[i].updbut == NULL)
  229. X+         continue;
  230. X+     ind_switches[i].update = True;
  231. X+     FirstArg(XtNstate, True);
  232. X+     SetValues(ind_switches[i].updbut);
  233. X+     }
  234. X+     put_msg("Update commands are now ENABLED for all buttons");
  235. X+ }
  236. X+ 
  237. X+ /* turn off the update buttons in all the widgets */
  238. X+ static void
  239. X+ clr_all_update()
  240. X+ {
  241. X+     int i;
  242. X+ 
  243. X+     for (i = 0; i < NUM_IND_SW; ++i) {
  244. X+     cur_updatemask = 0;            /* turn all off */
  245. X+     if (ind_switches[i].updbut == NULL)
  246. X+         continue;
  247. X+     ind_switches[i].update = False;
  248. X+     FirstArg(XtNstate, False);
  249. X+     SetValues(ind_switches[i].updbut);
  250. X+     }
  251. X+     put_msg("Update commands will be IGNORED for all buttons");
  252. X+ }
  253. X+ 
  254. X  manage_update_buts()
  255. X  {
  256. X      int            i;
  257. X***************
  258. X*** 437,442 ****
  259. X--- 579,585 ----
  260. X      Display       *d = tool_d;
  261. X      Screen       *s = tool_s;
  262. X      Pixmap        p;
  263. X+     Pixel        fg,bg;
  264. X  
  265. X      /* get the foreground and background from the indicator widget */
  266. X      /* and create a gc with those values */
  267. X***************
  268. X*** 481,486 ****
  269. X--- 624,655 ----
  270. X      }
  271. X      XtInstallAllAccelerators(ind_panel, tool);
  272. X  
  273. X+     /* now put cute little images in them (full box (set), empty box (clear)
  274. X+     and half full (toggle) */
  275. X+     FirstArg(XtNforeground, &fg);
  276. X+     NextArg(XtNbackground, &bg);
  277. X+     for (i = 0; i < NUM_IND_SW; ++i)        /* find one of the update buttons */
  278. X+     if (ind_switches[i].func & I_UPDATEMASK) { /* and get its bg color */
  279. X+         GetValues(ind_switches[i].updbut);
  280. X+         break;
  281. X+     }
  282. X+ 
  283. X+     p = XCreatePixmapFromBitmapData(tool_d, XtWindow(ind_panel),
  284. X+             (char *) set_bits, 10, 10, fg, bg,
  285. X+             DefaultDepthOfScreen(tool_s));
  286. X+     FirstArg(XtNbitmap, p);
  287. X+     SetValues(set_upd);
  288. X+     p = XCreatePixmapFromBitmapData(tool_d, XtWindow(ind_panel),
  289. X+             (char *) clr_bits, 10, 10, fg, bg,
  290. X+             DefaultDepthOfScreen(tool_s));
  291. X+     FirstArg(XtNbitmap, p);
  292. X+     SetValues(clr_upd);
  293. X+     p = XCreatePixmapFromBitmapData(tool_d, XtWindow(ind_panel),
  294. X+             (char *) tog_bits, 10, 10, fg, bg,
  295. X+             DefaultDepthOfScreen(tool_s));
  296. X+     FirstArg(XtNbitmap, p);
  297. X+     SetValues(tog_upd);
  298. X+ 
  299. X      XDefineCursor(d, XtWindow(ind_panel), arrow_cursor);
  300. X      update_current_settings();
  301. X  
  302. X***************
  303. X*** 698,705 ****
  304. X  
  305. X      for (i = 0; i < isw->numchoices; tmp_choice++, i++) {
  306. X      if (isw->func == I_FILLSTYLE)
  307. X!         p = ((cur_color==BLACK || cur_color==DEFAULT_COLOR ||
  308. X!          (!all_colors_available && cur_color!=WHITE))?
  309. X          fillstyle_choices[i].blackPM :fillstyle_choices[i].normalPM);
  310. X      else if (isw->func == I_COLOR) {
  311. X          p = 0;
  312. X--- 867,873 ----
  313. X  
  314. X      for (i = 0; i < isw->numchoices; tmp_choice++, i++) {
  315. X      if (isw->func == I_FILLSTYLE)
  316. X!         p = (cur_color==BLACK || cur_color==DEFAULT_COLOR?
  317. X          fillstyle_choices[i].blackPM :fillstyle_choices[i].normalPM);
  318. X      else if (isw->func == I_COLOR) {
  319. X          p = 0;
  320. X***************
  321. X*** 737,746 ****
  322. X              form_fg = appres.color[BLACK];
  323. X              NextArg(XtNforeground, form_fg);
  324. X              NextArg(XtNbackground, appres.color[i]);
  325. X          }
  326. X          NextArg(XtNlabel, colorNames[i + 1]);
  327. X          } else {        /* it's the default color */
  328. X!         NextArg(XtNforeground, x_fg_color.pixel);
  329. X          NextArg(XtNlabel, colorNames[0]);
  330. X          }
  331. X      }
  332. X--- 905,923 ----
  333. X              form_fg = appres.color[BLACK];
  334. X              NextArg(XtNforeground, form_fg);
  335. X              NextArg(XtNbackground, appres.color[i]);
  336. X+         } else {
  337. X+             if (i == BLACK) {
  338. X+             NextArg(XtNforeground, appres.color[WHITE]);
  339. X+             NextArg(XtNbackground, appres.color[BLACK]);
  340. X+             } else {
  341. X+             NextArg(XtNforeground, appres.color[BLACK]);
  342. X+             NextArg(XtNbackground, appres.color[WHITE]);
  343. X+             }
  344. X          }
  345. X          NextArg(XtNlabel, colorNames[i + 1]);
  346. X          } else {        /* it's the default color */
  347. X!         NextArg(XtNbackground, x_fg_color.pixel);
  348. X!         NextArg(XtNforeground, x_bg_color.pixel);
  349. X          NextArg(XtNlabel, colorNames[0]);
  350. X          }
  351. X      }
  352. X***************
  353. X*** 823,831 ****
  354. X      Widget        w;
  355. X      XButtonEvent   *ev;
  356. X  {
  357. X-     int            new_i_value;
  358. X-     float        new_f_value;
  359. X- 
  360. X      if (hidden_text_flag)
  361. X      cur_textflags |= HIDDEN_TEXT;
  362. X      else
  363. X--- 1000,1005 ----
  364. X***************
  365. X*** 1330,1345 ****
  366. X  {
  367. X      update_choice_pixmap(sw, cur_valign);
  368. X      switch (cur_valign) {
  369. X!     case NONE:
  370. X      put_msg("No vertical alignment");
  371. X      break;
  372. X!     case TOP:
  373. X      put_msg("Vertically align to TOP");
  374. X      break;
  375. X!     case CENTER:
  376. X      put_msg("Center vertically when aligning");
  377. X      break;
  378. X!     case BOTTOM:
  379. X      put_msg("Vertically align to BOTTOM");
  380. X      break;
  381. X      }
  382. X--- 1504,1519 ----
  383. X  {
  384. X      update_choice_pixmap(sw, cur_valign);
  385. X      switch (cur_valign) {
  386. X!     case ALIGN_NONE:
  387. X      put_msg("No vertical alignment");
  388. X      break;
  389. X!     case ALIGN_TOP:
  390. X      put_msg("Vertically align to TOP");
  391. X      break;
  392. X!     case ALIGN_CENTER:
  393. X      put_msg("Center vertically when aligning");
  394. X      break;
  395. X!     case ALIGN_BOTTOM:
  396. X      put_msg("Vertically align to BOTTOM");
  397. X      break;
  398. X      }
  399. X***************
  400. X*** 1353,1368 ****
  401. X  {
  402. X      update_choice_pixmap(sw, cur_halign);
  403. X      switch (cur_halign) {
  404. X!     case NONE:
  405. X      put_msg("No horizontal alignment");
  406. X      break;
  407. X!     case LEFT:
  408. X      put_msg("Horizontally align to LEFT");
  409. X      break;
  410. X!     case CENTER:
  411. X      put_msg("Center horizontally when aligning");
  412. X      break;
  413. X!     case RIGHT:
  414. X      put_msg("Horizontally align to RIGHT");
  415. X      break;
  416. X      }
  417. X--- 1527,1542 ----
  418. X  {
  419. X      update_choice_pixmap(sw, cur_halign);
  420. X      switch (cur_halign) {
  421. X!     case ALIGN_NONE:
  422. X      put_msg("No horizontal alignment");
  423. X      break;
  424. X!     case ALIGN_LEFT:
  425. X      put_msg("Horizontally align to LEFT");
  426. X      break;
  427. X!     case ALIGN_CENTER:
  428. X      put_msg("Center horizontally when aligning");
  429. X      break;
  430. X!     case ALIGN_RIGHT:
  431. X      put_msg("Horizontally align to RIGHT");
  432. X      break;
  433. X      }
  434. X***************
  435. X*** 1475,1481 ****
  436. X      show_boxradius(sw);
  437. X  }
  438. X  
  439. X! #define MAXRADIUS 30
  440. X  static
  441. X  show_boxradius(sw)
  442. X      ind_sw_info       *sw;
  443. X--- 1649,1656 ----
  444. X      show_boxradius(sw);
  445. X  }
  446. X  
  447. X! #define MAXRADIUS 100
  448. X! 
  449. X  static
  450. X  show_boxradius(sw)
  451. X      ind_sw_info       *sw;
  452. X***************
  453. X*** 1531,1539 ****
  454. X      ind_sw_info       *sw;
  455. X  {
  456. X      if (cur_fillstyle == 0) {
  457. X!     XCopyArea(tool_d, ((cur_color==BLACK ||
  458. X!            (cur_color==DEFAULT_COLOR && x_fg_color.pixel==appres.color[BLACK]) ||
  459. X!             (!all_colors_available && cur_color!=WHITE))? 
  460. X              fillstyle_choices[0].blackPM: fillstyle_choices[0].normalPM),
  461. X              sw->normalPM,
  462. X              ind_button_gc, 0, 0, 32, 32, 32, 0);
  463. X--- 1706,1713 ----
  464. X      ind_sw_info       *sw;
  465. X  {
  466. X      if (cur_fillstyle == 0) {
  467. X!     XCopyArea(tool_d, (cur_color==BLACK ||
  468. X!            (cur_color==DEFAULT_COLOR && x_fg_color.pixel==appres.color[BLACK])?
  469. X              fillstyle_choices[0].blackPM: fillstyle_choices[0].normalPM),
  470. X              sw->normalPM,
  471. X              ind_button_gc, 0, 0, 32, 32, 32, 0);
  472. X***************
  473. X*** 1540,1548 ****
  474. X      put_msg("NO-FILL MODE");
  475. X      } else {
  476. X      /* put the pixmap in the widget background */
  477. X!     XCopyArea(tool_d, ((cur_color==BLACK ||
  478. X!            (cur_color==DEFAULT_COLOR && x_fg_color.pixel==appres.color[BLACK]) ||
  479. X!             (!all_colors_available && cur_color!=WHITE))? 
  480. X                  fillstyle_choices[cur_fillstyle].blackPM:
  481. X                  fillstyle_choices[cur_fillstyle].normalPM),
  482. X              sw->normalPM,
  483. X--- 1714,1721 ----
  484. X      put_msg("NO-FILL MODE");
  485. X      } else {
  486. X      /* put the pixmap in the widget background */
  487. X!     XCopyArea(tool_d, (cur_color==BLACK ||
  488. X!            (cur_color==DEFAULT_COLOR && x_fg_color.pixel==appres.color[BLACK])?
  489. X                  fillstyle_choices[cur_fillstyle].blackPM:
  490. X                  fillstyle_choices[cur_fillstyle].normalPM),
  491. X              sw->normalPM,
  492. X***************
  493. X*** 1583,1592 ****
  494. X      int            color;
  495. X  
  496. X      if (cur_color < 0 || cur_color >= NUMCOLORS) {
  497. X!     cur_color == DEFAULT_COLOR;
  498. X      color = x_fg_color.pixel;
  499. X      } else
  500. X!     color = all_colors_available ? appres.color[cur_color] : x_fg_color.pixel;
  501. X  
  502. X      show_fillstyle(fill_style_sw);
  503. X      put_msg("Color set to %s", colorNames[cur_color + 1]);
  504. X--- 1756,1766 ----
  505. X      int            color;
  506. X  
  507. X      if (cur_color < 0 || cur_color >= NUMCOLORS) {
  508. X!     cur_color = DEFAULT_COLOR;
  509. X      color = x_fg_color.pixel;
  510. X      } else
  511. X!     color = all_colors_available ? appres.color[cur_color] : 
  512. X!             (cur_color == WHITE? x_bg_color.pixel: x_fg_color.pixel);
  513. X  
  514. X      show_fillstyle(fill_style_sw);
  515. X      put_msg("Color set to %s", colorNames[cur_color + 1]);
  516. X***************
  517. X*** 1686,1695 ****
  518. X      ind_sw_info       *sw;
  519. X  {
  520. X      if (using_ps) {
  521. X!     if (cur_ps_font >= NUM_PS_FONTS)
  522. X          cur_ps_font = DEFAULT;
  523. X      else if (cur_ps_font < DEFAULT)
  524. X!         cur_ps_font = NUM_PS_FONTS - 1;
  525. X      } else {
  526. X      if (cur_latex_font >= NUM_LATEX_FONTS)
  527. X          cur_latex_font = 0;
  528. X--- 1860,1869 ----
  529. X      ind_sw_info       *sw;
  530. X  {
  531. X      if (using_ps) {
  532. X!     if (cur_ps_font >= NUM_FONTS)
  533. X          cur_ps_font = DEFAULT;
  534. X      else if (cur_ps_font < DEFAULT)
  535. X!         cur_ps_font = NUM_FONTS - 1;
  536. X      } else {
  537. X      if (cur_latex_font >= NUM_LATEX_FONTS)
  538. X          cur_latex_font = 0;
  539. Xdiff -rc xfig.2.1.7a/w_indpanel.h xfig.2.1.8/w_indpanel.h
  540. X*** xfig.2.1.7a/w_indpanel.h    Fri Feb 12 09:04:25 1993
  541. X--- xfig.2.1.8/w_indpanel.h    Fri Jun 18 18:47:42 1993
  542. X***************
  543. X*** 89,91 ****
  544. X--- 89,93 ----
  545. X  
  546. X  #define ZOOM_SWITCH_INDEX    0    /* used by w_zoom.c */
  547. X  extern ind_sw_info ind_switches[];
  548. X+ 
  549. X+ extern Widget        upd_ctrl;
  550. Xdiff -rc xfig.2.1.7a/w_modepanel.c xfig.2.1.8/w_modepanel.c
  551. X*** xfig.2.1.7a/w_modepanel.c    Fri Feb 12 09:04:26 1993
  552. X--- xfig.2.1.8/w_modepanel.c    Tue Jun 29 14:42:23 1993
  553. X***************
  554. X*** 57,62 ****
  555. X--- 57,96 ----
  556. X  extern          arrow_head_selected();
  557. X  extern          edit_item_selected();
  558. X  extern          update_selected();
  559. X+ static stub_circlebyradius_drawing_selected();
  560. X+ static stub_circlebydiameter_drawing_selected();
  561. X+ static stub_ellipsebyradius_drawing_selected();
  562. X+ static stub_ellipsebydiameter_drawing_selected();
  563. X+ static stub_box_drawing_selected();
  564. X+ static stub_arcbox_drawing_selected();
  565. X+ static stub_line_drawing_selected();
  566. X+ static stub_poly_drawing_selected();
  567. X+ static stub_regpoly_drawing_selected();
  568. X+ static stub_epsobj_drawing_selected();
  569. X+ static stub_text_drawing_selected();
  570. X+ static stub_arc_drawing_selected();
  571. X+ static stub_spline_drawing_selected();
  572. X+ static stub_cl_spline_drawing_selected();
  573. X+ static stub_intspline_drawing_selected();
  574. X+ static stub_cl_intspline_drawing_selected();
  575. X+ static stub_align_selected();
  576. X+ static stub_compound_selected();
  577. X+ static stub_break_selected();
  578. X+ static stub_scale_selected();
  579. X+ static stub_point_adding_selected();
  580. X+ static stub_delete_point_selected();
  581. X+ static stub_move_selected();
  582. X+ static stub_move_point_selected();
  583. X+ static stub_delete_selected();
  584. X+ static stub_copy_selected();
  585. X+ static stub_rotate_cw_selected();
  586. X+ static stub_rotate_ccw_selected();
  587. X+ static stub_flip_ud_selected();
  588. X+ static stub_flip_lr_selected();
  589. X+ static stub_convert_selected();
  590. X+ static stub_arrow_head_selected();
  591. X+ static stub_edit_item_selected();
  592. X+ static stub_update_selected();
  593. X  
  594. X  /**************        local variables and routines   **************/
  595. X  
  596. X***************
  597. X*** 154,160 ****
  598. X      I_MIN1 | I_LINEWIDTH, "ADD/DELETE ARROWs",},
  599. X  };
  600. X  
  601. X! #define        NUM_MODE_SW    (sizeof(mode_switches) / sizeof(mode_sw_info))
  602. X  
  603. X  static Arg      button_args[] =
  604. X  {
  605. X--- 188,194 ----
  606. X      I_MIN1 | I_LINEWIDTH, "ADD/DELETE ARROWs",},
  607. X  };
  608. X  
  609. X! int    NUM_MODE_SW = (sizeof(mode_switches) / sizeof(mode_sw_info));
  610. X  
  611. X  static Arg      button_args[] =
  612. X  {
  613. X***************
  614. X*** 178,183 ****
  615. X--- 212,251 ----
  616. X      {"ReleaseMiddle", (XtActionProc) clear_middle},
  617. X      {"PressRight", (XtActionProc) notused_right},
  618. X      {"ReleaseRight", (XtActionProc) clear_right},
  619. X+     {"ModeCircleR", (XtActionProc) stub_circlebyradius_drawing_selected},
  620. X+     {"ModeCircleD", (XtActionProc) stub_circlebydiameter_drawing_selected},
  621. X+     {"ModeEllipseR", (XtActionProc) stub_ellipsebyradius_drawing_selected},
  622. X+     {"ModeEllipseD", (XtActionProc) stub_ellipsebydiameter_drawing_selected},
  623. X+     {"ModeBox", (XtActionProc) stub_box_drawing_selected},
  624. X+     {"ModeArcBox", (XtActionProc) stub_arcbox_drawing_selected},
  625. X+     {"ModeLine", (XtActionProc) stub_line_drawing_selected},
  626. X+     {"ModePoly", (XtActionProc) stub_poly_drawing_selected},
  627. X+     {"ModeRegPoly", (XtActionProc) stub_regpoly_drawing_selected},
  628. X+     {"ModeEPS", (XtActionProc) stub_epsobj_drawing_selected},
  629. X+     {"ModeText", (XtActionProc) stub_text_drawing_selected},
  630. X+     {"ModeArc", (XtActionProc) stub_arc_drawing_selected},
  631. X+     {"ModeSpline", (XtActionProc) stub_spline_drawing_selected},
  632. X+     {"ModeClSpline", (XtActionProc) stub_cl_spline_drawing_selected},
  633. X+     {"ModeIntSpline", (XtActionProc) stub_intspline_drawing_selected},
  634. X+     {"ModeClIntSpline", (XtActionProc) stub_cl_intspline_drawing_selected},
  635. X+     {"ModeAlign", (XtActionProc) stub_align_selected},
  636. X+     {"ModeCompound", (XtActionProc) stub_compound_selected},
  637. X+     {"ModeBreakCompound", (XtActionProc) stub_break_selected},
  638. X+     {"ModeScale", (XtActionProc) stub_scale_selected},
  639. X+     {"ModeAddPoint", (XtActionProc) stub_point_adding_selected},
  640. X+     {"ModeDeletePoint", (XtActionProc) stub_delete_point_selected},
  641. X+     {"ModeMoveObject", (XtActionProc) stub_move_selected},
  642. X+     {"ModeMovePoint", (XtActionProc) stub_move_point_selected},
  643. X+     {"ModeDeleteObject", (XtActionProc) stub_delete_selected},
  644. X+     {"ModeCopyObject", (XtActionProc) stub_copy_selected},
  645. X+     {"ModeRotateObjectCW", (XtActionProc) stub_rotate_cw_selected},
  646. X+     {"ModeRotateObjectCCW", (XtActionProc) stub_rotate_ccw_selected},
  647. X+     {"ModeFlipObjectUD", (XtActionProc) stub_flip_ud_selected},
  648. X+     {"ModeFlipObjectLR", (XtActionProc) stub_flip_lr_selected},
  649. X+     {"ModeConvertObject", (XtActionProc) stub_convert_selected},
  650. X+     {"ModeArrow", (XtActionProc) stub_arrow_head_selected},
  651. X+     {"ModeEditObject", (XtActionProc) stub_edit_item_selected},
  652. X+     {"ModeUpdateObject", (XtActionProc) stub_update_selected},
  653. X  };
  654. X  
  655. X  static String   mode_translations =
  656. X***************
  657. X*** 194,200 ****
  658. X  init_mode_panel(tool)
  659. X      TOOL            tool;
  660. X  {
  661. X!     register int    i;
  662. X      register mode_sw_info *sw;
  663. X  
  664. X      FirstArg(XtNwidth, MODEPANEL_WD);
  665. X--- 262,268 ----
  666. X  init_mode_panel(tool)
  667. X      TOOL            tool;
  668. X  {
  669. X!     register int    i, numindraw;
  670. X      register mode_sw_info *sw;
  671. X  
  672. X      FirstArg(XtNwidth, MODEPANEL_WD);
  673. X***************
  674. X*** 227,232 ****
  675. X--- 295,301 ----
  676. X          d_label = XtCreateManagedWidget("label", labelWidgetClass,
  677. X                          mode_panel, Args, ArgCount);
  678. X      } else if (sw->mode == FIRST_EDIT_MODE) {
  679. X+         numindraw = i;    /* this is the number of btns in drawing mode area */
  680. X          /* assume Args still set up from d_label */
  681. X          ArgCount -= 2;
  682. X          NextArg(XtNheight, (MODEPANEL_SPACE) / 2);
  683. X***************
  684. X*** 332,341 ****
  685. X      if (xbutton.button == Button1) {    /* left button */
  686. X      turn_off_current();
  687. X      turn_on(msw);
  688. X!     /* turn off the update boxes if not in update mode */
  689. X!     if (msw->mode != F_UPDATE)
  690. X          unmanage_update_buts();
  691. X!     update_indpanel(msw->indmask);
  692. X      put_msg(msw->modemsg);
  693. X      if ((cur_mode == F_GLUE || cur_mode == F_BREAK) &&
  694. X          msw->mode != F_GLUE &&
  695. X--- 401,422 ----
  696. X      if (xbutton.button == Button1) {    /* left button */
  697. X      turn_off_current();
  698. X      turn_on(msw);
  699. X!     if (msw->mode == F_UPDATE) {    /* map the set/clr/toggle button for update */
  700. X!         if (cur_mode != F_UPDATE) {
  701. X!         update_indpanel(0);    /* first remove ind buttons */
  702. X!         XtManageChild(upd_ctrl);
  703. X!         update_indpanel(msw->indmask);    /* now manage the relevant buttons */
  704. X!         }
  705. X!     } else {     /* turn off the update boxes if not in update mode */
  706. X!         if (cur_mode == F_UPDATE) {    /* if previous mode is update and current */
  707. X!         update_indpanel(0);    /* is not, first remove ind buttons */
  708. X          unmanage_update_buts();
  709. X!         XtUnmanageChild(upd_ctrl);
  710. X!         update_indpanel(msw->indmask);    /* now manage the relevant buttons */
  711. X!         } else {
  712. X!         update_indpanel(msw->indmask);    /* just update indicator buttons */
  713. X!         }
  714. X!     }
  715. X      put_msg(msw->modemsg);
  716. X      if ((cur_mode == F_GLUE || cur_mode == F_BREAK) &&
  717. X          msw->mode != F_GLUE &&
  718. X***************
  719. X*** 402,405 ****
  720. X--- 483,670 ----
  721. X      FirstArg(XtNbackgroundPixmap, current->normalPM);
  722. X      SetValues(current->widget);
  723. X      }
  724. X+ }
  725. X+ 
  726. X+ change_mode(icon)
  727. X+ PIXRECT icon;
  728. X+ {
  729. X+     int i;
  730. X+     XButtonEvent ev; /* To fake an event with */
  731. X+ 
  732. X+     ev.button = Button1;
  733. X+     for (i = 0; i < NUM_MODE_SW; ++i)
  734. X+     if (mode_switches[i].icon == icon) {
  735. X+         sel_mode_but(0,&mode_switches[i],&ev,0);
  736. X+         break;
  737. X+     }
  738. X+ }
  739. X+ 
  740. X+ static stub_circlebyradius_drawing_selected()
  741. X+ {
  742. X+     change_mode(&cirrad_ic);
  743. X+ }
  744. X+ 
  745. X+ static stub_circlebydiameter_drawing_selected()
  746. X+ {
  747. X+     change_mode(&cirdia_ic);
  748. X+ }
  749. X+ 
  750. X+ static stub_ellipsebyradius_drawing_selected()
  751. X+ {
  752. X+     change_mode(&ellrad_ic);
  753. X+ }
  754. X+ 
  755. X+ static stub_ellipsebydiameter_drawing_selected()
  756. X+ {
  757. X+     change_mode(&elldia_ic);
  758. X+ }
  759. X+ 
  760. X+ static stub_box_drawing_selected()
  761. X+ {
  762. X+     change_mode(&box_ic);
  763. X+ }
  764. X+ 
  765. X+ static stub_arcbox_drawing_selected()
  766. X+ {
  767. X+     change_mode(&arc_box_ic);
  768. X+ }
  769. X+ 
  770. X+ static stub_poly_drawing_selected()
  771. X+ {
  772. X+     change_mode(&polygon_ic);
  773. X+ }
  774. X+ 
  775. X+ static stub_line_drawing_selected()
  776. X+ {
  777. X+     change_mode(&line_ic);
  778. X+ }
  779. X+ 
  780. X+ static stub_regpoly_drawing_selected()
  781. X+ {
  782. X+     change_mode(®poly_ic);
  783. X+ }
  784. X+ 
  785. X+ static stub_epsobj_drawing_selected()
  786. X+ {
  787. X+     change_mode(&epsobj_ic);
  788. X+ }
  789. X+ 
  790. X+ static stub_text_drawing_selected()
  791. X+ {
  792. X+     change_mode(&text_ic);
  793. X+ }
  794. X+ 
  795. X+ static stub_arc_drawing_selected()
  796. X+ {
  797. X+     change_mode(&arc_ic);
  798. X+ }
  799. X+ 
  800. X+ static stub_cl_spline_drawing_selected()
  801. X+ {
  802. X+     change_mode(&c_spl_ic);
  803. X+ }
  804. X+ 
  805. X+ static stub_spline_drawing_selected()
  806. X+ {
  807. X+     change_mode(&spl_ic);
  808. X+ }
  809. X+ 
  810. X+ static stub_cl_intspline_drawing_selected()
  811. X+ {
  812. X+     change_mode(&c_intspl_ic);
  813. X+ }
  814. X+ 
  815. X+ static stub_intspline_drawing_selected()
  816. X+ {
  817. X+     change_mode(&intspl_ic);
  818. X+ }
  819. X+ 
  820. X+ static stub_align_selected()
  821. X+ {
  822. X+     change_mode(&align_ic);
  823. X+ }
  824. X+ 
  825. X+ static stub_compound_selected()
  826. X+ {
  827. X+     change_mode(&glue_ic);
  828. X+ }
  829. X+ 
  830. X+ static stub_break_selected()
  831. X+ {
  832. X+     change_mode(&break_ic);
  833. X+ }
  834. X+ 
  835. X+ static stub_scale_selected()
  836. X+ {
  837. X+     change_mode(&scale_ic);
  838. X+ }
  839. X+ 
  840. X+ static stub_point_adding_selected()
  841. X+ {
  842. X+     change_mode(&addpt_ic);
  843. X+ }
  844. X+ 
  845. X+ static stub_delete_point_selected()
  846. X+ {
  847. X+     change_mode(&deletept_ic);
  848. X+ }
  849. X+ 
  850. X+ static stub_move_selected()
  851. X+ {
  852. X+     change_mode(&move_ic);
  853. X+ }
  854. X+ 
  855. X+ static stub_move_point_selected()
  856. X+ {
  857. X+     change_mode(&movept_ic);
  858. X+ }
  859. X+ 
  860. X+ static stub_delete_selected()
  861. X+ {
  862. X+     change_mode(&delete_ic);
  863. X+ }
  864. X+ 
  865. X+ static stub_copy_selected()
  866. X+ {
  867. X+     change_mode(©_ic);
  868. X+ }
  869. X+ 
  870. X+ static stub_rotate_cw_selected()
  871. X+ {
  872. X+     change_mode(&rotCW_ic);
  873. X+ }
  874. X+ 
  875. X+ static stub_rotate_ccw_selected()
  876. X+ {
  877. X+     change_mode(&rotCCW_ic);
  878. X+ }
  879. X+ 
  880. X+ static stub_flip_ud_selected()
  881. X+ {
  882. X+     change_mode(&flip_y_ic);
  883. X+ }
  884. X+ 
  885. X+ static stub_flip_lr_selected()
  886. X+ {
  887. X+     change_mode(&flip_x_ic);
  888. X+ }
  889. X+ 
  890. X+ static stub_convert_selected()
  891. X+ {
  892. X+     change_mode(&convert_ic);
  893. X+ }
  894. X+ 
  895. X+ static stub_arrow_head_selected()
  896. X+ {
  897. X+     change_mode(&autoarrow_ic);
  898. X+ }
  899. X+ 
  900. X+ static stub_edit_item_selected()
  901. X+ {
  902. X+     change_mode(&change_ic);
  903. X+ }
  904. X+ 
  905. X+ static stub_update_selected()
  906. X+ {
  907. X+     change_mode(&update_ic);
  908. X  }
  909. Xdiff -rc xfig.2.1.7a/w_mousefun.c xfig.2.1.8/w_mousefun.c
  910. X*** xfig.2.1.7a/w_mousefun.c    Fri Feb 19 14:35:36 1993
  911. X--- xfig.2.1.8/w_mousefun.c    Tue Aug 24 15:23:21 1993
  912. X***************
  913. X*** 148,154 ****
  914. X  void
  915. X  draw_mousefun_mode()
  916. X  {
  917. X-     clear_mousefun();
  918. X      draw_mousefun("Change Mode", "", "");
  919. X  }
  920. X  
  921. X--- 148,153 ----
  922. X***************
  923. X*** 155,161 ****
  924. X  void
  925. X  draw_mousefun_ind()
  926. X  {
  927. X-     clear_mousefun();
  928. X      draw_mousefun("Menu", "Dec/Prev", "Inc/Next");
  929. X  }
  930. X  
  931. X--- 154,159 ----
  932. X***************
  933. X*** 162,168 ****
  934. X  void
  935. X  draw_mousefun_unitbox()
  936. X  {
  937. X-     clear_mousefun();
  938. X      draw_mousefun("Pan to Origin", "", "Set Units/Scale");
  939. X  }
  940. X  
  941. X--- 160,165 ----
  942. X***************
  943. X*** 169,175 ****
  944. X  void
  945. X  draw_mousefun_topruler()
  946. X  {
  947. X-     clear_mousefun();
  948. X      draw_mousefun("Pan Left", "Drag", "Pan Right");
  949. X  }
  950. X  
  951. X--- 166,171 ----
  952. X***************
  953. X*** 176,182 ****
  954. X  void
  955. X  draw_mousefun_sideruler()
  956. X  {
  957. X-     clear_mousefun();
  958. X      draw_mousefun("Pan Up", "Drag", "Pan Down");
  959. X  }
  960. X  
  961. X--- 172,177 ----
  962. X***************
  963. X*** 183,189 ****
  964. X  void
  965. X  draw_mousefun_canvas()
  966. X  {
  967. X-     clear_mousefun();
  968. X      draw_mousefun(mousefun_l, mousefun_m, mousefun_r);
  969. X  }
  970. X  
  971. X--- 178,183 ----
  972. X***************
  973. X*** 203,208 ****
  974. X--- 197,210 ----
  975. X  draw_mousefun(left, middle, right)
  976. X      char       *left, *middle, *right;
  977. X  {
  978. X+     clear_mousefun();
  979. X+     draw_mousefn2(left, middle, right);
  980. X+ }
  981. X+ 
  982. X+ void
  983. X+ draw_mousefn2(left, middle, right)
  984. X+     char       *left, *middle, *right;
  985. X+ {
  986. X      draw_mousefun_msg(left, MOUSE_LEFT_CTR, 30);
  987. X      draw_mousefun_msg(middle, MOUSE_MID_CTR, 11);
  988. X      draw_mousefun_msg(right, MOUSE_RIGHT_CTR, 30);
  989. X***************
  990. X*** 255,261 ****
  991. X  void
  992. X  clear_mousefun()
  993. X  {
  994. X!     draw_mousefun(lr_blank, mid_blank, lr_blank);
  995. X      /* redraw the title in case the blanks overwrite it */
  996. X      mouse_title();
  997. X  }
  998. X--- 257,263 ----
  999. X  void
  1000. X  clear_mousefun()
  1001. X  {
  1002. X!     draw_mousefn2(lr_blank, mid_blank, lr_blank);
  1003. X      /* redraw the title in case the blanks overwrite it */
  1004. X      mouse_title();
  1005. X  }
  1006. Xdiff -rc xfig.2.1.7a/w_mousefun.h xfig.2.1.8/w_mousefun.h
  1007. X*** xfig.2.1.7a/w_mousefun.h    Wed Dec  9 17:36:27 1992
  1008. X--- xfig.2.1.8/w_mousefun.h    Tue Aug 24 15:23:43 1993
  1009. X***************
  1010. X*** 20,25 ****
  1011. X--- 20,26 ----
  1012. X  void        draw_mousefun_sideruler();
  1013. X  void        draw_mousefun_canvas();
  1014. X  void        draw_mousefun();
  1015. X+ void        draw_mousefn2();
  1016. X  void        clear_mousefun();
  1017. X  void        notused_middle();
  1018. X  void        clear_middle();
  1019. Xdiff -rc xfig.2.1.7a/w_msgpanel.c xfig.2.1.8/w_msgpanel.c
  1020. X*** xfig.2.1.7a/w_msgpanel.c    Tue Mar 23 10:59:07 1993
  1021. X--- xfig.2.1.8/w_msgpanel.c    Tue Aug 31 09:47:23 1993
  1022. X***************
  1023. X*** 23,28 ****
  1024. X--- 23,32 ----
  1025. X  #include "w_setup.h"
  1026. X  #include <varargs.h>
  1027. X  
  1028. X+ /********************* IMPORTS *******************/
  1029. X+ 
  1030. X+ extern char    *basename();
  1031. END_OF_FILE
  1032.   if test 28511 -ne `wc -c <'xfig.08'`; then
  1033.     echo shar: \"'xfig.08'\" unpacked with wrong size!
  1034.   fi
  1035.   # end of 'xfig.08'
  1036. fi
  1037. echo shar: End of archive 13 \(of 16\).
  1038. cp /dev/null ark13isdone
  1039. MISSING=""
  1040. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; do
  1041.     if test ! -f ark${I}isdone ; then
  1042.     MISSING="${MISSING} ${I}"
  1043.     fi
  1044. done
  1045. if test "${MISSING}" = "" ; then
  1046.     echo You have unpacked all 16 archives.
  1047.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1048.     echo Creating merged patch file xfig.p2
  1049.     cat xfig.[01][0-9] > xfig.p2
  1050.     rm -f xfig.[01][0-9]
  1051. else
  1052.     echo You still must unpack the following archives:
  1053.     echo "        " ${MISSING}
  1054. fi
  1055. exit 0
  1056. exit 0 # Just in case...
  1057. -- 
  1058.   // chris@Sterling.COM           | Send comp.sources.x submissions to:
  1059. \X/  Amiga - The only way to fly! |    sources-x@sterling.com
  1060.  "It's intuitively obvious to the |
  1061.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  1062.