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

  1. Newsgroups: comp.sources.x
  2. From: envbvs@epb12.lbl.gov (Brian V. Smith)
  3. Subject: v21i035:  xfig - Draw amd manipulate objects in an X-Window, Patch02o/16
  4. Message-ID: <1993Oct21.190000.7618@sparky.sterling.com>
  5. X-Md4-Signature: 7a2be6d7cd5cec74a682a444e018e2e4
  6. Sender: chris@sparky.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Thu, 21 Oct 1993 19:00:00 GMT
  9. Approved: chris@sterling.com
  10.  
  11. Submitted-by: envbvs@epb12.lbl.gov (Brian V. Smith)
  12. Posting-number: Volume 21, Issue 35
  13. Archive-name: xfig/patch02o
  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.06
  22. # Wrapped by chris@sparky on Thu Oct 21 13:40:08 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 15 (of 16)."'
  26. if test -f 'xfig.06' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'xfig.06'\"
  28. else
  29.   echo shar: Extracting \"'xfig.06'\" \(28226 characters\)
  30.   sed "s/^X//" >'xfig.06' <<'END_OF_FILE'
  31. X!     text_bound(t, &xmin, &ymin, &xmax, &ymax,
  32. X!         &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
  33. X      redisplay_zoomed_region(xmin, ymin, xmax, ymax);
  34. X  }
  35. X  
  36. X***************
  37. X*** 536,551 ****
  38. X      int            xmin2, ymin2, xmax2, ymax2;
  39. X      int            dum;
  40. X  
  41. X!     if (appres.textoutline) {
  42. X!     text_bound_both(t1, &xmin1, &ymin1, &xmax1, &ymax1,
  43. X!             &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
  44. X!     text_bound_both(t2, &xmin2, &ymin2, &xmax2, &ymax2,
  45. X!             &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
  46. X!     } else {
  47. X!     text_bound(t1, &xmin1, &ymin1, &xmax1, &ymax1);
  48. X!     text_bound(t2, &xmin2, &ymin2, &xmax2, &ymax2);
  49. X!     }
  50. X!     redisplay_regions(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2);
  51. X  }
  52. X  
  53. X  redisplay_regions(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2)
  54. X--- 532,543 ----
  55. X      int            xmin2, ymin2, xmax2, ymax2;
  56. X      int            dum;
  57. X  
  58. X!     text_bound(t1, &xmin1, &ymin1, &xmax1, &ymax1,
  59. X!         &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
  60. X!     text_bound(t2, &xmin2, &ymin2, &xmax2, &ymax2,
  61. X!         &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
  62. X!     redisplay_regions(xmin1, ymin1, xmax1, ymax1,
  63. X!               xmin2, ymin2, xmax2, ymax2);
  64. X  }
  65. X  
  66. X  redisplay_regions(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2)
  67. Xdiff -rc xfig.2.1.7a/u_search.c xfig.2.1.8/u_search.c
  68. X*** xfig.2.1.7a/u_search.c    Fri Jan  8 11:20:18 1993
  69. X--- xfig.2.1.8/u_search.c    Tue Aug 31 13:38:01 1993
  70. X***************
  71. X*** 27,32 ****
  72. X--- 27,33 ----
  73. X  static long    objectcount;
  74. X  static long    n;
  75. X  static int    csr_x, csr_y;
  76. X+ Boolean        in_text_bound();
  77. X  
  78. X  static F_point    point1, point2;
  79. X  
  80. X***************
  81. X*** 215,222 ****
  82. X      int            x, y, tolerance, *px, *py;
  83. X      int            shift;
  84. X  {
  85. X-     int            halflen, dx, dy;
  86. X      int            txmin, txmax, tymin, tymax;
  87. X  
  88. X      if (!anytext_in_mask())
  89. X      return (0);
  90. X--- 216,223 ----
  91. X      int            x, y, tolerance, *px, *py;
  92. X      int            shift;
  93. X  {
  94. X      int            txmin, txmax, tymin, tymax;
  95. X+     int            dum;
  96. X  
  97. X      if (!anytext_in_mask())
  98. X      return (0);
  99. X***************
  100. X*** 228,234 ****
  101. X      for (; t != NULL; t = prev_text(objects.texts, t))
  102. X      if (validtext_in_mask(t)) {
  103. X          n++;
  104. X!         text_bound(t, &txmin, &tymin, &txmax, &tymax);
  105. X          if (x >= txmin-tolerance && x <= txmax+tolerance &&
  106. X              y >= tymin-tolerance && y <= tymax+tolerance) {
  107. X              *px = x;
  108. X--- 229,236 ----
  109. X      for (; t != NULL; t = prev_text(objects.texts, t))
  110. X      if (validtext_in_mask(t)) {
  111. X          n++;
  112. X!         text_bound(t, &txmin, &tymin, &txmax, &tymax,
  113. X!             &dum, &dum, &dum, &dum, &dum, &dum, &dum, &dum);
  114. X          if (x >= txmin-tolerance && x <= txmax+tolerance &&
  115. X              y >= tymin-tolerance && y <= tymax+tolerance) {
  116. X              *px = x;
  117. X***************
  118. X*** 752,775 ****
  119. X      do_point_search(x, y, shift);
  120. X  }
  121. X  
  122. X- /* =============================================================== */
  123. X- 
  124. X- /* These are some of the original search subroutines which are still in use */
  125. X- 
  126. X  F_text           *
  127. X! text_search(x, y)
  128. X!     int            x, y;
  129. X  {
  130. X      F_text       *t;
  131. X-     int            xmin, xmax, ymin, ymax;
  132. X  
  133. X      for (t = objects.texts; t != NULL; t = t->next) {
  134. X!     text_bound(t, &xmin, &ymin, &xmax, &ymax);
  135. X!     if (x >= xmin && x <= xmax &&
  136. X!         y >= ymin && y <= ymax)
  137. X          return(t);
  138. X      }
  139. X      return (NULL);
  140. X  }
  141. X  
  142. X  F_compound     *
  143. X--- 754,821 ----
  144. X      do_point_search(x, y, shift);
  145. X  }
  146. X  
  147. X  F_text           *
  148. X! text_search(x, y, posn)
  149. X!     int            x, y, *posn;
  150. X  {
  151. X      F_text       *t;
  152. X  
  153. X      for (t = objects.texts; t != NULL; t = t->next) {
  154. X!     if (in_text_bound(t, x, y, posn))
  155. X          return(t);
  156. X      }
  157. X      return (NULL);
  158. X+ }
  159. X+ 
  160. X+ /* return true if (x,y) is in the text rectangle by rotating the point (x,y) 
  161. X+    around the text base point by it's negative angle and seeing if that is
  162. X+    in the rectangle.
  163. X+    Additionally, set posn to the pixel position of the mouse from the beginning
  164. X+    of the string
  165. X+  */
  166. X+ 
  167. X+ Boolean
  168. X+ in_text_bound(t, x, y, posn)
  169. X+     F_text       *t;
  170. X+     int            x,y,*posn;
  171. X+ {
  172. X+     double        cost, sint;
  173. X+     int            xo,yo, xr,yr;
  174. X+     int            x1,y1, x2,y2;
  175. X+     int            l, h;
  176. X+ 
  177. X+     cost = cos((double) -t->angle);
  178. X+     sint = sin((double) -t->angle);
  179. X+     xo = t->base_x;
  180. X+     yo = t->base_y;
  181. X+     /* rotate the point (x,y) about (xo,yo) giving (xr,yr) */
  182. X+     xr = xo + (x-xo)*cost - (yo-y)*sint;
  183. X+     yr = yo - (yo-y)*cost - (x-xo)*sint;
  184. X+     /* now see if that point is in the text bounds of the unrotated text */
  185. X+     l = text_length(t);
  186. X+     h = t->height;
  187. X+     x1 = t->base_x;
  188. X+     y1 = t->base_y;
  189. X+     if (t->type == T_CENTER_JUSTIFIED) {
  190. X+     x2 = x1 + l/2;
  191. X+     x1 = x1 - l/2;
  192. X+     y2 = y1 - h;
  193. X+     }
  194. X+     else if (t->type == T_RIGHT_JUSTIFIED) {
  195. X+     x2 = x1;
  196. X+     x1 = x1 - l;
  197. X+     y2 = y1 - h;
  198. X+     }
  199. X+     else {
  200. X+     x2 = x1 + l;
  201. X+     y2 = y1 - h;
  202. X+     }
  203. X+     if (xr >= x1 && xr <= x2 && yr <= y1 && yr >= y2) {
  204. X+     /* return the pixel position from the beginning of the string */
  205. X+     *posn = xr-x1;
  206. X+     return True;
  207. X+     }
  208. X+     return False;
  209. X  }
  210. X  
  211. X  F_compound     *
  212. Xdiff -rc xfig.2.1.7a/u_undo.c xfig.2.1.8/u_undo.c
  213. X*** xfig.2.1.7a/u_undo.c    Thu Feb 11 12:11:05 1993
  214. X--- xfig.2.1.8/u_undo.c    Tue Aug 31 13:38:23 1993
  215. X***************
  216. X*** 39,49 ****
  217. X                  NULL, NULL, NULL, NULL, NULL, NULL, NULL};
  218. X  F_compound    object_tails = {0, { 0, 0 }, { 0, 0 }, 
  219. X                  NULL, NULL, NULL, NULL, NULL, NULL, NULL};
  220. X  
  221. X  /*************** LOCAL *****************/
  222. X  
  223. X  static int    last_object;
  224. X- static int    last_action = F_NULL;
  225. X  static F_pos    last_position, new_position;
  226. X  static int    last_arcpointnum;
  227. X  static F_point *last_prev_point, *last_selected_point, *last_next_point;
  228. X--- 39,49 ----
  229. X                  NULL, NULL, NULL, NULL, NULL, NULL, NULL};
  230. X  F_compound    object_tails = {0, { 0, 0 }, { 0, 0 }, 
  231. X                  NULL, NULL, NULL, NULL, NULL, NULL, NULL};
  232. X+ int        last_action = F_NULL;
  233. X  
  234. X  /*************** LOCAL *****************/
  235. X  
  236. X  static int    last_object;
  237. X  static F_pos    last_position, new_position;
  238. X  static int    last_arcpointnum;
  239. X  static F_point *last_prev_point, *last_selected_point, *last_next_point;
  240. X***************
  241. X*** 116,122 ****
  242. X  
  243. X      if (last_object == O_POLYLINE)
  244. X      linepoint_adding(saved_objects.lines, last_prev_point,
  245. X!              last_selected_point, last_next_point);
  246. X      else
  247. X      splinepoint_adding(saved_objects.splines, last_prev_point,
  248. X                 last_selected_point, last_next_point);
  249. X--- 116,122 ----
  250. X  
  251. X      if (last_object == O_POLYLINE)
  252. X      linepoint_adding(saved_objects.lines, last_prev_point,
  253. X!              last_selected_point);
  254. X      else
  255. X      splinepoint_adding(saved_objects.splines, last_prev_point,
  256. X                 last_selected_point, last_next_point);
  257. X***************
  258. X*** 203,209 ****
  259. X  
  260. X  undo_change()
  261. X  {
  262. X-     int            xmin, ymin, xmax, ymax;
  263. X      F_compound        swp_comp;
  264. X  
  265. X      last_action = F_NULL;    /* to avoid a clean-up during "unchange" */
  266. X--- 203,208 ----
  267. X***************
  268. X*** 372,388 ****
  269. X                xmin2, ymin2, xmax2, ymax2);
  270. X      break;
  271. X      case O_TEXT:
  272. X!     if (appres.textoutline) {
  273. X!         text_bound_both(saved_objects.texts, &xmin1, &ymin1, &xmax1, &ymax1,
  274. X!             &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
  275. X!         translate_text(saved_objects.texts, dx, dy);
  276. X!         text_bound_both(saved_objects.texts, &xmin2, &ymin2, &xmax2, &ymax2,
  277. X!             &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
  278. X!     } else {
  279. X!         text_bound(saved_objects.texts, &xmin1, &ymin1, &xmax1, &ymax1);
  280. X!         translate_text(saved_objects.texts, dx, dy);
  281. X!         text_bound(saved_objects.texts, &xmin2, &ymin2, &xmax2, &ymax2);
  282. X!     }
  283. X      redisplay_regions(xmin1, ymin1, xmax1, ymax1,
  284. X                xmin2, ymin2, xmax2, ymax2);
  285. X      break;
  286. X--- 371,381 ----
  287. X                xmin2, ymin2, xmax2, ymax2);
  288. X      break;
  289. X      case O_TEXT:
  290. X!     text_bound(saved_objects.texts, &xmin1, &ymin1, &xmax1, &ymax1,
  291. X!         &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
  292. X!     translate_text(saved_objects.texts, dx, dy);
  293. X!     text_bound(saved_objects.texts, &xmin2, &ymin2, &xmax2, &ymax2,
  294. X!         &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
  295. X      redisplay_regions(xmin1, ymin1, xmax1, ymax1,
  296. X                xmin2, ymin2, xmax2, ymax2);
  297. X      break;
  298. X***************
  299. X*** 415,421 ****
  300. X  undo_load()
  301. X  {
  302. X      F_compound        temp;
  303. X!     char        ctemp[128];
  304. X  
  305. X      temp = objects;
  306. X      objects = saved_objects;
  307. X--- 408,414 ----
  308. X  undo_load()
  309. X  {
  310. X      F_compound        temp;
  311. X!     char        ctemp[200];
  312. X  
  313. X      temp = objects;
  314. X      objects = saved_objects;
  315. Xdiff -rc xfig.2.1.7a/w_canvas.c xfig.2.1.8/w_canvas.c
  316. X*** xfig.2.1.7a/w_canvas.c    Wed Apr 28 11:29:27 1993
  317. X--- xfig.2.1.8/w_canvas.c    Wed Sep 15 13:48:48 1993
  318. X***************
  319. X*** 25,31 ****
  320. X  #include "w_util.h"
  321. X  #include "w_zoom.h"
  322. X  #ifndef SYSV
  323. X! #include "sys/time.h"
  324. X  #endif
  325. X  #include <X11/Xatom.h>
  326. X  
  327. X--- 25,31 ----
  328. X  #include "w_util.h"
  329. X  #include "w_zoom.h"
  330. X  #ifndef SYSV
  331. X! #include <sys/time.h>
  332. X  #endif
  333. X  #include <X11/Xatom.h>
  334. X  
  335. X***************
  336. X*** 125,130 ****
  337. X--- 125,131 ----
  338. X      <Key>F18: PasteCanv()\n\
  339. X      <EnterWindow>:EnterCanv()\n\
  340. X      <LeaveWindow>:LeaveCanv()EraseRulerMark()\n\
  341. X+     <KeyUp>:EventCanv()\n\
  342. X      ~Meta<Key>:EventCanv()\n\
  343. X      <Expose>:ExposeCanv()\n";
  344. X  
  345. X***************
  346. X*** 210,216 ****
  347. X  
  348. X      switch (event->type) {
  349. X      case MotionNotify:
  350. X! #if defined(SMOOTHMOTION) || defined(OPENWIN)
  351. X      /* translate from zoomed coords to object coords */
  352. X      x = BACKX(event->x);
  353. X      y = BACKY(event->y);
  354. X--- 211,217 ----
  355. X  
  356. X      switch (event->type) {
  357. X      case MotionNotify:
  358. X! #if defined(SMOOTHMOTION)
  359. X      /* translate from zoomed coords to object coords */
  360. X      x = BACKX(event->x);
  361. X      y = BACKY(event->y);
  362. X***************
  363. X*** 244,250 ****
  364. X          x = sx = cx;    /* these are zoomed */
  365. X          y = sy = cy;    /* coordinates!        */
  366. X      }
  367. X! #endif /* SMOOTHMOTION || OPENWIN */
  368. X      set_rulermark(x, y);
  369. X      (*canvas_locmove_proc) (x, y);
  370. X      break;
  371. X--- 245,251 ----
  372. X          x = sx = cx;    /* these are zoomed */
  373. X          y = sy = cy;    /* coordinates!        */
  374. X      }
  375. X! #endif /* SMOOTHMOTION */
  376. X      set_rulermark(x, y);
  377. X      (*canvas_locmove_proc) (x, y);
  378. X      break;
  379. X***************
  380. X*** 285,337 ****
  381. X          key == XK_Home ||
  382. X          key == XK_Multi_key ||
  383. X          key == XK_Alt_L ) {
  384. X!         switch (key) {
  385. X!         case XK_Left:
  386. X!         pan_left();
  387. X!         break;
  388. X!         case XK_Right:
  389. X!         pan_right();
  390. X!         break;
  391. X!         case XK_Up:
  392. X!         pan_up();
  393. X!         break;
  394. X!         case XK_Down:
  395. X!         pan_down();
  396. X!         break;
  397. X!         case XK_Home:
  398. X!         pan_origin();
  399. X!         break;
  400. X!         case XK_Multi_key:
  401. X!         case XK_Alt_L:
  402. X!         compose_key = 1;
  403. X!         break;
  404. X!         }
  405. X      } else {
  406. X!         switch (compose_key) {
  407. X!         case 0:
  408. X!         if (XLookupString(ke, buf, sizeof(buf), NULL, NULL) > 0)
  409. X!             (*canvas_kbd_proc) ((unsigned char) buf[0]);
  410. X!         break;
  411. X!         case 1:
  412. X!         if (XLookupString(ke, &compose_buf[0], 1, NULL, NULL)
  413. X!             > 0)
  414. X!             compose_key = 2;
  415. X!         break;
  416. X!         case 2:
  417. X!         if (XLookupString(ke, &compose_buf[1], 1, NULL, NULL)
  418. X!             > 0) {
  419. X!             if ((c = getComposeKey(compose_buf)) != '\0')
  420. X!             (*canvas_kbd_proc) (c);
  421. X!             else {
  422. X!             (*canvas_kbd_proc) ((unsigned char) compose_buf[0]);
  423. X!             (*canvas_kbd_proc) ((unsigned char) compose_buf[1]);
  424. X              }
  425. X!             compose_key = 0;
  426. X          }
  427. X!         break;
  428. X          }
  429. X      }
  430. X      break;
  431. X      }
  432. X  }
  433. X  
  434. X--- 286,363 ----
  435. X          key == XK_Home ||
  436. X          key == XK_Multi_key ||
  437. X          key == XK_Alt_L ) {
  438. X!             switch (key) {
  439. X!             case XK_Left:
  440. X!             pan_left();
  441. X!             break;
  442. X!             case XK_Right:
  443. X!             pan_right();
  444. X!             break;
  445. X!             case XK_Up:
  446. X!             pan_up();
  447. X!             break;
  448. X!             case XK_Down:
  449. X!             pan_down();
  450. X!             break;
  451. X!             case XK_Home:
  452. X!             pan_origin();
  453. X!             break;
  454. X!             case XK_Multi_key:
  455. X!             case XK_Alt_L:
  456. X!             compose_key = 1;
  457. X!             break;
  458. X!         }
  459. X!     } else if (key == XK_Control_L || key == XK_Control_R) { 
  460. X!         /* show the control-key actions */
  461. X!         draw_mousefun("Zoom area", "Pan to origin", "Unzoom");
  462. X!     } else if (key == XK_Shift_L || key == XK_Shift_R) {
  463. X!         /* show the shift-key function, but only if an edit mode */
  464. X!         if (cur_mode >= FIRST_EDIT_MODE)
  465. X!             draw_mousefun("Locate object", "Locate object", "");
  466. X      } else {
  467. X!         if (canvas_kbd_proc != null_proc) {
  468. X!         switch (compose_key) {
  469. X!         case 0:
  470. X!             if (XLookupString(ke, buf, sizeof(buf), NULL, NULL) > 0)
  471. X!             (*canvas_kbd_proc) ((unsigned char) buf[0]);
  472. X!             break;
  473. X!         case 1:
  474. X!             if (XLookupString(ke, &compose_buf[0], 1, NULL, NULL)
  475. X!             > 0)
  476. X!             compose_key = 2;
  477. X!             break;
  478. X!         case 2:
  479. X!             if (XLookupString(ke, &compose_buf[1], 1, NULL, NULL)
  480. X!             > 0) {
  481. X!             if ((c = getComposeKey(compose_buf)) != '\0')
  482. X!                 (*canvas_kbd_proc) (c);
  483. X!             else {
  484. X!                 (*canvas_kbd_proc) ((unsigned char) compose_buf[0]);
  485. X!                 (*canvas_kbd_proc) ((unsigned char) compose_buf[1]);
  486. X!             }
  487. X!             compose_key = 0;
  488. X              }
  489. X!             break;
  490. X          }
  491. X!         } else {
  492. X!         /* Be cheeky... we aren't going to do anything, so pass the
  493. X!          * key on to the mode_panel window by rescheduling the event
  494. X!          * The message window might treat it as a hotkey!
  495. X!          */
  496. X!         ke->window = XtWindow(mode_panel);
  497. X!         ke->subwindow = 0;
  498. X!         XPutBackEvent(ke->display,(XEvent *)ke);
  499. X          }
  500. X      }
  501. X      break;
  502. X+ 
  503. X+     case KeyRelease:
  504. X+     /* if user is releasing Control or Shift keys redisplay original function */
  505. X+     key = XLookupKeysym(ke, 0);
  506. X+         if (key == XK_Control_L || key == XK_Control_R ||
  507. X+         key == XK_Shift_L || key == XK_Shift_R)
  508. X+         draw_mousefun_canvas();
  509. X+     break;
  510. X      }
  511. X  }
  512. X  
  513. X***************
  514. X*** 363,373 ****
  515. X          event_time = paste_event->time;
  516. X         else
  517. X          time((time_t *) &event_time);
  518. X-     /***
  519. X-     This doesn't seem to work:
  520. X-     XtGetSelectionValue(w, XInternAtom(XtDisplay(w), "XA_PRIMARY", False),
  521. X-         XA_STRING, get_canvas_clipboard, NULL, event_time);
  522. X-     ***/
  523. X      XtGetSelectionValue(w, XA_PRIMARY,
  524. X          XA_STRING, get_canvas_clipboard, NULL, event_time);
  525. X  }
  526. X--- 389,394 ----
  527. Xdiff -rc xfig.2.1.7a/w_cmdpanel.c xfig.2.1.8/w_cmdpanel.c
  528. X*** xfig.2.1.7a/w_cmdpanel.c    Mon Feb 22 17:47:03 1993
  529. X--- xfig.2.1.8/w_cmdpanel.c    Tue Aug 31 10:02:33 1993
  530. X***************
  531. X*** 22,27 ****
  532. X--- 22,28 ----
  533. X  
  534. X  extern        erase_objecthighlight();
  535. X  extern        emptyfigure();
  536. X+ extern Boolean    query_save();
  537. X  extern        do_print(), do_print_batch(), do_export(), do_save();
  538. X  extern void    undo(), redisplay_canvas();
  539. X  extern void    popup_print_panel(), popup_file_panel(), popup_export_panel();
  540. X***************
  541. X*** 158,166 ****
  542. X      sw = &cmd_switches[i];
  543. X      FirstArg(XtNfont, button_font); /* label font */
  544. X      SetValues(sw->widget);
  545. X-     /* install the keyboard accelerators for this command button 
  546. X-        from the resources */
  547. X-     /*XtInstallAllAccelerators(sw->widget, tool);*/
  548. X      }
  549. X  }
  550. X  
  551. X--- 159,164 ----
  552. X***************
  553. X*** 172,178 ****
  554. X      Boolean*        continue_to_dispatch;
  555. X  {
  556. X      cmd_sw_info *sw = (cmd_sw_info *) closure;
  557. X-     clear_mousefun();
  558. X      draw_mousefun(sw->mousefun_l, "", sw->mousefun_r);
  559. X  }
  560. X  
  561. X--- 170,175 ----
  562. X***************
  563. X*** 216,240 ****
  564. X  quit(w)
  565. X      Widget        w;
  566. X  {
  567. X!     int            qresult;
  568. X! 
  569. X!     if (!emptyfigure() && figure_modified && !aborting) {
  570. X!     XtSetSensitive(w, False);
  571. X!     if ((qresult = popup_query(QUERY_YESNO, quit_msg)) == RESULT_CANCEL) {
  572. X!         XtSetSensitive(w, True);
  573. X!         return;
  574. X!     } else if (qresult == RESULT_YES) {
  575. X!         do_save(w);
  576. X!         /*
  577. X!          * if saving was not successful, figure_modified is still true:
  578. X!          * do not quit!
  579. X!          */
  580. X!         if (figure_modified) {
  581. X!         XtSetSensitive(w, True);
  582. X!         return;
  583. X!         }
  584. X!     }
  585. X      }
  586. X      /* delete the cut buffer only if it is in a temporary directory */
  587. X      if (strncmp(cut_buf_name, TMPDIR, strlen(TMPDIR)) == 0)
  588. X      unlink(cut_buf_name);
  589. X--- 213,229 ----
  590. X  quit(w)
  591. X      Widget        w;
  592. X  {
  593. X!     XtSetSensitive(w, False);
  594. X!     /* if modified (and non-empty) ask to save first */
  595. X!     if (!query_save(quit_msg)) {
  596. X!     XtSetSensitive(w, True);
  597. X!     return;        /* cancel, do not quit */
  598. X      }
  599. X+     goodbye();        /* finish up and exit */
  600. X+ }
  601. X+ 
  602. X+ goodbye()
  603. X+ {
  604. X      /* delete the cut buffer only if it is in a temporary directory */
  605. X      if (strncmp(cut_buf_name, TMPDIR, strlen(TMPDIR)) == 0)
  606. X      unlink(cut_buf_name);
  607. Xdiff -rc xfig.2.1.7a/w_dir.c xfig.2.1.8/w_dir.c
  608. X*** xfig.2.1.7a/w_dir.c    Fri Feb  5 09:19:31 1993
  609. X--- xfig.2.1.8/w_dir.c    Tue Sep 14 09:08:36 1993
  610. X***************
  611. X*** 52,58 ****
  612. X  /* Static variables */
  613. X  
  614. X  DeclareStaticArgs(10);
  615. X- static Boolean    errorInProgress;
  616. X  static String    dir_translations =
  617. X      "<Key>Return: SetDir()\n\
  618. X      Ctrl<Key>X: EmptyTextKey()\n\
  619. X--- 52,57 ----
  620. X***************
  621. X*** 59,64 ****
  622. X--- 58,64 ----
  623. X      <Key>F18: PastePanelKey()\n";
  624. X  static String    list_panel_translations =
  625. X      "<Btn3Up>: ParentDir()\n";
  626. X+ 
  627. X  static char    CurrentSelectionName[PATH_MAX];
  628. X  static int    file_entry_cnt, dir_entry_cnt;
  629. X  static char   **file_list, **dir_list;
  630. X***************
  631. X*** 100,114 ****
  632. X  
  633. X      strcpy(CurrentSelectionName, ret_struct->string);
  634. X      FirstArg(XtNstring, CurrentSelectionName);
  635. X!     /* I don't know why this doesn't work? */
  636. X!     /* NextArg(XtNinsertPosition, strlen(CurrentSelectionName));*/
  637. X!     if (export_up) {
  638. X      SetValues(exp_selfile);
  639. X          XawTextSetInsertionPoint(exp_selfile, strlen(CurrentSelectionName));
  640. X!     } else {
  641. X      SetValues(file_selfile);
  642. X          XawTextSetInsertionPoint(file_selfile, strlen(CurrentSelectionName));
  643. X!     }
  644. X  }
  645. X  
  646. X  /* Function:    DirSelected() is called when the user selects a directory.
  647. X--- 100,112 ----
  648. X  
  649. X      strcpy(CurrentSelectionName, ret_struct->string);
  650. X      FirstArg(XtNstring, CurrentSelectionName);
  651. X!     if (export_up) {
  652. X      SetValues(exp_selfile);
  653. X          XawTextSetInsertionPoint(exp_selfile, strlen(CurrentSelectionName));
  654. X!     } else {
  655. X      SetValues(file_selfile);
  656. X          XawTextSetInsertionPoint(file_selfile, strlen(CurrentSelectionName));
  657. X!     }
  658. X  }
  659. X  
  660. X  /* Function:    DirSelected() is called when the user selects a directory.
  661. X***************
  662. X*** 163,171 ****
  663. X  
  664. X      /* get the string from the widget */
  665. X      FirstArg(XtNstring, &ndir);
  666. X!     if (file_up)
  667. X      GetValues(file_dir);
  668. X!     else {
  669. X      GetValues(exp_dir);
  670. X      strcpy(export_dir,ndir);    /* save in global var */
  671. X      }
  672. X--- 161,169 ----
  673. X  
  674. X      /* get the string from the widget */
  675. X      FirstArg(XtNstring, &ndir);
  676. X!     if (file_up) {
  677. X      GetValues(file_dir);
  678. X!     } else {
  679. X      GetValues(exp_dir);
  680. X      strcpy(export_dir,ndir);    /* save in global var */
  681. X      }
  682. X***************
  683. X*** 184,219 ****
  684. X  parseuserpath(path,longpath)
  685. X  char *path,*longpath;
  686. X  {
  687. X!     char      *home,*p;
  688. X      struct passwd *who;
  689. X  
  690. X      /* this user's home */
  691. X!     if (strlen(path)==1 || path[1]=='/')
  692. X!     {
  693. X      strcpy(longpath,getenv("HOME"));
  694. X      if (strlen(path)==1)        /* nothing after the ~, we have the full path */
  695. X          return;
  696. X      strcat(longpath,&path[1]);    /* append the rest of the path */
  697. X      return;
  698. X!     }
  699. X      /* another user name after ~ */
  700. X      strcpy(longpath,&path[1]);
  701. X!     p=index(longpath,'/');
  702. X      if (p)
  703. X          *p='\0';
  704. X      who = getpwnam(longpath);
  705. X!     if (!who)
  706. X!     {
  707. X      file_msg("No such user: %s",longpath);
  708. X      strcpy(longpath,path);
  709. X!     }
  710. X!     else
  711. X!     {
  712. X      strcpy(longpath,who->pw_dir);
  713. X      p=index(path,'/');
  714. X      if (p)
  715. X          strcat(longpath,p);    /* attach stuff after the / */
  716. X!     }
  717. X  }
  718. X  
  719. X  static String    mask_text_translations =
  720. X--- 182,213 ----
  721. X  parseuserpath(path,longpath)
  722. X  char *path,*longpath;
  723. X  {
  724. X!     char      *p;
  725. X      struct passwd *who;
  726. X  
  727. X      /* this user's home */
  728. X!     if (strlen(path)==1 || path[1]=='/') {
  729. X      strcpy(longpath,getenv("HOME"));
  730. X      if (strlen(path)==1)        /* nothing after the ~, we have the full path */
  731. X          return;
  732. X      strcat(longpath,&path[1]);    /* append the rest of the path */
  733. X      return;
  734. X!     }
  735. X      /* another user name after ~ */
  736. X      strcpy(longpath,&path[1]);
  737. X!     p=strchr(longpath,'/');
  738. X      if (p)
  739. X          *p='\0';
  740. X      who = getpwnam(longpath);
  741. X!     if (!who) {
  742. X      file_msg("No such user: %s",longpath);
  743. X      strcpy(longpath,path);
  744. X!     } else {
  745. X      strcpy(longpath,who->pw_dir);
  746. X      p=index(path,'/');
  747. X      if (p)
  748. X          strcat(longpath,p);    /* attach stuff after the / */
  749. X!     }
  750. X  }
  751. X  
  752. X  static String    mask_text_translations =
  753. X***************
  754. X*** 278,284 ****
  755. X      NextArg(XtNborderWidth, INTERNAL_BW);
  756. X      NextArg(XtNscrollVertical, XawtextScrollNever);
  757. X      NextArg(XtNresize, XawtextResizeWidth);
  758. X!     NextArg(XtNwidth, 100);
  759. X      NextArg(XtNfromHoriz, w);
  760. X      NextArg(XtNfromVert, file_viewport);
  761. X      *mask_w = XtCreateManagedWidget("mask", asciiTextWidgetClass, 
  762. X--- 272,278 ----
  763. X      NextArg(XtNborderWidth, INTERNAL_BW);
  764. X      NextArg(XtNscrollVertical, XawtextScrollNever);
  765. X      NextArg(XtNresize, XawtextResizeWidth);
  766. X!     NextArg(XtNwidth, 350);
  767. X      NextArg(XtNfromHoriz, w);
  768. X      NextArg(XtNfromVert, file_viewport);
  769. X      *mask_w = XtCreateManagedWidget("mask", asciiTextWidgetClass, 
  770. X***************
  771. X*** 342,351 ****
  772. X      FirstArg(XtNlist, file_list);
  773. X      *flist_w = XtCreateManagedWidget("file_list_panel", listWidgetClass,
  774. X                       file_viewport, Args, ArgCount);
  775. X-     XtOverrideTranslations(*flist_w,
  776. X-                XtParseTranslationTable(list_panel_translations));
  777. X      XtAddCallback(*flist_w, XtNcallback, FileSelected,
  778. X            (XtPointer) NULL);
  779. X  
  780. X      FirstArg(XtNlist, dir_list);
  781. X      *dlist_w = XtCreateManagedWidget("dir_list_panel", listWidgetClass,
  782. X--- 336,345 ----
  783. X      FirstArg(XtNlist, file_list);
  784. X      *flist_w = XtCreateManagedWidget("file_list_panel", listWidgetClass,
  785. X                       file_viewport, Args, ArgCount);
  786. X      XtAddCallback(*flist_w, XtNcallback, FileSelected,
  787. X            (XtPointer) NULL);
  788. X+     XtOverrideTranslations(*flist_w,
  789. X+                XtParseTranslationTable(list_panel_translations));
  790. X  
  791. X      FirstArg(XtNlist, dir_list);
  792. X      *dlist_w = XtCreateManagedWidget("dir_list_panel", listWidgetClass,
  793. X***************
  794. X*** 425,430 ****
  795. X--- 419,426 ----
  796. X       */
  797. X      app_flush();
  798. X  
  799. X+     if ((mask == NULL) || (*mask == '\0'))
  800. X+     mask = "*";
  801. X      for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {
  802. X      /* skip over '.' (current dir) */
  803. X      if (!strcmp(dp->d_name, "."))
  804. X***************
  805. X*** 441,448 ****
  806. X          }
  807. X      } else {
  808. X          /* check if matches regular expression */
  809. X-         if ((mask == NULL) || (*mask == '\0'))
  810. X-         mask = "*";
  811. X          if (wild_match(dp->d_name, mask) == 0)
  812. X          continue;    /* no, do next */
  813. X          if (mask[0] == '*' && dp->d_name[0] == '.')
  814. X--- 437,442 ----
  815. X***************
  816. X*** 499,509 ****
  817. X  DoChangeDir(dir)
  818. X      char       *dir;
  819. X  {
  820. X-     char      **file_list;
  821. X-     char      **dir_list;
  822. X      char       *p;
  823. X-     Arg            args[10];
  824. X-     Cardinal        arg_cnt;
  825. X      char        ndir[PATH_MAX], tmpdir[PATH_MAX];
  826. X  
  827. X      
  828. X--- 493,499 ----
  829. X***************
  830. X*** 604,611 ****
  831. X--- 594,605 ----
  832. X      Widget    listwidget;
  833. X      String   *list;
  834. X  {
  835. X+     int n;
  836. X+     /* make the scrollbar reset to the top */
  837. X      XawListChange(listwidget, null_list, 1, 0, True);
  838. X      XawListChange(listwidget, list, 0, 0, True);
  839. X+     FirstArg(XtNnumberStrings, &n);
  840. X+     GetValues(listwidget);
  841. X  }
  842. X  
  843. X  
  844. Xdiff -rc xfig.2.1.7a/w_drawprim.c xfig.2.1.8/w_drawprim.c
  845. X*** xfig.2.1.7a/w_drawprim.c    Tue Mar 30 10:56:19 1993
  846. X--- xfig.2.1.8/w_drawprim.c    Fri Sep  3 11:06:25 1993
  847. X***************
  848. X*** 40,47 ****
  849. X  #include "w_util.h"
  850. X  #include "w_zoom.h"
  851. X  
  852. X! extern struct _xfstruct x_fontinfo[NUM_X_FONTS];
  853. X! extern struct _fstruct ps_fontinfo[];    /* font names */
  854. X  extern choice_info fillstyle_choices[];
  855. X  
  856. X  /* EXPORTS */
  857. X--- 40,47 ----
  858. X  #include "w_util.h"
  859. X  #include "w_zoom.h"
  860. X  
  861. X! extern struct _xfstruct x_fontinfo[];    /* X11 fontnames */
  862. X! extern struct _fstruct ps_fontinfo[];    /* PostScript/OpenWindow font names */
  863. X  extern choice_info fillstyle_choices[];
  864. X  
  865. X  /* EXPORTS */
  866. X***************
  867. X*** 49,62 ****
  868. X  PIX_FONT    bold_font;
  869. X  PIX_FONT    roman_font;
  870. X  PIX_FONT    button_font;
  871. X! PIX_ROT_FONT    canvas_font;
  872. X  
  873. X  /* LOCAL */
  874. X  
  875. X  static Pixel    gc_color[NUMOPS];
  876. X  static XRectangle clip[1];
  877. X- static pr_size    pfx_textwidth();
  878. X  static int    parsesize();
  879. X  
  880. X  #define MAXNAMES 35
  881. X  
  882. X--- 49,62 ----
  883. X  PIX_FONT    bold_font;
  884. X  PIX_FONT    roman_font;
  885. X  PIX_FONT    button_font;
  886. X! PIX_FONT    canvas_font;
  887. X  
  888. X  /* LOCAL */
  889. X  
  890. X  static Pixel    gc_color[NUMOPS];
  891. X  static XRectangle clip[1];
  892. X  static int    parsesize();
  893. X+ static Boolean    openwinfonts;
  894. X  
  895. X  #define MAXNAMES 35
  896. X  
  897. X***************
  898. X*** 79,85 ****
  899. X      if (appres.buttonFont == NULL || *appres.buttonFont == '\0')
  900. X      appres.buttonFont = BUTTON_FONT;
  901. X  
  902. X!     roman_font = XLoadQueryFont(tool_d, appres.normalFont);
  903. X      hidden_text_length = 4 * roman_font->max_bounds.width;
  904. X      if ((bold_font = XLoadQueryFont(tool_d, appres.boldFont)) == 0) {
  905. X      fprintf(stderr, "Can't load font: %s, using %s\n",
  906. X--- 79,94 ----
  907. X      if (appres.buttonFont == NULL || *appres.buttonFont == '\0')
  908. X      appres.buttonFont = BUTTON_FONT;
  909. X  
  910. X!     while ((roman_font = XLoadQueryFont(tool_d, appres.normalFont)) == 0) {
  911. X!     if (strcmp(appres.normalFont,"fixed") == 0) {
  912. X!         fprintf(stderr, "Can't load 'fixed' font, something is wrong");
  913. X!         fprintf(stderr," with your server - quitting.\n");
  914. X!         exit(1);
  915. X!     }
  916. X!     fprintf(stderr, "Can't load font: %s, using 'fixed'\n",
  917. X!         appres.normalFont);
  918. X!     appres.normalFont = "fixed";
  919. X!     } /* now loop to load "fixed" */
  920. X      hidden_text_length = 4 * roman_font->max_bounds.width;
  921. X      if ((bold_font = XLoadQueryFont(tool_d, appres.boldFont)) == 0) {
  922. X      fprintf(stderr, "Can't load font: %s, using %s\n",
  923. X***************
  924. X*** 98,116 ****
  925. X       * it.
  926. X       */
  927. X  
  928. X! #ifndef OPENWIN
  929. X!     /* if the user asked for scalable fonts, check that the server 
  930. X!        really has them by checking for font of 0-0 size */
  931. X      if (appres.SCALABLEFONTS) {
  932. X!     strcpy(template,x_fontinfo[0].template);  /* just check the first font */
  933. X!     strcat(template,"0-0-*-*-*-*-*-*");
  934. X!     if ((fontlist = XListFonts(tool_d, template, 1, &count))==0)
  935. X!         appres.SCALABLEFONTS = False;    /* none, turn off request for them */
  936. X      }
  937. X  
  938. X!     /* X11R5 has scalable fonts - skip next section in that case */
  939. X      if (!appres.SCALABLEFONTS) {
  940. X!     for (f = 0; f < NUM_X_FONTS; f++) {
  941. X          nf = NULL;
  942. X          strcpy(template,x_fontinfo[f].template);
  943. X          strcat(template,"*-*-*-*-*-*-");
  944. X--- 107,134 ----
  945. X       * it.
  946. X       */
  947. X  
  948. X!     /* if the user hasn't disallowed off scalable fonts, check that the 
  949. X!        server really has them by checking for font of 0-0 size */
  950. X!     openwinfonts = False;
  951. X      if (appres.SCALABLEFONTS) {
  952. X!     /* first look for OpenWindow style font names (e.g. times-roman) */
  953. X!     if ((fontlist = XListFonts(tool_d, ps_fontinfo[1].name, 1, &count))!=0) {
  954. X!         openwinfonts = True;    /* yes, use them */
  955. X!         for (f=0; f<NUM_FONTS; f++)    /* copy the OpenWindow font names */
  956. X!             x_fontinfo[f].template = ps_fontinfo[f+1].name;
  957. X!     } else {
  958. X!         strcpy(template,x_fontinfo[0].template);  /* nope, check for font size 0 */
  959. X!         strcat(template,"0-0-*-*-*-*-*-*");
  960. X!         if ((fontlist = XListFonts(tool_d, template, 1, &count))==0)
  961. X!         appres.SCALABLEFONTS = False;    /* none, turn off request for them */
  962. X!     }
  963. X      }
  964. X  
  965. X!     /* no scalable fonts - query the server for all the font 
  966. X!        names and sizes and build a list of them */
  967. X! 
  968. X      if (!appres.SCALABLEFONTS) {
  969. X!     for (f = 0; f < NUM_FONTS; f++) {
  970. X          nf = NULL;
  971. X          strcpy(template,x_fontinfo[f].template);
  972. X          strcat(template,"*-*-*-*-*-*-");
  973. X***************
  974. X*** 150,162 ****
  975. X              nf = newfont;    /* keep current ptr */
  976. X              nf->size = ss;    /* store the size here */
  977. X              nf->fname = flist[i].fn;    /* keep actual name */
  978. X!             nf->list = NULL;
  979. X              nf->next = NULL;
  980. X              }
  981. X          } /* next size */
  982. X      } /* next font, f */
  983. X      } /* !appres.SCALABLEFONTS */
  984. X- #endif /* OPENWIN */
  985. X  }
  986. X  
  987. X  /* parse the point size of font 'name' */
  988. X--- 168,179 ----
  989. X              nf = newfont;    /* keep current ptr */
  990. X              nf->size = ss;    /* store the size here */
  991. X              nf->fname = flist[i].fn;    /* keep actual name */
  992. X!             nf->fstruct = NULL;
  993. X              nf->next = NULL;
  994. X              }
  995. X          } /* next size */
  996. X      } /* next font, f */
  997. X      } /* !appres.SCALABLEFONTS */
  998. X  }
  999. X  
  1000. X  /* parse the point size of font 'name' */
  1001. X***************
  1002. X*** 182,254 ****
  1003. X  }
  1004. X  
  1005. X  /*
  1006. X!  * Lookup an X font corresponding to a Postscript font style that is close in
  1007. X!  * size and with angle "angle"
  1008. X   */
  1009. X  
  1010. X! PIX_ROT_FONT
  1011. X! lookfont(f, s, angle)
  1012. X      int            f, s;
  1013. X-     float        angle;
  1014. X  {
  1015. X!     struct xfont   *xf;
  1016. X!     PIX_ROT_FONT   fontst;
  1017. X!     int           dir;
  1018. X! 
  1019. X!     /*** Must fix the following to actually return the "-normal font" ROTATED font */
  1020. X!     if (f == DEFAULT)
  1021. X!     f = 0;        /* pass back the -normal font font */
  1022. X!     if (s < 0)
  1023. X!     s = DEF_FONTSIZE;    /* default font size */
  1024. X! 
  1025. X! #ifdef OPENWIN
  1026. X!   {
  1027. X!     /* to search for OpenWindows font - see below */
  1028. X!     char        fn[128];
  1029. X!     int            i;
  1030. X! 
  1031. END_OF_FILE
  1032.   if test 28226 -ne `wc -c <'xfig.06'`; then
  1033.     echo shar: \"'xfig.06'\" unpacked with wrong size!
  1034.   fi
  1035.   # end of 'xfig.06'
  1036. fi
  1037. echo shar: End of archive 15 \(of 16\).
  1038. cp /dev/null ark15isdone
  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.