home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume20 / xdvi / patch16a < prev    next >
Encoding:
Text File  |  1993-06-27  |  51.2 KB  |  1,767 lines

  1. Newsgroups: comp.sources.x
  2. From: vojta@math.berkeley.edu (Paul Vojta)
  3. Subject: v20i053:  xdvi - dvi previewer, Patch16a/2
  4. Message-ID: <csx-v20i053=xdvi.093038@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 2e9f9b1321c7f368d2f1d7b9a4b0bee5
  6. Sender: chris@sparky.imd.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Mon, 28 Jun 1993 14:31:14 GMT
  9. Approved: chris@sparky.imd.sterling.com
  10.  
  11. Submitted-by: vojta@math.berkeley.edu (Paul Vojta)
  12. Posting-number: Volume 20, Issue 53
  13. Archive-name: xdvi/patch16a
  14. Environment: X10, X11
  15. Patch-To: xdvi: Volume 17, Issue 23-25,27,40-41,53,106-107
  16.  
  17. This patch actually has been around since last September.  However, due
  18. to disruptions in comp.sources.x, it has not appeared here.  It:
  19.  
  20.    o    Improves much of the code for greyscale anti-aliasing.  In particular,
  21.     instead of assuming that the foreground is black and the background
  22.     is white, it interpolates between the foreground and background colors.
  23.     It also allocates part of the colormap for itself, allowing it to use
  24.     GXor operations when writing to the screen.  This fixes overstrike
  25.     characters.  Many thanks to Lee Hetherington
  26.     (ilh@goldilocks.LCS.MIT.EDU) for help with this one.
  27.  
  28.    o    Compiles correctly on a Convex, thanks to patches supplied by
  29.     Randy Wright (rwright@convex.com).
  30.  
  31.    o    Allows you to set the default value for the -p option.  (See the BDPI
  32.     option in the README file.)
  33.  
  34. --Paul Vojta, vojta@math.berkeley.edu
  35.  
  36. #! /bin/sh
  37. # This is a shell archive.  Remove anything before this line, then feed it
  38. # into a shell via "sh file" or similar.  To overwrite existing files,
  39. # type "sh file -c".
  40. # Contents:  xdvi.p16.2
  41. # Wrapped by chris@sparky on Mon Jun 28 08:49:45 1993
  42. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  43. echo If this archive is complete, you will see the following message:
  44. echo '          "shar: End of archive 1 (of 2)."'
  45. if test -f 'xdvi.p16.2' -a "${1}" != "-c" ; then 
  46.   echo shar: Will not clobber existing file \"'xdvi.p16.2'\"
  47. else
  48.   echo shar: Extracting \"'xdvi.p16.2'\" \(47834 characters\)
  49.   sed "s/^X//" >'xdvi.p16.2' <<'END_OF_FILE'
  50. Xdiff -cr xdvi_old/gf.c xdvi_new/gf.c
  51. X*** xdvi_old/gf.c    Sun Jan 19 14:24:17 1992
  52. X--- xdvi_new/gf.c    Tue Jul 21 10:42:47 1992
  53. X***************
  54. X*** 84,90 ****
  55. X          case XXX2:
  56. X          case XXX3:
  57. X          case XXX4:
  58. X!             Fseek(GF_file, (long) num(GF_file, cmnd - XXX1 + 1), 1);
  59. X              continue;
  60. X          case YYY:
  61. X              (void) four(GF_file);
  62. X--- 84,91 ----
  63. X          case XXX2:
  64. X          case XXX3:
  65. X          case XXX4:
  66. X!             Fseek(GF_file, (long) num(GF_file,
  67. X!             WIDEARG(,(int)) cmnd - XXX1 + 1), 1);
  68. X              continue;
  69. X          case YYY:
  70. X              (void) four(GF_file);
  71. X***************
  72. X*** 142,148 ****
  73. X          case PAINT1:
  74. X          case PAINT2:
  75. X          case PAINT3:
  76. X!             count = num(GF_file, cmnd - PAINT1 + 1);
  77. X              break;
  78. X          case EOC:
  79. X              if (cp >= ADD(basep, bytes_wide)) too_many_bits(ch);
  80. X--- 143,149 ----
  81. X          case PAINT1:
  82. X          case PAINT2:
  83. X          case PAINT3:
  84. X!             count = num(GF_file, WIDEARG(,(int)) cmnd - PAINT1 + 1);
  85. X              break;
  86. X          case EOC:
  87. X              if (cp >= ADD(basep, bytes_wide)) too_many_bits(ch);
  88. X***************
  89. X*** 151,157 ****
  90. X          case SKIP2:
  91. X          case SKIP3:
  92. X              *((char **) &basep) +=
  93. X!             num(GF_file, cmnd - SKIP0) * bytes_wide;
  94. X          case SKIP0:
  95. X              new_row = True;
  96. X              paint_switch = White;
  97. X--- 152,158 ----
  98. X          case SKIP2:
  99. X          case SKIP3:
  100. X              *((char **) &basep) +=
  101. X!             num(GF_file, WIDEARG(,(int)) cmnd - SKIP0) * bytes_wide;
  102. X          case SKIP0:
  103. X              new_row = True;
  104. X              paint_switch = White;
  105. X***************
  106. X*** 160,166 ****
  107. X          case XXX2:
  108. X          case XXX3:
  109. X          case XXX4:
  110. X!             Fseek(GF_file, (long) num(GF_file, cmnd - XXX1 + 1), 1);
  111. X              break;
  112. X          case YYY:
  113. X              (void) four(GF_file);
  114. X--- 161,168 ----
  115. X          case XXX2:
  116. X          case XXX3:
  117. X          case XXX4:
  118. X!             Fseek(GF_file, (long) num(GF_file,
  119. X!             WIDEARG(,(int)) cmnd - XXX1 + 1), 1);
  120. X              break;
  121. X          case YYY:
  122. X              (void) four(GF_file);
  123. Xdiff -cr xdvi_old/pk.c xdvi_new/pk.c
  124. X*** xdvi_old/pk.c    Thu Apr  9 12:57:16 1992
  125. X--- xdvi_new/pk.c    Fri Jul 24 14:29:03 1992
  126. X***************
  127. X*** 110,116 ****
  128. X      ubyte    ch;
  129. X  {
  130. X      int    i, j;
  131. X!     ubyte    n;
  132. X      int    row_bit_pos;
  133. X      Boolean    paint_switch;
  134. X      BMUNIT    *cp;
  135. X--- 110,116 ----
  136. X      ubyte    ch;
  137. X  {
  138. X      int    i, j;
  139. X!     int    n;
  140. X      int    row_bit_pos;
  141. X      Boolean    paint_switch;
  142. X      BMUNIT    *cp;
  143. X***************
  144. X*** 158,164 ****
  145. X  
  146. X      if (debug & DBG_PK) {
  147. X          if (g->bitmap.w != 0)
  148. X!         Printf(", size=%dx%d, dvi_adv=%d", g->bitmap.w, g->bitmap.h,
  149. X              g->dvi_adv);
  150. X          Putchar('\n');
  151. X      }
  152. X--- 158,164 ----
  153. X  
  154. X      if (debug & DBG_PK) {
  155. X          if (g->bitmap.w != 0)
  156. X!         Printf(", size=%dx%d, dvi_adv=%ld", g->bitmap.w, g->bitmap.h,
  157. X              g->dvi_adv);
  158. X          Putchar('\n');
  159. X      }
  160. X***************
  161. X*** 318,324 ****
  162. X          fontp->glyph[ch].x2 = PK_flag_byte;
  163. X          Fseek(fontp->file, (long) bytes_left, 1);
  164. X          if (debug & DBG_PK)
  165. X!         Printf("Scanning pk char %d, at %d.\n", ch,
  166. X              fontp->glyph[ch].addr);
  167. X      }
  168. X  }
  169. X--- 318,324 ----
  170. X          fontp->glyph[ch].x2 = PK_flag_byte;
  171. X          Fseek(fontp->file, (long) bytes_left, 1);
  172. X          if (debug & DBG_PK)
  173. X!         Printf("Scanning pk char %u, at %ld.\n", ch,
  174. X              fontp->glyph[ch].addr);
  175. X      }
  176. X  }
  177. Xdiff -cr xdvi_old/pxl.c xdvi_new/pxl.c
  178. X*** xdvi_old/pxl.c    Mon Jun  1 16:26:54 1992
  179. X--- xdvi_new/pxl.c    Sat Jul 25 15:26:51 1992
  180. X***************
  181. X*** 96,102 ****
  182. X  {
  183. X      register FILE *fp    = fontp->file;
  184. X      register struct glyph *g;
  185. X!     long font_dir_ptr;
  186. X  
  187. X      if (debug & DBG_PK)
  188. X          Printf("Reading PXL file %s\n", fontp->filename);
  189. X--- 96,103 ----
  190. X  {
  191. X      register FILE *fp    = fontp->file;
  192. X      register struct glyph *g;
  193. X!     long    font_dir_ptr;
  194. X!     long    trailer_ptr;
  195. X  
  196. X      if (debug & DBG_PK)
  197. X          Printf("Reading PXL file %s\n", fontp->filename);
  198. X***************
  199. X*** 106,111 ****
  200. X--- 107,113 ----
  201. X      while (four(fp) != 1001)
  202. X          Fseek(fp, (long) -5, 1);
  203. X      Fseek(fp, (long) -5 * 4, 1);
  204. X+     trailer_ptr = ftell(fp);
  205. X      (void) four(fp);    /* checksum */
  206. X      (void) four(fp);    /* magnify */
  207. X      (void) four(fp);    /* design size */
  208. X***************
  209. X*** 113,122 ****
  210. X      (void) four(fp);    /* pxl id word */
  211. X      /* seek to font directory */
  212. X      Fseek(fp, font_dir_ptr, 0);
  213. X!     maxchar = 127;
  214. X!     fontp->glyph = (struct glyph *) xmalloc(128 * sizeof(struct glyph),
  215. X!         "glyph array");
  216. X!     for (g = fontp->glyph; g < fontp->glyph + 128; ++g) {
  217. X          g->bitmap.bits = NULL;
  218. X          g->bitmap2.bits = NULL;
  219. X  #ifdef    GREY
  220. X--- 115,124 ----
  221. X      (void) four(fp);    /* pxl id word */
  222. X      /* seek to font directory */
  223. X      Fseek(fp, font_dir_ptr, 0);
  224. X!     maxchar = (trailer_ptr - font_dir_ptr) / 16 - 1;
  225. X!     fontp->glyph = (struct glyph *)
  226. X!         xmalloc((maxchar + 1) * sizeof(struct glyph), "glyph array");
  227. X!     for (g = fontp->glyph; g <= fontp->glyph + maxchar; ++g) {
  228. X          g->bitmap.bits = NULL;
  229. X          g->bitmap2.bits = NULL;
  230. X  #ifdef    GREY
  231. Xdiff -cr xdvi_old/tpic.c xdvi_new/tpic.c
  232. X*** xdvi_old/tpic.c    Thu Jun 11 14:45:50 1992
  233. X--- xdvi_new/tpic.c    Sat Jul 25 15:39:01 1992
  234. X***************
  235. X*** 282,287 ****
  236. X--- 282,288 ----
  237. X      im_fdraw(xcenter + xradius * cos(start_angle),
  238. X          ycenter + yradius * sin(start_angle));
  239. X      angle = start_angle + theta;
  240. X+     if (end_angle < angle) end_angle += TWOPI;
  241. X      while (angle < end_angle) {
  242. X          im_fdraw(xcenter + xradius * cos(angle),
  243. X          ycenter + yradius * sin(angle));
  244. X***************
  245. X*** 307,314 ****
  246. X  {
  247. X      int    xp, yp;
  248. X      int    N;
  249. X!     int    lastx    = -1;
  250. X!     int    lasty;
  251. X      int    t1, t2, t3;
  252. X      int    steps;
  253. X      int    j;
  254. X--- 308,314 ----
  255. X  {
  256. X      int    xp, yp;
  257. X      int    N;
  258. X!     int    lastx, lasty;
  259. X      int    t1, t2, t3;
  260. X      int    steps;
  261. X      int    j;
  262. X***************
  263. X*** 315,321 ****
  264. X      register int i, w;
  265. X  
  266. X  #ifdef    lint
  267. X!     lasty = -1;
  268. X  #endif
  269. X      N = path_len + 1;
  270. X      xx[0] = xx[1];
  271. X--- 315,321 ----
  272. X      register int i, w;
  273. X  
  274. X  #ifdef    lint
  275. X!     lastx = lasty = -1;
  276. X  #endif
  277. X      N = path_len + 1;
  278. X      xx[0] = xx[1];
  279. X***************
  280. X*** 334,340 ****
  281. X          t3 = w * w / 20;
  282. X          xp = (t1*xx[i+2] + t2*xx[i+1] + t3*xx[i] + 50000) / 100000;
  283. X          yp = (t1*yy[i+2] + t2*yy[i+1] + t3*yy[i] + 50000) / 100000;
  284. X!         if (lastx > -1) line_btw(lastx, lasty, xp, yp);
  285. X          lastx = xp;
  286. X          lasty = yp;
  287. X          }
  288. X--- 334,340 ----
  289. X          t3 = w * w / 20;
  290. X          xp = (t1*xx[i+2] + t2*xx[i+1] + t3*xx[i] + 50000) / 100000;
  291. X          yp = (t1*yy[i+2] + t2*yy[i+1] + t3*yy[i] + 50000) / 100000;
  292. X!         if (i != 0 || j != 0) line_btw(lastx, lasty, xp, yp);
  293. X          lastx = xp;
  294. X          lasty = yp;
  295. X          }
  296. Xdiff -cr xdvi_old/util.c xdvi_new/util.c
  297. X*** xdvi_old/util.c    Wed Jun 10 18:47:23 1992
  298. X--- xdvi_new/util.c    Mon Aug 24 18:45:15 1992
  299. X***************
  300. X*** 6,19 ****
  301. X   * Code derived from dvi-imagen.c.
  302. X   *
  303. X   * Modification history:
  304. X!  * 1/1986    Modified for X.10 by Bob Scheifler, MIT LCS.
  305. X!  * 7/1988    Modified for X.11 by Mark Eichin, MIT
  306. X   * 12/1988    Added 'R' option, toolkit, magnifying glass
  307. X!  *            --Paul Vojta, UC Berkeley.
  308. X   * 2/1989    Added tpic support    --Jeffrey Lee, U of Toronto
  309. X!  * 4/1989    Modified for System V by Donald Richardson, Clarkson Univ.
  310. X   * 3/1990    Added VMS support    --Scott Allendorf, U of Iowa
  311. X   * 7/1990    Added reflection mode    --Michael Pak, Hebrew U of Jerusalem
  312. X   *
  313. X   *    Compilation options:
  314. X   *    SYSV    compile for System V
  315. X--- 6,21 ----
  316. X   * Code derived from dvi-imagen.c.
  317. X   *
  318. X   * Modification history:
  319. X!  * 1/1986    Modified for X.10    --Bob Scheifler, MIT LCS.
  320. X!  * 7/1988    Modified for X.11    --Mark Eichin, MIT
  321. X   * 12/1988    Added 'R' option, toolkit, magnifying glass
  322. X!  *                    --Paul Vojta, UC Berkeley.
  323. X   * 2/1989    Added tpic support    --Jeffrey Lee, U of Toronto
  324. X!  * 4/1989    Modified for System V    --Donald Richardson, Clarkson Univ.
  325. X   * 3/1990    Added VMS support    --Scott Allendorf, U of Iowa
  326. X   * 7/1990    Added reflection mode    --Michael Pak, Hebrew U of Jerusalem
  327. X+  * 1/1992    Added greyscale code    --Till Brychcy, Techn. Univ. Muenchen
  328. X+  *                      and Lee Hetherington, MIT
  329. X   *
  330. X   *    Compilation options:
  331. X   *    SYSV    compile for System V
  332. X***************
  333. X*** 65,75 ****
  334. X   */
  335. X  
  336. X  #if    NeedVarargsPrototypes
  337. X! volatile void
  338. X  oops(_Xconst char *message, ...)
  339. X  #else
  340. X  /* VARARGS */
  341. X! volatile void
  342. X  oops(va_alist)
  343. X      va_dcl
  344. X  #endif
  345. X--- 67,77 ----
  346. X   */
  347. X  
  348. X  #if    NeedVarargsPrototypes
  349. X! NORETURN void
  350. X  oops(_Xconst char *message, ...)
  351. X  #else
  352. X  /* VARARGS */
  353. X! NORETURN void
  354. X  oops(va_alist)
  355. X      va_dcl
  356. X  #endif
  357. X***************
  358. X*** 185,191 ****
  359. X  unsigned long
  360. X  num(fp, size)
  361. X      register FILE *fp;
  362. X!     register WIDEARG(ubyte, int) size;
  363. X  {
  364. X      register long x = 0;
  365. X  
  366. X--- 187,193 ----
  367. X  unsigned long
  368. X  num(fp, size)
  369. X      register FILE *fp;
  370. X!     register int size;
  371. X  {
  372. X      register long x = 0;
  373. X  
  374. X***************
  375. X*** 196,202 ****
  376. X  long
  377. X  snum(fp, size)
  378. X      register FILE *fp;
  379. X!     register WIDEARG(ubyte, int) size;
  380. X  {
  381. X      register long x;
  382. X  
  383. X--- 198,204 ----
  384. X  long
  385. X  snum(fp, size)
  386. X      register FILE *fp;
  387. X!     register int size;
  388. X  {
  389. X      register long x;
  390. X  
  391. Xdiff -cr xdvi_old/vf.c xdvi_new/vf.c
  392. X*** xdvi_old/vf.c    Wed Apr 15 17:46:25 1992
  393. X--- xdvi_new/vf.c    Fri Jul 24 14:29:10 1992
  394. X***************
  395. X*** 82,88 ****
  396. X          width = four(VF_file);
  397. X          if (cc >= 256) {
  398. X              Fprintf(stderr,
  399. X!             "Virtual character %d in font %s ignored.\n",
  400. X              cc, fontp->fontname);
  401. X              Fseek(VF_file, (long) len, 1);
  402. X              continue;
  403. X--- 82,88 ----
  404. X          width = four(VF_file);
  405. X          if (cc >= 256) {
  406. X              Fprintf(stderr,
  407. X!             "Virtual character %lu in font %s ignored.\n",
  408. X              cc, fontp->fontname);
  409. X              Fseek(VF_file, (long) len, 1);
  410. X              continue;
  411. X***************
  412. X*** 115,121 ****
  413. X          m->end = m->pos + len;
  414. X          }
  415. X          if (debug & DBG_PK)
  416. X!         Printf("Read VF macro for character %d; dy = %d, length = %d\n",
  417. X              cc, m->dvi_adv, len);
  418. X      }
  419. X      if (cmnd != POST)
  420. X--- 115,121 ----
  421. X          m->end = m->pos + len;
  422. X          }
  423. X          if (debug & DBG_PK)
  424. X!         Printf("Read VF macro for character %lu; dy = %ld, length = %d\n",
  425. X              cc, m->dvi_adv, len);
  426. X      }
  427. X      if (cmnd != POST)
  428. Xdiff -cr xdvi_old/xdvi.c xdvi_new/xdvi.c
  429. X*** xdvi_old/xdvi.c    Tue Jun 16 14:29:07 1992
  430. X--- xdvi_new/xdvi.c    Sat Sep 12 15:25:42 1992
  431. X***************
  432. X*** 6,20 ****
  433. X   * Code derived from dvi-imagen.c.
  434. X   *
  435. X   * Modification history:
  436. X!  * 1/1986    Modified for X.10 by Bob Scheifler, MIT LCS.
  437. X!  * 7/1988    Modified for X.11 by Mark Eichin, MIT
  438. X   * 12/1988    Added 'R' option, toolkit, magnifying glass
  439. X!  *            --Paul Vojta, UC Berkeley.
  440. X   * 2/1989    Added tpic support    --Jeffrey Lee, U of Toronto
  441. X!  * 4/1989    Modified for System V by Donald Richardson, Clarkson Univ.
  442. X   * 3/1990    Added VMS support    --Scott Allendorf, U of Iowa
  443. X   * 7/1990    Added reflection mode    --Michael Pak, Hebrew U of Jerusalem
  444. X   * 1/1992    Added greyscale code    --Till Brychcy, Techn. Univ. Muenchen
  445. X   *
  446. X   *    Compilation options:
  447. X   *    SYSV    compile for System V
  448. X--- 6,21 ----
  449. X   * Code derived from dvi-imagen.c.
  450. X   *
  451. X   * Modification history:
  452. X!  * 1/1986    Modified for X.10    --Bob Scheifler, MIT LCS.
  453. X!  * 7/1988    Modified for X.11    --Mark Eichin, MIT
  454. X   * 12/1988    Added 'R' option, toolkit, magnifying glass
  455. X!  *                    --Paul Vojta, UC Berkeley.
  456. X   * 2/1989    Added tpic support    --Jeffrey Lee, U of Toronto
  457. X!  * 4/1989    Modified for System V    --Donald Richardson, Clarkson Univ.
  458. X   * 3/1990    Added VMS support    --Scott Allendorf, U of Iowa
  459. X   * 7/1990    Added reflection mode    --Michael Pak, Hebrew U of Jerusalem
  460. X   * 1/1992    Added greyscale code    --Till Brychcy, Techn. Univ. Muenchen
  461. X+  *                      and Lee Hetherington, MIT
  462. X   *
  463. X   *    Compilation options:
  464. X   *    SYSV    compile for System V
  465. X***************
  466. X*** 60,71 ****
  467. X  #include "xdvi.h"
  468. X  
  469. X  #include "patchlevel.h"
  470. X! static    struct {_Xconst char    a[36], b, c, d;}
  471. X  #ifndef X10
  472. X!     header = {"$Header: xdvi.c (X11), patchlevel = ", '0' + PATCHLEVEL / 10,
  473. X          '0' + PATCHLEVEL % 10, 0};
  474. X  #else
  475. X!     header = {"$Header: xdvi.c (X10), patchlevel = ", '0' + PATCHLEVEL / 10,
  476. X          '0' + PATCHLEVEL % 10, 0};
  477. X  #endif
  478. X  
  479. X--- 61,72 ----
  480. X  #include "xdvi.h"
  481. X  
  482. X  #include "patchlevel.h"
  483. X! static    struct {_Xconst char    a[33], b, c, d;}
  484. X  #ifndef X10
  485. X!     version = {"This is xdvi for X11, patchlevel ", '0' + PATCHLEVEL / 10,
  486. X          '0' + PATCHLEVEL % 10, 0};
  487. X  #else
  488. X!     version = {"This is xdvi for X10, patchlevel ", '0' + PATCHLEVEL / 10,
  489. X          '0' + PATCHLEVEL % 10, 0};
  490. X  #endif
  491. X  
  492. X***************
  493. X*** 92,98 ****
  494. X  #include <X11/Shell.h>    /* needed for def. of XtNiconX */
  495. X  #ifndef    XtSpecificationRelease
  496. X  #define    XtSpecificationRelease    0
  497. X- #define    XtPointer caddr_t
  498. X  #endif
  499. X  #if    XtSpecificationRelease >= 4
  500. X  #include <X11/Xaw/Viewport.h>
  501. X--- 93,98 ----
  502. X***************
  503. X*** 111,117 ****
  504. X  typedef    int        Position;
  505. X  typedef    unsigned int    Dimension;
  506. X  #ifndef X10
  507. X! typedef    unsigned int    Pixel;
  508. X  #define    XtPending()    XPending(DISP)
  509. X  #else
  510. X  #define    XtPending    XPending
  511. X--- 111,117 ----
  512. X  typedef    int        Position;
  513. X  typedef    unsigned int    Dimension;
  514. X  #ifndef X10
  515. X! typedef    unsigned long    Pixel;
  516. X  #define    XtPending()    XPending(DISP)
  517. X  #else
  518. X  #define    XtPending    XPending
  519. X***************
  520. X*** 201,206 ****
  521. X--- 201,209 ----
  522. X      char    *debug_arg;
  523. X      int    _shrink_factor;
  524. X      int    density;
  525. X+ #ifdef    GREY
  526. X+     float    gamma;
  527. X+ #endif
  528. X      int    pixels_per_inch;
  529. X      char    *sidemargin;
  530. X      char    *topmargin;
  531. X***************
  532. X*** 227,233 ****
  533. X      char    *copy_arg;
  534. X      Boolean    copy;
  535. X      Boolean    thorough;
  536. X!     Boolean    version;
  537. X  #ifdef    BUTTONS
  538. X      Boolean    expert;
  539. X  #endif
  540. X--- 230,236 ----
  541. X      char    *copy_arg;
  542. X      Boolean    copy;
  543. X      Boolean    thorough;
  544. X!     Boolean    version_flag;
  545. X  #ifdef    BUTTONS
  546. X      Boolean    expert;
  547. X  #endif
  548. X***************
  549. X*** 241,246 ****
  550. X--- 244,252 ----
  551. X  
  552. X  #define    RESOURCE(x)    x
  553. X  static    char    *debug_arg;
  554. X+ #ifdef    GREY
  555. X+ static    float    gamma    = 1.0;
  556. X+ #endif
  557. X  static    char    *sidemargin, *topmargin;
  558. X  static    char    *xoffset, *yoffset;
  559. X  static    _Xconst    char    *paper        = DEFAULT_PAPER;
  560. X***************
  561. X*** 252,259 ****
  562. X  static    Boolean    copy    = 2;
  563. X  static    Boolean    thorough;
  564. X  #endif    /* X10 */
  565. X! static    Boolean    version        = False;
  566. X! static    int    mg_size[5] = {200, 350, 600, 900, 1200};
  567. X  
  568. X  #endif    /* TOOLKIT */
  569. X  
  570. X--- 258,265 ----
  571. X  static    Boolean    copy    = 2;
  572. X  static    Boolean    thorough;
  573. X  #endif    /* X10 */
  574. X! static    Boolean    version_flag    = False;
  575. X! static    int    mg_size[5]    = {200, 350, 600, 900, 1200};
  576. X  
  577. X  #endif    /* TOOLKIT */
  578. X  
  579. X***************
  580. X*** 300,309 ****
  581. X  static    int    home_x, home_y;
  582. X  static    int    min_x, max_x, min_y, max_y;
  583. X  
  584. X! struct WindowRec mane    = {NULL, 3, 0, 0, 0, 0, MAXDIM, 0, MAXDIM, 0};
  585. X! struct WindowRec alt    = {NULL, 1, 0, 0, 0, 0, MAXDIM, 0, MAXDIM, 0};
  586. X  /*    currwin is temporary storage except for within redraw() */
  587. X! struct WindowRec currwin = {NULL, 3, 0, 0, 0, 0, MAXDIM, 0, MAXDIM, 0};
  588. X  
  589. X  #ifdef    TOOLKIT
  590. X  static    Widget    top_level, vport_widget, draw_widget, clip_widget;
  591. X--- 306,315 ----
  592. X  static    int    home_x, home_y;
  593. X  static    int    min_x, max_x, min_y, max_y;
  594. X  
  595. X! struct WindowRec mane    = {(Window) 0, 3, 0, 0, 0, 0, MAXDIM, 0, MAXDIM, 0};
  596. X! struct WindowRec alt    = {(Window) 0, 1, 0, 0, 0, 0, MAXDIM, 0, MAXDIM, 0};
  597. X  /*    currwin is temporary storage except for within redraw() */
  598. X! struct WindowRec currwin = {(Window) 0, 3, 0, 0, 0, 0, MAXDIM, 0, MAXDIM, 0};
  599. X  
  600. X  #ifdef    TOOLKIT
  601. X  static    Widget    top_level, vport_widget, draw_widget, clip_widget;
  602. X***************
  603. X*** 391,397 ****
  604. X  };
  605. X  
  606. X  static    Arg    command_args[] = {
  607. X!     {XtNlabel,    NULL},
  608. X      {XtNx,        (XtArgVal) 6},
  609. X      {XtNy,        (XtArgVal) 0},
  610. X      {XtNwidth,    (XtArgVal) 64},
  611. X--- 397,403 ----
  612. X  };
  613. X  
  614. X  static    Arg    command_args[] = {
  615. X!     {XtNlabel,    (XtArgVal) NULL},
  616. X      {XtNx,        (XtArgVal) 6},
  617. X      {XtNy,        (XtArgVal) 0},
  618. X      {XtNwidth,    (XtArgVal) 64},
  619. X***************
  620. X*** 515,522 ****
  621. X  
  622. X  static    Boolean    canit        = False,
  623. X          has_arg        = False;
  624. X! static    short    event_counter    = 0,
  625. X!         event_freq    = 70;
  626. X  static    int    number        = 0,
  627. X          sign        = 1;
  628. X  static    jmp_buf    canit_env;
  629. X--- 521,528 ----
  630. X  
  631. X  static    Boolean    canit        = False,
  632. X          has_arg        = False;
  633. X! static    VOLATILE short    event_counter    = 0;
  634. X! static    VOLATILE short    event_freq    = 70;
  635. X  static    int    number        = 0,
  636. X          sign        = 1;
  637. X  static    jmp_buf    canit_env;
  638. X***************
  639. X*** 541,579 ****
  640. X  
  641. X  #ifdef    GREY
  642. X  static    void
  643. X! make_one_pixel_map(pixel, hi)
  644. X!     long pixel[];
  645. X!     int hi;
  646. X  {
  647. X!     int i;
  648. X!     int level;
  649. X!     XColor color;
  650. X  
  651. X!     for (i = 0; i <= hi; i++) {
  652. X!         level = (hi - i) * 65535 / hi;
  653. X!         color.red = color.green = color.blue = level;
  654. X!         color.flags = DoRed | DoGreen | DoBlue;
  655. X!         if (XAllocColor(DISP, DefaultColormapOfScreen(SCRN), &color) == 0)
  656. X!         pixel[i] = (level >= 32768) ? BlackPixelOfScreen(SCRN)
  657. X!                         : WhitePixelOfScreen(SCRN);
  658. X!         else
  659. X!         pixel[i] = color.pixel;
  660. X!     }
  661. X! }
  662. X  
  663. X! static    void
  664. X! init_pix()
  665. X! {
  666. X!     static    Boolean    pixels_allocated = False;
  667. X  
  668. X!     if (pixels_allocated)
  669. X!         return;
  670. X  
  671. X!     make_one_pixel_map(pixel2, 2*2);
  672. X!     make_one_pixel_map(pixel3, 3*3);
  673. X!     make_one_pixel_map(pixel4, 4*4);
  674. X  
  675. X!     pixels_allocated = True;
  676. X  }
  677. X  #endif    /* GREY */
  678. X  
  679. X--- 547,644 ----
  680. X  
  681. X  #ifdef    GREY
  682. X  static    void
  683. X! init_pix(warn)
  684. X!     Boolean    warn;
  685. X  {
  686. X!     static    int    shrink_allocated_for = 0;
  687. X!     static    Boolean    colors_allocated = False;
  688. X!     int    i;
  689. X  
  690. X!     if (!colors_allocated)
  691. X!     {
  692. X!         Pixel plane_masks[4];
  693. X!         Pixel pixel;
  694. X!         XColor color, fc, bc;
  695. X!         XGCValues    values;
  696. X!         int i;
  697. X  
  698. X!         if (RESOURCE(gamma) == 0.0) RESOURCE(gamma) = 1.0;
  699. X  
  700. X!         if (!RESOURCE(copy))
  701. X!         /* allocate 4 color planes for 16 colors (for GXor drawing) */
  702. X!         if (!XAllocColorCells(DISP, DefaultColormapOfScreen(SCRN),
  703. X!                       False, plane_masks, 4, &pixel, 1))
  704. X!             RESOURCE(copy) = warn = True;
  705. X  
  706. X!         /* get foreground and background RGB values for interpolating */
  707. X!         fc.pixel = RESOURCE(fore_Pixel);
  708. X!         XQueryColor(DISP, DefaultColormapOfScreen(SCRN), &fc);
  709. X!         bc.pixel = RESOURCE(back_Pixel);
  710. X!         XQueryColor(DISP, DefaultColormapOfScreen(SCRN), &bc);
  711. X  
  712. X!         for (i = 0; i < 16; ++i) {
  713. X!         double    pow();
  714. X!         double    frac = RESOURCE(gamma) > 0 ?
  715. X!             pow((double) i / 15, 1 / RESOURCE(gamma))
  716. X!             : 1 - pow((double) (15 - i) / 15, -RESOURCE(gamma));
  717. X! 
  718. X!         color.red = frac * ((double) fc.red - bc.red) + bc.red;
  719. X!         color.green = frac * ((double) fc.green - bc.green) + bc.green;
  720. X!         color.blue = frac * ((double) fc.blue - bc.blue) + bc.blue;
  721. X! 
  722. X!         color.pixel = pixel;
  723. X!         color.flags = DoRed | DoGreen | DoBlue;
  724. X! 
  725. X!         if (!RESOURCE(copy)) {
  726. X!             if (i & 1) color.pixel |= plane_masks[0];
  727. X!             if (i & 2) color.pixel |= plane_masks[1];
  728. X!             if (i & 4) color.pixel |= plane_masks[2];
  729. X!             if (i & 8) color.pixel |= plane_masks[3];
  730. X!             XStoreColor(DISP, DefaultColormapOfScreen(SCRN), &color);
  731. X!             palette[i] = color.pixel;
  732. X!         }
  733. X!         else {
  734. X!             if (!XAllocColor(DISP, DefaultColormapOfScreen(SCRN),
  735. X!             &color))
  736. X!             palette[i] = (i * 100 >= density * 15)
  737. X!                 ? RESOURCE(fore_Pixel) : RESOURCE(back_Pixel);
  738. X!             else
  739. X!             palette[i] = color.pixel;
  740. X!         }
  741. X!         }
  742. X! 
  743. X!         /* Make sure fore_ and back_Pixel are a part of the palette */
  744. X!         RESOURCE(fore_Pixel) = palette[15];
  745. X!         RESOURCE(back_Pixel) = palette[0];
  746. X! 
  747. X! #define    MakeGC(fcn, fg, bg)    (values.function = fcn, values.foreground=fg,\
  748. X!         values.background=bg,\
  749. X!         XCreateGC(DISP, RootWindowOfScreen(SCRN),\
  750. X!             GCFunction|GCForeground|GCBackground, &values))
  751. X! 
  752. X!         foreGC = ruleGC = MakeGC(RESOURCE(copy) ? GXcopy : GXor,
  753. X!         RESOURCE(fore_Pixel), RESOURCE(back_Pixel));
  754. X! 
  755. X!         colors_allocated = True;
  756. X!         if (RESOURCE(copy) && warn)
  757. X!         Puts("Note:  overstrike characters may be incorrect.");
  758. X!     }
  759. X! #undef    MakeGC
  760. X! 
  761. X!     if (mane.shrinkfactor == 1) return;
  762. X! 
  763. X!     if (shrink_allocated_for < mane.shrinkfactor) {
  764. X!         if (pixeltbl != NULL) free((char *) pixeltbl);
  765. X!         pixeltbl = (Pixel *) xmalloc((unsigned)
  766. X!         (mane.shrinkfactor * mane.shrinkfactor + 1) * sizeof(Pixel),
  767. X!         "pixel table");
  768. X!         shrink_allocated_for = mane.shrinkfactor;
  769. X!     }
  770. X! 
  771. X!     for (i = 0; i <= mane.shrinkfactor * mane.shrinkfactor; ++i)
  772. X!         pixeltbl[i] =
  773. X!         palette[(i * 30 + mane.shrinkfactor * mane.shrinkfactor)
  774. X!             / (2 * mane.shrinkfactor * mane.shrinkfactor)];
  775. X  }
  776. X  #endif    /* GREY */
  777. X  
  778. X***************
  779. X*** 916,922 ****
  780. X  static    void
  781. X  handle_key(widget, junk, event, cont)
  782. X      Widget    widget;
  783. X!     caddr_t    junk;
  784. X      XEvent    *event;
  785. X      Boolean    *cont;        /* unused */
  786. X  {
  787. X--- 981,987 ----
  788. X  static    void
  789. X  handle_key(widget, junk, event, cont)
  790. X      Widget    widget;
  791. X!     XtPointer junk;
  792. X      XEvent    *event;
  793. X      Boolean    *cont;        /* unused */
  794. X  {
  795. X***************
  796. X*** 927,933 ****
  797. X  static    void
  798. X  handle_resize(widget, junk, event, cont)
  799. X      Widget    widget;
  800. X!     caddr_t    junk;
  801. X      XEvent    *event;
  802. X      Boolean    *cont;        /* unused */
  803. X  {
  804. X--- 992,998 ----
  805. X  static    void
  806. X  handle_resize(widget, junk, event, cont)
  807. X      Widget    widget;
  808. X!     XtPointer junk;
  809. X      XEvent    *event;
  810. X      Boolean    *cont;        /* unused */
  811. X  {
  812. X***************
  813. X*** 939,949 ****
  814. X  static    void
  815. X  handle_command(widget, client_data, call_data)
  816. X      Widget    widget;
  817. X!     caddr_t    client_data;
  818. X!     caddr_t    call_data;
  819. X  {
  820. X!     keystroke(((int) client_data) & 0xff, ((int) client_data) >> 8,
  821. X!         (((int) client_data) >> 8) != 0, (XEvent *) NULL);
  822. X  }
  823. X  #endif    /* BUTTONS */
  824. X  
  825. X--- 1004,1016 ----
  826. X  static    void
  827. X  handle_command(widget, client_data, call_data)
  828. X      Widget    widget;
  829. X!     XtPointer client_data;
  830. X!     XtPointer call_data;
  831. X  {
  832. X!     int    int_client_data    = (int) client_data;    /* Apollo cc bug */
  833. X! 
  834. X!     keystroke((int_client_data) & 0xff, (int_client_data) >> 8,
  835. X!         ((int_client_data) >> 8) != 0, (XEvent *) NULL);
  836. X  }
  837. X  #endif    /* BUTTONS */
  838. X  
  839. X***************
  840. X*** 1198,1204 ****
  841. X  static    void
  842. X  handle_button(widget, junk, ev, cont)
  843. X      Widget    widget;
  844. X!     caddr_t    junk;
  845. X      XEvent *ev;
  846. X  #define    event    (&(ev->xbutton))
  847. X      Boolean    *cont;        /* unused */
  848. X--- 1265,1271 ----
  849. X  static    void
  850. X  handle_button(widget, junk, ev, cont)
  851. X      Widget    widget;
  852. X!     XtPointer junk;
  853. X      XEvent *ev;
  854. X  #define    event    (&(ev->xbutton))
  855. X      Boolean    *cont;        /* unused */
  856. X***************
  857. X*** 1210,1227 ****
  858. X  {
  859. X      int    x, y;
  860. X  #ifndef X10
  861. X      XSetWindowAttributes attr;
  862. X- 
  863. X-     alt.width = alt.height = RESOURCE(mg_size[event->button - 1]);
  864. X  #else
  865. X!     alt.width = alt.height =
  866. X!         RESOURCE(mg_size[2 - (event->detail & ValueMask)]);
  867. X  #endif
  868. X!     if (alt.win != NULL || mane.shrinkfactor == 1 || alt.width <= 0)
  869. X          XBell(DISP, 20);
  870. X      else {
  871. X          mag_x = event->x;
  872. X          mag_y = event->y;
  873. X  #ifndef X10
  874. X          main_x = event->x_root - mag_x;
  875. X          main_y = event->y_root - mag_y;
  876. X--- 1277,1294 ----
  877. X  {
  878. X      int    x, y;
  879. X  #ifndef X10
  880. X+     int    w    = RESOURCE(mg_size[event->button - 1]);
  881. X      XSetWindowAttributes attr;
  882. X  #else
  883. X!     int    w    = RESOURCE(mg_size[2 - (event->detail & ValueMask)]);
  884. X  #endif
  885. X! 
  886. X!     if (alt.win != (Window) 0 || mane.shrinkfactor == 1 || w <= 0)
  887. X          XBell(DISP, 20);
  888. X      else {
  889. X          mag_x = event->x;
  890. X          mag_y = event->y;
  891. X+         alt.width = alt.height = w;
  892. X  #ifndef X10
  893. X          main_x = event->x_root - mag_x;
  894. X          main_y = event->y_root - mag_y;
  895. X***************
  896. X*** 1261,1267 ****
  897. X  static    void
  898. X  handle_motion(widget, junk, ev, cont)
  899. X      Widget    widget;
  900. X!     caddr_t    junk;
  901. X      XEvent *ev;
  902. X  #define    event    (&(ev->xmotion))
  903. X      Boolean    *cont;        /* unused */
  904. X--- 1328,1334 ----
  905. X  static    void
  906. X  handle_motion(widget, junk, ev, cont)
  907. X      Widget    widget;
  908. X!     XtPointer junk;
  909. X      XEvent *ev;
  910. X  #define    event    (&(ev->xmotion))
  911. X      Boolean    *cont;        /* unused */
  912. X***************
  913. X*** 1296,1302 ****
  914. X  static    void
  915. X  handle_release(widget, junk, ev, cont)
  916. X      Widget    widget;
  917. X!     caddr_t    junk;
  918. X      XEvent *ev;
  919. X  #define    event    (&(ev->xbutton))
  920. X      Boolean    *cont;        /* unused */
  921. X--- 1363,1369 ----
  922. X  static    void
  923. X  handle_release(widget, junk, ev, cont)
  924. X      Widget    widget;
  925. X!     XtPointer junk;
  926. X      XEvent *ev;
  927. X  #define    event    (&(ev->xbutton))
  928. X      Boolean    *cont;        /* unused */
  929. X***************
  930. X*** 1310,1316 ****
  931. X          else {
  932. X          XDestroyWindow(DPY WINDOW(alt));
  933. X          if (currwin.win == alt.win) alt_canit = True;
  934. X!         alt.win = NULL;
  935. X          mag_moved = False;
  936. X          can_exposures(&alt);
  937. X          }
  938. X--- 1377,1383 ----
  939. X          else {
  940. X          XDestroyWindow(DPY WINDOW(alt));
  941. X          if (currwin.win == alt.win) alt_canit = True;
  942. X!         alt.win = (Window) 0;
  943. X          mag_moved = False;
  944. X          can_exposures(&alt);
  945. X          }
  946. X***************
  947. X*** 1321,1333 ****
  948. X  
  949. X      /*ARGSUSED*/
  950. X  static    void
  951. X! handle_exp(widget, windowrec, ev, cont)
  952. X      Widget    widget;
  953. X!     struct WindowRec *windowrec;
  954. X      register XEvent *ev;
  955. X  #define    event    (&(ev->xexpose))
  956. X      Boolean    *cont;        /* unused */
  957. X  {
  958. X      if (windowrec == &alt)
  959. X          if (alt_stat < 0) {    /* destroy upon exposure */
  960. X          alt_stat = 0;
  961. X--- 1388,1402 ----
  962. X  
  963. X      /*ARGSUSED*/
  964. X  static    void
  965. X! handle_exp(widget, closure, ev, cont)
  966. X      Widget    widget;
  967. X!     XtPointer closure;
  968. X      register XEvent *ev;
  969. X  #define    event    (&(ev->xexpose))
  970. X      Boolean    *cont;        /* unused */
  971. X  {
  972. X+     struct WindowRec *windowrec = (struct WindowRec *) closure;
  973. X+ 
  974. X      if (windowrec == &alt)
  975. X          if (alt_stat < 0) {    /* destroy upon exposure */
  976. X          alt_stat = 0;
  977. X***************
  978. X*** 1533,1538 ****
  979. X--- 1602,1610 ----
  980. X          init_page();
  981. X          if (number0 != 1 && number0 != bak_shrink) {
  982. X              bak_shrink = number0;
  983. X+ #ifdef    GREY
  984. X+             if (use_grey) init_pix(False);
  985. X+ #endif
  986. X              reset_fonts();
  987. X          }
  988. X  #ifdef    TOOLKIT
  989. X***************
  990. X*** 1557,1563 ****
  991. X  #ifdef GREY
  992. X          case 'G':
  993. X          use_grey = (arg0 ? number0 : !use_grey);
  994. X!         if (use_grey) init_pix();
  995. X          reset_fonts();
  996. X          break;
  997. X  #endif
  998. X--- 1629,1635 ----
  999. X  #ifdef GREY
  1000. X          case 'G':
  1001. X          use_grey = (arg0 ? number0 : !use_grey);
  1002. X!         if (use_grey) init_pix(False);
  1003. X          reset_fonts();
  1004. X          break;
  1005. X  #endif
  1006. X***************
  1007. X*** 1622,1628 ****
  1008. X          if (resized) get_geom();
  1009. X          if (event.xany.window == WINDOW(alt) &&
  1010. X              event.type == Expose) {
  1011. X!         handle_exp((Widget) NULL, &alt, &event, (Boolean *) NULL);
  1012. X          continue;
  1013. X          }
  1014. X          if (event.type != KeyPress) {
  1015. X--- 1694,1701 ----
  1016. X          if (resized) get_geom();
  1017. X          if (event.xany.window == WINDOW(alt) &&
  1018. X              event.type == Expose) {
  1019. X!         handle_exp((Widget) NULL, (XtPointer) &alt, &event,
  1020. X!             (Boolean *) NULL);
  1021. X          continue;
  1022. X          }
  1023. X          if (event.type != KeyPress) {
  1024. X***************
  1025. X*** 1897,1903 ****
  1026. X  enable_intr() {
  1027. X      int    socket    = ConnectionNumber(DISP);
  1028. X      if (!isatty(0)) {
  1029. X!         puts("trying...");
  1030. X          if (dup2(socket, 0) == -1) perror(prog);
  1031. X          socket = 0;
  1032. X      }
  1033. X--- 1970,1976 ----
  1034. X  enable_intr() {
  1035. X      int    socket    = ConnectionNumber(DISP);
  1036. X      if (!isatty(0)) {
  1037. X!         Puts("trying...");
  1038. X          if (dup2(socket, 0) == -1) perror(prog);
  1039. X          socket = 0;
  1040. X      }
  1041. X***************
  1042. X*** 1925,1931 ****
  1043. X--- 1998,2010 ----
  1044. X  #ifdef    HAS_SIGIO
  1045. X          enable_intr();
  1046. X  #endif
  1047. X+ #ifdef    __convex__
  1048. X+         /* convex C turns off optimization for the entire function
  1049. X+            if setjmp return value is discarded.*/
  1050. X+         if (setjmp(canit_env))    /*optimize me*/;
  1051. X+ #else
  1052. X          (void) setjmp(canit_env);
  1053. X+ #endif
  1054. X          for (;;) {
  1055. X          if (mane.win) SetCursor(ready_cursor);
  1056. X          read_events(True);
  1057. X***************
  1058. X*** 1936,1942 ****
  1059. X              redraw_page();
  1060. X          }
  1061. X          else if (mag_moved) {
  1062. X!             if (alt.win == NULL) mag_moved = False;
  1063. X              else if (abs(new_mag_x - mag_x) >
  1064. X              2 * abs(new_mag_y - mag_y))
  1065. X                  movemag(new_mag_x, mag_y);
  1066. X--- 2015,2021 ----
  1067. X              redraw_page();
  1068. X          }
  1069. X          else if (mag_moved) {
  1070. X!             if (alt.win == (Window) 0) mag_moved = False;
  1071. X              else if (abs(new_mag_x - mag_x) >
  1072. X              2 * abs(new_mag_y - mag_y))
  1073. X                  movemag(new_mag_x, mag_y);
  1074. X***************
  1075. X*** 1952,1958 ****
  1076. X      }
  1077. X  }
  1078. X  
  1079. X! static    volatile void
  1080. X  usage() {
  1081. X  #ifndef X10
  1082. X  #ifndef    VMS
  1083. X--- 2031,2037 ----
  1084. X      }
  1085. X  }
  1086. X  
  1087. X! static    NORETURN void
  1088. X  usage() {
  1089. X  #ifndef X10
  1090. X  #ifndef    VMS
  1091. X***************
  1092. X*** 1962,1968 ****
  1093. X      [-expert] [-paper <papertype>] [-mgs[n] <size>] [-altfont <font>]\n\
  1094. X      [-margins <dimen>] [-sidemargin <dimen>] [-topmargin <dimen>]\n\
  1095. X      [-offsets <dimen>] [-xoffset <dimen>] [-yoffset <dimen>] [-keep]\n\
  1096. X!     [-hushspecials] [-hushchars] [-hush] [-nogrey] [-version]\n\
  1097. X      [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
  1098. X  [-cr <color>]\n\
  1099. X      [-bw <width>] [-geometry <geometry>] [-icongeometry <geometry>]\n\
  1100. X--- 2041,2048 ----
  1101. X      [-expert] [-paper <papertype>] [-mgs[n] <size>] [-altfont <font>]\n\
  1102. X      [-margins <dimen>] [-sidemargin <dimen>] [-topmargin <dimen>]\n\
  1103. X      [-offsets <dimen>] [-xoffset <dimen>] [-yoffset <dimen>] [-keep]\n\
  1104. X!     [-hushspecials] [-hushchars] [-hush] [-nogrey] [-gamma <g>] \
  1105. X! [-version]\n\
  1106. X      [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
  1107. X  [-cr <color>]\n\
  1108. X      [-bw <width>] [-geometry <geometry>] [-icongeometry <geometry>]\n\
  1109. X***************
  1110. X*** 1974,1980 ****
  1111. X      [-paper <papertype>] [-mgs[n] <size>] [-altfont <font>]\n\
  1112. X      [-margins <dimen>] [-sidemargin <dimen>] [-topmargin <dimen>]\n\
  1113. X      [-offsets <dimen>] [-xoffset <dimen>] [-yoffset <dimen>] [-keep]\n\
  1114. X!     [-hushspecials] [-hushchars] [-hush] [-nogrey] [-version]\n\
  1115. X      [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
  1116. X  [-cr <color>]\n\
  1117. X      [-bw <width>] [-geometry <geometry>] [-icongeometry <geometry>]\n\
  1118. X--- 2054,2061 ----
  1119. X      [-paper <papertype>] [-mgs[n] <size>] [-altfont <font>]\n\
  1120. X      [-margins <dimen>] [-sidemargin <dimen>] [-topmargin <dimen>]\n\
  1121. X      [-offsets <dimen>] [-xoffset <dimen>] [-yoffset <dimen>] [-keep]\n\
  1122. X!     [-hushspecials] [-hushchars] [-hush] [-nogrey] [-gamma <g>] \
  1123. X! [-version]\n\
  1124. X      [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
  1125. X  [-cr <color>]\n\
  1126. X      [-bw <width>] [-geometry <geometry>] [-icongeometry <geometry>]\n\
  1127. X***************
  1128. X*** 1989,1995 ****
  1129. X  \n", stderr);
  1130. X      Fputs("\
  1131. X      [-offsets <dimen>] [-xoffset <dimen>] [-yoffset <dimen>] [-keep]\n\
  1132. X!     [-hushspecials] [-hushchars] [-hush] [-nogrey] [-version]\n\
  1133. X      [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
  1134. X  [-cr <color>]\n\
  1135. X      [-bw <width>] [-geometry <geometry>] [-icongeometry <geometry>]\n\
  1136. X--- 2070,2077 ----
  1137. X  \n", stderr);
  1138. X      Fputs("\
  1139. X      [-offsets <dimen>] [-xoffset <dimen>] [-yoffset <dimen>] [-keep]\n\
  1140. X!     [-hushspecials] [-hushchars] [-hush] [-nogrey] [-gamma <g>] \
  1141. X! [-version]\n\
  1142. X      [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
  1143. X  [-cr <color>]\n\
  1144. X      [-bw <width>] [-geometry <geometry>] [-icongeometry <geometry>]\n\
  1145. X***************
  1146. X*** 2034,2039 ****
  1147. X--- 2116,2124 ----
  1148. X  {"-S",        ".densityPercent", XrmoptionSepArg,    (caddr_t) NULL},
  1149. X  #endif
  1150. X  {"-density",    ".densityPercent", XrmoptionSepArg,    (caddr_t) NULL},
  1151. X+ #ifdef    GREY
  1152. X+ {"-gamma",    ".gamma",    XrmoptionSepArg,    (caddr_t) NULL},
  1153. X+ #endif
  1154. X  {"-p",        ".pixelsPerInch", XrmoptionSepArg,    (caddr_t) NULL},
  1155. X  {"-margins",    ".Margin",    XrmoptionSepArg,    (caddr_t) NULL},
  1156. X  {"-sidemargin",    ".sideMargin",    XrmoptionSepArg,    (caddr_t) NULL},
  1157. X***************
  1158. X*** 2084,2089 ****
  1159. X--- 2169,2176 ----
  1160. X  
  1161. X  #define    offset(field)    XtOffsetOf(struct _resource, field)
  1162. X  
  1163. X+ static    int    basedpi    = BDPI;        /* default value for -p option */
  1164. X+ 
  1165. X  static    XtResource    application_resources[] = {
  1166. X  {"debugLevel", "DebugLevel", XtRString, sizeof(char *),
  1167. X    offset(debug_arg), XtRString, (caddr_t) NULL},
  1168. X***************
  1169. X*** 2091,2098 ****
  1170. X    offset(_shrink_factor), XtRString, "3"},
  1171. X  {"densityPercent", "DensityPercent", XtRInt, sizeof(int),
  1172. X    offset(density), XtRString, "40"},
  1173. X  {"pixelsPerInch", "PixelsPerInch", XtRInt, sizeof(int),
  1174. X!   offset(pixels_per_inch), XtRString, "300"},
  1175. X  {"sideMargin", "Margin", XtRString, sizeof(char *),
  1176. X    offset(sidemargin), XtRString, (caddr_t) NULL},
  1177. X  {"topMargin", "Margin", XtRString, sizeof(char *),
  1178. X--- 2178,2189 ----
  1179. X    offset(_shrink_factor), XtRString, "3"},
  1180. X  {"densityPercent", "DensityPercent", XtRInt, sizeof(int),
  1181. X    offset(density), XtRString, "40"},
  1182. X+ #ifdef    GREY
  1183. X+ {"gamma", "Gamma", XtRFloat, sizeof(float),
  1184. X+   offset(gamma), XtRString, "1"},
  1185. X+ #endif
  1186. X  {"pixelsPerInch", "PixelsPerInch", XtRInt, sizeof(int),
  1187. X!   offset(pixels_per_inch), XtRInt, (caddr_t) &basedpi},
  1188. X  {"sideMargin", "Margin", XtRString, sizeof(char *),
  1189. X    offset(sidemargin), XtRString, (caddr_t) NULL},
  1190. X  {"topMargin", "Margin", XtRString, sizeof(char *),
  1191. X***************
  1192. X*** 2144,2150 ****
  1193. X  {"thorough", "Thorough", XtRBoolean, sizeof(Boolean),
  1194. X    offset(thorough), XtRString, "false"},
  1195. X  {"version", "Version", XtRBoolean, sizeof(Boolean),
  1196. X!   offset(version), XtRString, "false"},
  1197. X  #ifdef    BUTTONS
  1198. X  {"expert", "Expert", XtRBoolean, sizeof(Boolean),
  1199. X    offset(expert), XtRString, "false"},
  1200. X--- 2235,2241 ----
  1201. X  {"thorough", "Thorough", XtRBoolean, sizeof(Boolean),
  1202. X    offset(thorough), XtRString, "false"},
  1203. X  {"version", "Version", XtRBoolean, sizeof(Boolean),
  1204. X!   offset(version_flag), XtRString, "false"},
  1205. X  #ifdef    BUTTONS
  1206. X  {"expert", "Expert", XtRBoolean, sizeof(Boolean),
  1207. X    offset(expert), XtRString, "false"},
  1208. X***************
  1209. X*** 2230,2236 ****
  1210. X      _Xconst    char    *name;
  1211. X      _Xconst    char    *resource;
  1212. X      enum    {FalseArg, TrueArg, StickyArg, SepArg} argclass;
  1213. X!     enum    {BooleanArg, StringArg, NumberArg} argtype;
  1214. X      int    classcount;
  1215. X      caddr_t    address;
  1216. X  }    options[] = {
  1217. X--- 2321,2327 ----
  1218. X      _Xconst    char    *name;
  1219. X      _Xconst    char    *resource;
  1220. X      enum    {FalseArg, TrueArg, StickyArg, SepArg} argclass;
  1221. X!     enum    {BooleanArg, StringArg, NumberArg, FloatArg} argtype;
  1222. X      int    classcount;
  1223. X      caddr_t    address;
  1224. X  }    options[] = {
  1225. X***************
  1226. X*** 2241,2246 ****
  1227. X--- 2332,2340 ----
  1228. X  {"-s",        "shrinkFactor", SepArg, NumberArg, 1,    (caddr_t) &shrink_factor},
  1229. X  {"-S",        NULL,        SepArg, NumberArg, 2,    (caddr_t) &density},
  1230. X  {"-density",    "densityPercent", SepArg, NumberArg, 1,    (caddr_t) &density},
  1231. X+ #ifdef    GREY
  1232. X+ {"-gamma",    "gamma",    SepArg,    FloatArg, 1,    (caddr_t) &gamma},
  1233. X+ #endif
  1234. X  {"-p",        "pixelsPerInch", SepArg, NumberArg, 1,    (caddr_t) &pixels_per_inch},
  1235. X  {"-margins",    "Margin",    SepArg,    StringArg, 3,    (caddr_t) &margins},
  1236. X  {"-sidemargin",    "sideMargin",    SepArg,    StringArg, 1,    (caddr_t) &sidemargin},
  1237. X***************
  1238. X*** 2284,2291 ****
  1239. X  {"+copy",    "copy",        FalseArg, BooleanArg, 1,(caddr_t) ©},
  1240. X  {"-thorough",    NULL,        TrueArg, BooleanArg, 2,    (caddr_t) &thorough},
  1241. X  {"+thorough",    "thorough",    FalseArg, BooleanArg, 1,(caddr_t) &thorough},
  1242. X! {"-version",    NULL,        TrueArg, BooleanArg, 2,    (caddr_t) &version},
  1243. X! {"+version",    "version",    FalseArg, BooleanArg, 1,(caddr_t) &version},
  1244. X  #endif    /* X10 */
  1245. X  {"-mgs",    NULL,        SepArg, NumberArg, 2,    (caddr_t) &mg_size[0]},
  1246. X  {"-mgs1",    "magnifierSize1",SepArg, NumberArg, 1,    (caddr_t) &mg_size[0]},
  1247. X--- 2378,2385 ----
  1248. X  {"+copy",    "copy",        FalseArg, BooleanArg, 1,(caddr_t) ©},
  1249. X  {"-thorough",    NULL,        TrueArg, BooleanArg, 2,    (caddr_t) &thorough},
  1250. X  {"+thorough",    "thorough",    FalseArg, BooleanArg, 1,(caddr_t) &thorough},
  1251. X! {"-version",    NULL,        TrueArg, BooleanArg, 2,    (caddr_t)&version_flag},
  1252. X! {"+version",    "version",    FalseArg, BooleanArg, 1,(caddr_t)&version_flag},
  1253. X  #endif    /* X10 */
  1254. X  {"-mgs",    NULL,        SepArg, NumberArg, 2,    (caddr_t) &mg_size[0]},
  1255. X  {"-mgs1",    "magnifierSize1",SepArg, NumberArg, 1,    (caddr_t) &mg_size[0]},
  1256. X***************
  1257. X*** 2379,2384 ****
  1258. X--- 2473,2479 ----
  1259. X          switch (candidate->argtype) {
  1260. X          case StringArg:    *((char **) addr) = optstring; break;
  1261. X          case NumberArg:    *((int *) addr) = atoi(optstring); break;
  1262. X+         case FloatArg:  *((float *) addr) = atof(optstring); break;
  1263. X          default:  ;
  1264. X          }
  1265. X      }
  1266. X***************
  1267. X*** 2403,2408 ****
  1268. X--- 2498,2507 ----
  1269. X                  case NumberArg:
  1270. X                  *((int *) candidate->address) = *((int *) addr);
  1271. X                  break;
  1272. X+                 case FloatArg:
  1273. X+                 *((float *) candidate->address) =
  1274. X+                     *((float *) addr);
  1275. X+                 break;
  1276. X              }
  1277. X              candidate->resource = NULL;
  1278. X              }
  1279. X***************
  1280. X*** 2432,2437 ****
  1281. X--- 2531,2540 ----
  1282. X              lastopt = opt + opt->classcount;
  1283. X              for (candidate = opt; candidate < lastopt; ++candidate)
  1284. X              if (candidate->resource != NULL) switch (opt->argtype) {
  1285. X+                 case BooleanArg:
  1286. X+                 *((Boolean *) candidate->address) =
  1287. X+                     (strcmp(optstring, "on") == 0);
  1288. X+                 break;
  1289. X                  case StringArg:
  1290. X                  *((char **) candidate->address) = optstring;
  1291. X                  break;
  1292. X***************
  1293. X*** 2438,2446 ****
  1294. X                  case NumberArg:
  1295. X                  *((int *) candidate->address) = atoi(optstring);
  1296. X                  break;
  1297. X!                 case BooleanArg:
  1298. X!                 *((Boolean *) candidate->address) =
  1299. X!                     (strcmp(optstring, "on") == 0);
  1300. X              }
  1301. X          }
  1302. X  }
  1303. X--- 2541,2549 ----
  1304. X                  case NumberArg:
  1305. X                  *((int *) candidate->address) = atoi(optstring);
  1306. X                  break;
  1307. X!                 case FloatArg:
  1308. X!                 *((float *) candidate->address) =
  1309. X!                     atof(optstring);
  1310. X              }
  1311. X          }
  1312. X  }
  1313. X***************
  1314. X*** 2634,2648 ****
  1315. X          current_page = (*curr_page ? atoi(curr_page) : total_pages) - 1;
  1316. X          if (current_page < 0 || current_page >= total_pages) usage();
  1317. X      }
  1318. X!     if (RESOURCE(version)) puts((_Xconst char *) &header);
  1319. X  
  1320. X- #ifdef    GREY
  1321. X-     if (DefaultDepthOfScreen(SCRN) == 1)
  1322. X-         use_grey = False;
  1323. X-     if (use_grey)
  1324. X-         init_pix();
  1325. X- #endif
  1326. X- 
  1327. X  #ifndef X10
  1328. X  
  1329. X      /*
  1330. X--- 2737,2744 ----
  1331. X          current_page = (*curr_page ? atoi(curr_page) : total_pages) - 1;
  1332. X          if (current_page < 0 || current_page >= total_pages) usage();
  1333. X      }
  1334. X!     if (RESOURCE(version_flag)) Puts((_Xconst char *) &version);
  1335. X  
  1336. X  #ifndef X10
  1337. X  
  1338. X      /*
  1339. X***************
  1340. X*** 2655,2661 ****
  1341. X          if (!RESOURCE(back_color))
  1342. X          RESOURCE(back_Pixel) = BlackPixelOfScreen(SCRN);
  1343. X          /* Set them nonzero */
  1344. X!         RESOURCE(fore_color) = RESOURCE(back_color) = (char *) &header;
  1345. X      } else {
  1346. X          if (!RESOURCE(fore_color))
  1347. X          RESOURCE(fore_Pixel) = BlackPixelOfScreen(SCRN);
  1348. X--- 2751,2757 ----
  1349. X          if (!RESOURCE(back_color))
  1350. X          RESOURCE(back_Pixel) = BlackPixelOfScreen(SCRN);
  1351. X          /* Set them nonzero */
  1352. X!         RESOURCE(fore_color) = RESOURCE(back_color) = (char *) &version;
  1353. X      } else {
  1354. X          if (!RESOURCE(fore_color))
  1355. X          RESOURCE(fore_Pixel) = BlackPixelOfScreen(SCRN);
  1356. X***************
  1357. X*** 2662,2668 ****
  1358. X          if (!RESOURCE(back_color))
  1359. X          RESOURCE(back_Pixel) = WhitePixelOfScreen(SCRN);
  1360. X      }
  1361. X!     if (!RESOURCE(brdr_color)) RESOURCE(brdr_Pixel) = RESOURCE(fore_Pixel);
  1362. X      {
  1363. X          XGCValues    values;
  1364. X          Pixel    set_bits = (Pixel)
  1365. X--- 2758,2787 ----
  1366. X          if (!RESOURCE(back_color))
  1367. X          RESOURCE(back_Pixel) = WhitePixelOfScreen(SCRN);
  1368. X      }
  1369. X! 
  1370. X! #ifdef    GREY
  1371. X!     if (DefaultDepthOfScreen(SCRN) == 1)
  1372. X!         use_grey = False;
  1373. X! #endif
  1374. X! 
  1375. X! #ifdef    TOOLKIT
  1376. X!     if (resource.copy_arg)
  1377. X! #else
  1378. X!     if (copy == 2)
  1379. X! #endif
  1380. X! #ifdef    GREY
  1381. X!         RESOURCE(copy) = (!RESOURCE(thorough) && !use_grey
  1382. X!         && DefaultDepthOfScreen(SCRN) > 1);
  1383. X! #else
  1384. X!         RESOURCE(copy) = (!RESOURCE(thorough)
  1385. X!         && DefaultDepthOfScreen(SCRN) > 1);
  1386. X! #endif
  1387. X! 
  1388. X! #ifdef    GREY
  1389. X!     if (use_grey)
  1390. X!         init_pix(True);
  1391. X!     else
  1392. X! #endif
  1393. X      {
  1394. X          XGCValues    values;
  1395. X          Pixel    set_bits = (Pixel)
  1396. X***************
  1397. X*** 2669,2685 ****
  1398. X                  (RESOURCE(fore_Pixel) & ~RESOURCE(back_Pixel));
  1399. X          Pixel    clr_bits = (Pixel)
  1400. X                  (RESOURCE(back_Pixel) & ~RESOURCE(fore_Pixel));
  1401. X  #define    MakeGC(fcn, fg, bg)    (values.function = fcn, values.foreground=fg,\
  1402. X          values.background=bg,\
  1403. X          XCreateGC(DISP, RootWindowOfScreen(SCRN),\
  1404. X              GCFunction|GCForeground|GCBackground, &values))
  1405. X  
  1406. X- #ifdef    TOOLKIT
  1407. X-         if (resource.copy_arg)
  1408. X- #else
  1409. X-         if (copy == 2)
  1410. X- #endif
  1411. X-         RESOURCE(copy) = (DefaultDepthOfScreen(SCRN) > 1);
  1412. X          if (RESOURCE(copy) || (set_bits && clr_bits))
  1413. X          ruleGC = MakeGC(GXcopy,
  1414. X              RESOURCE(fore_Pixel), RESOURCE(back_Pixel));
  1415. X--- 2788,2799 ----
  1416. X                  (RESOURCE(fore_Pixel) & ~RESOURCE(back_Pixel));
  1417. X          Pixel    clr_bits = (Pixel)
  1418. X                  (RESOURCE(back_Pixel) & ~RESOURCE(fore_Pixel));
  1419. X+ 
  1420. X  #define    MakeGC(fcn, fg, bg)    (values.function = fcn, values.foreground=fg,\
  1421. X          values.background=bg,\
  1422. X          XCreateGC(DISP, RootWindowOfScreen(SCRN),\
  1423. X              GCFunction|GCForeground|GCBackground, &values))
  1424. X  
  1425. X          if (RESOURCE(copy) || (set_bits && clr_bits))
  1426. X          ruleGC = MakeGC(GXcopy,
  1427. X              RESOURCE(fore_Pixel), RESOURCE(back_Pixel));
  1428. X***************
  1429. X*** 2686,2692 ****
  1430. X          if (RESOURCE(copy)) foreGC = ruleGC;
  1431. X          else if (!RESOURCE(thorough) && ruleGC) {
  1432. X          foreGC = ruleGC;
  1433. X!         puts("Note:  overstrike characters may be incorrect.");
  1434. X          }
  1435. X          else {
  1436. X          if (set_bits) foreGC = MakeGC(GXor, set_bits, 0);
  1437. X--- 2800,2806 ----
  1438. X          if (RESOURCE(copy)) foreGC = ruleGC;
  1439. X          else if (!RESOURCE(thorough) && ruleGC) {
  1440. X          foreGC = ruleGC;
  1441. X!         Puts("Note:  overstrike characters may be incorrect.");
  1442. X          }
  1443. X          else {
  1444. X          if (set_bits) foreGC = MakeGC(GXor, set_bits, 0);
  1445. X***************
  1446. X*** 2695,2700 ****
  1447. X--- 2809,2819 ----
  1448. X              MakeGC(GXandInverted, clr_bits, 0);
  1449. X          if (!ruleGC) ruleGC = foreGC;
  1450. X          }
  1451. X+     }
  1452. X+ 
  1453. X+     {
  1454. X+         XGCValues    values;
  1455. X+ 
  1456. X          highGC = ruleGC;
  1457. X          if (RESOURCE(high_color))
  1458. X          highGC = MakeGC(GXcopy,
  1459. X***************
  1460. X*** 2701,2706 ****
  1461. X--- 2820,2827 ----
  1462. X              RESOURCE(hl_Pixel), RESOURCE(back_Pixel));
  1463. X      }
  1464. X  
  1465. X+     if (!RESOURCE(brdr_color)) RESOURCE(brdr_Pixel) = RESOURCE(fore_Pixel);
  1466. X+ 
  1467. X  #ifndef    VMS
  1468. X      ready_cursor = XCreateFontCursor(DISP, XC_cross);
  1469. X      redraw_cursor = XCreateFontCursor(DISP, XC_watch);
  1470. X***************
  1471. X*** 2752,2758 ****
  1472. X      }
  1473. X          /* Set icon pixmap */
  1474. X      XtGetValues(top_level, temp_args3, XtNumber(temp_args3));
  1475. X!     if (icon_pm == NULL) {
  1476. X          temp_args3[0].value = (XtArgVal) (XCreateBitmapFromData(DISP,
  1477. X                  RootWindowOfScreen(SCRN),
  1478. X                  xdvi_bits, xdvi_width, xdvi_height));
  1479. X--- 2873,2879 ----
  1480. X      }
  1481. X          /* Set icon pixmap */
  1482. X      XtGetValues(top_level, temp_args3, XtNumber(temp_args3));
  1483. X!     if (icon_pm == (Pixmap) 0) {
  1484. X          temp_args3[0].value = (XtArgVal) (XCreateBitmapFromData(DISP,
  1485. X                  RootWindowOfScreen(SCRN),
  1486. X                  xdvi_bits, xdvi_width, xdvi_height));
  1487. Xdiff -cr xdvi_old/xdvi.h xdvi_new/xdvi.h
  1488. X*** xdvi_old/xdvi.h    Tue Jun 16 14:18:59 1992
  1489. X--- xdvi_new/xdvi.h    Mon Jul 27 10:41:53 1992
  1490. X***************
  1491. X*** 24,29 ****
  1492. X--- 24,37 ----
  1493. X  #include <sys/file.h>
  1494. X  #endif    /* X10 */
  1495. X  
  1496. X+ #ifndef    XlibSpecificationRelease
  1497. X+ #define    XlibSpecificationRelease 0
  1498. X+ #endif
  1499. X+ 
  1500. X+ #if    XlibSpecificationRelease >= 5
  1501. X+ #include <X11/Xfuncs.h>
  1502. X+ #endif
  1503. X+ 
  1504. X  #ifdef    VMS
  1505. X  #include <string.h>
  1506. X  #define    index    strchr
  1507. X***************
  1508. X*** 84,94 ****
  1509. X  #endif    /* STDC */
  1510. X  #endif    /* _Xconst */
  1511. X  
  1512. X! #ifndef    __GNUC__
  1513. X! #define    volatile
  1514. X  #endif
  1515. X  
  1516. X  #define    Printf    (void) printf
  1517. X  #define    Fprintf    (void) fprintf
  1518. X  #define    Sprintf    (void) sprintf
  1519. X  #define    Fseek    (void) fseek
  1520. X--- 92,115 ----
  1521. X  #endif    /* STDC */
  1522. X  #endif    /* _Xconst */
  1523. X  
  1524. X! #ifndef    VOLATILE
  1525. X! #if    defined(__STDC__) || (defined(__stdc__) && defined(__convex__))
  1526. X! #define    VOLATILE    volatile
  1527. X! #else
  1528. X! #define    VOLATILE    /* nothing */
  1529. X  #endif
  1530. X+ #endif
  1531. X  
  1532. X+ #ifndef    NORETURN
  1533. X+ #ifdef    __GNUC__
  1534. X+ #define    NORETURN    volatile
  1535. X+ #else
  1536. X+ #define    NORETURN    /* nothing */
  1537. X+ #endif
  1538. X+ #endif
  1539. X+ 
  1540. X  #define    Printf    (void) printf
  1541. X+ #define    Puts    (void) puts
  1542. X  #define    Fprintf    (void) fprintf
  1543. X  #define    Sprintf    (void) sprintf
  1544. X  #define    Fseek    (void) fseek
  1545. X***************
  1546. X*** 278,283 ****
  1547. X--- 299,306 ----
  1548. X   * We then change the sizes to SPELL units (unshrunk pixel / 2^16).
  1549. X   */
  1550. X  
  1551. X+ #define    NOMAGSTP (-29999)
  1552. X+ 
  1553. X  #if    NeedFunctionPrototypes
  1554. X  typedef    void (*read_char_proc)(struct font *, WIDEARG(ubyte, int));
  1555. X  #else
  1556. X***************
  1557. X*** 288,293 ****
  1558. X--- 311,317 ----
  1559. X      struct font *next;        /* link to next font info block */
  1560. X      char *fontname;            /* name of font */
  1561. X      float fsize;            /* size information (dots per inch) */
  1562. X+     int magstepval;            /* magstep number * two, or NOMAGSTP */
  1563. X      FILE *file;            /* open font file or NULL */
  1564. X      char *filename;            /* name of font file */
  1565. X      unsigned short timestamp;    /* for LRU management of fonts */
  1566. X***************
  1567. X*** 337,343 ****
  1568. X  
  1569. X  EXTERN    Boolean    list_fonts    NTINIT(False);
  1570. X  
  1571. X! EXTERN    int    pixels_per_inch    NTINIT(300);
  1572. X  EXTERN    int    offset_x, offset_y;
  1573. X  EXTERN    int    unshrunk_paper_w, unshrunk_paper_h;
  1574. X  EXTERN    int    unshrunk_page_w, unshrunk_page_h;
  1575. X--- 361,371 ----
  1576. X  
  1577. X  EXTERN    Boolean    list_fonts    NTINIT(False);
  1578. X  
  1579. X! #ifndef    BDPI
  1580. X! #define    BDPI    300
  1581. X! #endif
  1582. X! 
  1583. X! EXTERN    int    pixels_per_inch    NTINIT(BDPI);
  1584. X  EXTERN    int    offset_x, offset_y;
  1585. X  EXTERN    int    unshrunk_paper_w, unshrunk_paper_h;
  1586. X  EXTERN    int    unshrunk_page_w, unshrunk_page_h;
  1587. X***************
  1588. X*** 368,376 ****
  1589. X  #ifndef    X10
  1590. X  EXTERN    Display    *DISP;
  1591. X  EXTERN    Screen    *SCRN;
  1592. X! EXTERN    long    pixel4[17];
  1593. X! EXTERN    long    pixel3[10];
  1594. X! EXTERN    long    pixel2[5];
  1595. X  EXTERN    Boolean    use_grey    NTINIT(True);
  1596. X  #else    /* Sorry - GREY works only with X11 */
  1597. X  #undef    GREY
  1598. X--- 396,403 ----
  1599. X  #ifndef    X10
  1600. X  EXTERN    Display    *DISP;
  1601. X  EXTERN    Screen    *SCRN;
  1602. X! EXTERN    unsigned long    palette[17];
  1603. X! EXTERN    unsigned long    *pixeltbl;
  1604. X  EXTERN    Boolean    use_grey    NTINIT(True);
  1605. X  #else    /* Sorry - GREY works only with X11 */
  1606. X  #undef    GREY
  1607. X***************
  1608. X*** 394,408 ****
  1609. X  extern    void    put_rectangle(int, int, int, int, WIDEARG(Boolean, int));
  1610. X  extern    void    redraw_page(void);
  1611. X  #if    NeedVarargsPrototypes
  1612. X! extern    volatile void    oops(_Xconst char *, ...);
  1613. X  #else
  1614. X! extern    volatile void    oops();
  1615. X  #endif
  1616. X  extern    char    *xmalloc(unsigned, _Xconst char *);
  1617. X  extern    void    alloc_bitmap(struct bitmap *);
  1618. X  extern    FILE    *xfopen(_Xconst char *);
  1619. X! extern    unsigned long    num(FILE *, WIDEARG(ubyte, int));
  1620. X! extern    long    snum(FILE *, WIDEARG(ubyte, int));
  1621. X  extern    void    reset_fonts(void);
  1622. X  extern    void    realloc_font(struct font *, WIDEARG(ubyte, int));
  1623. X  extern    void    realloc_virtual_font(struct font *, WIDEARG(ubyte, int));
  1624. X--- 421,435 ----
  1625. X  extern    void    put_rectangle(int, int, int, int, WIDEARG(Boolean, int));
  1626. X  extern    void    redraw_page(void);
  1627. X  #if    NeedVarargsPrototypes
  1628. X! extern    NORETURN void    oops(_Xconst char *, ...);
  1629. X  #else
  1630. X! extern    NORETURN void    oops();
  1631. X  #endif
  1632. X  extern    char    *xmalloc(unsigned, _Xconst char *);
  1633. X  extern    void    alloc_bitmap(struct bitmap *);
  1634. X  extern    FILE    *xfopen(_Xconst char *);
  1635. X! extern    unsigned long    num(FILE *, int);
  1636. X! extern    long    snum(FILE *, int);
  1637. X  extern    void    reset_fonts(void);
  1638. X  extern    void    realloc_font(struct font *, WIDEARG(ubyte, int));
  1639. X  extern    void    realloc_virtual_font(struct font *, WIDEARG(ubyte, int));
  1640. X***************
  1641. X*** 422,428 ****
  1642. X  extern    void    draw_page(void);
  1643. X  extern    void    init_font_open(void);
  1644. X  extern    FILE    *font_open(_Xconst char *, char **,
  1645. X!             WIDEARG(float, double), int *, char **);
  1646. X  extern    void    applicationDoSpecial(char *);
  1647. X  extern    void    read_PK_index(struct font *);
  1648. X  extern    void    read_GF_index(struct font *);
  1649. X--- 449,455 ----
  1650. X  extern    void    draw_page(void);
  1651. X  extern    void    init_font_open(void);
  1652. X  extern    FILE    *font_open(_Xconst char *, char **,
  1653. X!             WIDEARG(float, double), int *, int, char **);
  1654. X  extern    void    applicationDoSpecial(char *);
  1655. X  extern    void    read_PK_index(struct font *);
  1656. X  extern    void    read_GF_index(struct font *);
  1657. X***************
  1658. X*** 440,446 ****
  1659. X  #endif
  1660. X  extern    void    put_rectangle();
  1661. X  extern    void    redraw_page();
  1662. X! extern    volatile void    oops();
  1663. X  extern    char    *xmalloc();
  1664. X  extern    void    alloc_bitmap();
  1665. X  extern    FILE    *xfopen();
  1666. X--- 467,473 ----
  1667. X  #endif
  1668. X  extern    void    put_rectangle();
  1669. X  extern    void    redraw_page();
  1670. X! extern    NORETURN void    oops();
  1671. X  extern    char    *xmalloc();
  1672. X  extern    void    alloc_bitmap();
  1673. X  extern    FILE    *xfopen();
  1674. Xdiff -cr xdvi_old/xdvi_man.sed xdvi_new/xdvi_man.sed
  1675. X*** xdvi_old/xdvi_man.sed    Fri Jun 19 12:51:18 1992
  1676. X--- xdvi_new/xdvi_man.sed    Sat Sep 12 15:31:34 1992
  1677. X***************
  1678. X*** 19,24 ****
  1679. X--- 19,27 ----
  1680. X  [\-geometry \fIgeometry\fP] [\-icongeometry \fIgeometry\fP] [\-iconic]
  1681. X  [\-display \fIdisplay\fP] [\-copy] [\-thorough]
  1682. X  #endif
  1683. X+ #ifgrey
  1684. X+ [\-nogrey] [\-gamma \fIgamma\fP]
  1685. X+ #endif
  1686. X  #ifbuttons
  1687. X  [\-expert]
  1688. X  #endif
  1689. X***************
  1690. X*** 52,58 ****
  1691. X  #endif
  1692. X  .SH OPTIONS
  1693. X  In addition to specifying the .\fPdvi\fR file (with or without the .\fPdvi\fR),
  1694. X! \fIXdvi\fR supports the following command line options.
  1695. X  If the option begins with a
  1696. X  .RB ` + '
  1697. X  instead of a
  1698. X--- 55,61 ----
  1699. X  #endif
  1700. X  .SH OPTIONS
  1701. X  In addition to specifying the .\fPdvi\fR file (with or without the .\fPdvi\fR),
  1702. X! \fIxdvi\fR supports the following command line options.
  1703. X  If the option begins with a
  1704. X  .RB ` + '
  1705. X  instead of a
  1706. X***************
  1707. X*** 170,176 ****
  1708. X--- 173,183 ----
  1709. X  Always use the \fIcopy\fR operation when writing characters to the display.
  1710. X  This option may be necessary for correct operation on a color display, but
  1711. X  overstrike characters will be incorrect.
  1712. X+ #ifgrey
  1713. X+ If greyscale anti-aliasing is in use, the \fIcopy\fR operation will disable
  1714. X+ the use of colorplanes and make overstrikes come out incorrectly.
  1715. X  #endif
  1716. X+ #endif
  1717. X  .TP
  1718. X  .B \-keep
  1719. X  (%%dot%%keepPosition)
  1720. X***************
  1721. X*** 245,250 ****
  1722. X--- 252,265 ----
  1723. X  (In this case, the logic of the corresponding resource is the reverse:
  1724. X  -nogrey corresponds to grey:off; +nogrey to grey:on.)
  1725. X  See also the `G' keystroke.
  1726. X+ .TP
  1727. X+ .BI \-gamma " gamma"
  1728. X+ (.gamma)
  1729. X+ Controls the interpolation of colors in the greyscale anti-aliasing color
  1730. X+ palette.  Default value is 1.0.  For 0 < \fIgamma\fR < 1, the fonts will
  1731. X+ be lighter (more like the background), and for \fIgamma\fR > 1, the fonts
  1732. X+ will be darker (more like the foreground).  Negative values behave the
  1733. X+ same way, but use a slightly different algorithm.
  1734. X  #endif
  1735. X  .TP
  1736. X  #ifx11
  1737. X
  1738. X
  1739. END_OF_FILE
  1740.   if test 47834 -ne `wc -c <'xdvi.p16.2'`; then
  1741.     echo shar: \"'xdvi.p16.2'\" unpacked with wrong size!
  1742.   fi
  1743.   # end of 'xdvi.p16.2'
  1744. fi
  1745. echo shar: End of archive 1 \(of 2\).
  1746. cp /dev/null ark1isdone
  1747. MISSING=""
  1748. for I in 1 2 ; do
  1749.     if test ! -f ark${I}isdone ; then
  1750.     MISSING="${MISSING} ${I}"
  1751.     fi
  1752. done
  1753. if test "${MISSING}" = "" ; then
  1754.     echo You have unpacked both archives.
  1755.     rm -f ark[1-9]isdone
  1756. else
  1757.     echo You still must unpack the following archives:
  1758.     echo "        " ${MISSING}
  1759. fi
  1760. exit 0
  1761. exit 0 # Just in case...
  1762. -- 
  1763.   // chris@IMD.Sterling.COM       | Send comp.sources.x submissions to:
  1764. \X/  Amiga - The only way to fly! |    sources-x@imd.sterling.com
  1765.  "It's intuitively obvious to the |
  1766.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  1767.