home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume5 / xdvi / patch6b < prev    next >
Encoding:
Internet Message Format  |  1989-12-06  |  51.4 KB

  1. Path: uunet!island!guinness.ias.edu
  2. From: vojta@guinness.ias.edu (Paul A Vojta)
  3. Newsgroups: comp.sources.x
  4. Subject: v05i036: xdvi, dvi previewer, patch 6, part 2/2
  5. Message-ID: <1231@island.uu.net>
  6. Date: 5 Dec 89 18:45:42 GMT
  7. Sender: argv@island.uu.net
  8. Lines: 1713
  9. Approved: island!argv@sun.com
  10.  
  11. Submitted-by: vojta@guinness.ias.edu (Paul A Vojta)
  12. Posting-number: Volume 5, Issue 36
  13. Archive-name: xdvi/patch6
  14. Patch-To: xdvi: Volume 3, Issue 37-39,46,67
  15. Patch-To: xdvi: Volume 4, Issue 44,96
  16.  
  17.  
  18. diff -cr old/xdvi.c new/xdvi.c
  19. *** old/xdvi.c    Fri Nov 17 21:23:15 1989
  20. --- new/xdvi.c    Fri Nov 17 21:51:55 1989
  21. ***************
  22. *** 17,26 ****
  23.    *    SYSV    compile for System V
  24.    *    X10    compile for X10
  25.    *    NOTOOL    compile without toolkit (X11 only)
  26. !  *    MSBITFIRST    store bitmaps internally in with significant bit first
  27.    *    BMSHORT    store bitmaps in shorts instead of bytes
  28.    *    BMLONG    store bitmaps in longs instead of bytes
  29. !  *    ALTFONT    default for -altfont option.
  30.    */
  31.   #ifndef lint
  32.   #include "patchlevel.h"
  33. --- 17,28 ----
  34.    *    SYSV    compile for System V
  35.    *    X10    compile for X10
  36.    *    NOTOOL    compile without toolkit (X11 only)
  37. !  *    BUTTONS    compile with buttons on the side of the window (needs toolkit)
  38. !  *    MSBITFIRST    store bitmaps internally with most significant bit first
  39.    *    BMSHORT    store bitmaps in shorts instead of bytes
  40.    *    BMLONG    store bitmaps in longs instead of bytes
  41. !  *    ALTFONT    default for -altfont option
  42. !  *    A4    use European size paper
  43.    */
  44.   #ifndef lint
  45.   #include "patchlevel.h"
  46. ***************
  47. *** 36,45 ****
  48. --- 38,56 ----
  49.   #define    ALTFONT    "cmr10"
  50.   #endif    ALTFONT
  51.   
  52. + #ifndef    A4
  53. + #define    DEFAULT_PAGE_WIDTH    "8.5"
  54. + #define    DEFAULT_PAGE_HEIGHT    "11"
  55. + #else    A4
  56. + #define    DEFAULT_PAGE_WIDTH    "8.3"
  57. + #define    DEFAULT_PAGE_HEIGHT    "11.7"
  58. + #endif    A4
  59.   #if    !defined(X10) && !defined(NOTOOL)
  60.   #define    TOOLKIT
  61.   #else
  62.   #undef    TOOLKIT
  63. + #undef    BUTTONS
  64.   #endif
  65.   
  66.   #ifndef X10
  67. ***************
  68. *** 62,67 ****
  69. --- 73,82 ----
  70.   #endif not OLD_X11_TOOLKIT
  71.   #include <X11/Shell.h>    /* needed for def. of XtNiconX */
  72.   #include <X11/Viewport.h>
  73. + #ifdef    BUTTONS
  74. + #include <X11/Form.h>
  75. + #include <X11/Command.h>
  76. + #endif    BUTTONS
  77.   #else    TOOLKIT
  78.   #define    XtNumber(arr)    (sizeof(arr)/sizeof(arr[0]))
  79.   typedef    int        Position;
  80. ***************
  81. *** 117,124 ****
  82.   #endif X10
  83.   
  84.   #define    MAGBORD    1    /* border size for magnifier */
  85. - char    *font_path;
  86. - char    default_font_path[]    = DEFAULT_FONT_PATH;
  87.   char    *alt_font = ALTFONT;
  88.   
  89.   /*
  90. --- 132,137 ----
  91. ***************
  92. *** 129,134 ****
  93. --- 142,150 ----
  94.   
  95.   int    density = 40;
  96.   int    pixels_per_inch = 300;
  97. + int    unshrunk_page_w, unshrunk_page_h;
  98. + static    char    *arg_page_w    = DEFAULT_PAGE_WIDTH;
  99. + static    char    *arg_page_h    = DEFAULT_PAGE_HEIGHT;
  100.   static    char    *margins, *sidemargin, *topmargin;
  101.   static    Boolean    reverse;
  102.   static    Dimension    bwidth    = 2;
  103. ***************
  104. *** 205,210 ****
  105. --- 221,236 ----
  106.   static    Widget    x_bar, y_bar;    /* horizontal and vertical scroll bars */
  107.   
  108.   static    Arg    vport_args[] = {
  109. + #ifdef    BUTTONS
  110. +     {XtNwidth,    (XtArgVal) 0},
  111. +     {XtNheight,    (XtArgVal) 0},
  112. +     {XtNborderWidth, (XtArgVal) 0},
  113. +     {XtNtop,    (XtArgVal) XtChainTop},
  114. +     {XtNbottom,    (XtArgVal) XtChainBottom},
  115. +     {XtNleft,    (XtArgVal) XtChainLeft},
  116. +     {XtNright,    (XtArgVal) XtChainRight},
  117. +     {XtNresizable,    (XtArgVal) True},
  118. + #endif    BUTTONS
  119.       {XtNallowHoriz,    (XtArgVal) True},
  120.       {XtNallowVert,    (XtArgVal) True},
  121.   };
  122. ***************
  123. *** 220,225 ****
  124. --- 246,327 ----
  125.   };
  126.   
  127.   static    void    set_draw_args();
  128. + #ifdef    BUTTONS
  129. + static    Widget    form_widget;
  130. + static    Arg    form_args[] = {
  131. +     {XtNdefaultDistance, (XtArgVal) 0},
  132. + };
  133. + static    struct {
  134. +     char    *label;
  135. +     char    *name;
  136. +     int    closure;
  137. +     int    y_pos;
  138. +     }
  139. +     command_table[] = {
  140. +         {"Quit",    "quit",        'q',        50},
  141. +         {"X1 Mag",    "sh1",        1 << 8 | 's',    150},
  142. +         {"X2 Mag",    "sh2",        2 << 8 | 's',    200},
  143. +         {"X3 Mag",    "sh3",        3 << 8 | 's',    250},
  144. +         {"X4 Mag",    "sh4",        4 << 8 | 's',    300},
  145. +         {"Next",    "next",        'n',        400},
  146. +         {"Page+5",    "next5",    5 << 8 | 'n',    450},
  147. +         {"Page+10",    "next10",    10 << 8 | 'n',    500},
  148. +         {"Prev",    "prev",        'p',        600},
  149. +         {"Page-5",    "prev5",    5 << 8 | 'p',    650},
  150. +         {"Page-10",    "prev10",    10 << 8 | 'p',    700},
  151. + };
  152. + static    Widget    command_wid[XtNumber(command_table)];
  153. + static    void    handle_command();
  154. + static    XtCallbackRec    command_call[] = {
  155. +     {handle_command, NULL},
  156. +     {NULL,        NULL},
  157. + };
  158. + static    Arg    command_args[] = {
  159. +     {XtNlabel,    NULL},
  160. +     {XtNvertDistance, (XtArgVal) 0},
  161. +     {XtNfromHoriz,    (XtArgVal) NULL},
  162. +     {XtNhorizDistance, (XtArgVal) 9},
  163. +     {XtNwidth,    (XtArgVal) 60},
  164. +     {XtNheight,    (XtArgVal) 30},
  165. +     {XtNtop,    (XtArgVal) XtChainTop},
  166. +     {XtNbottom,    (XtArgVal) XtChainTop},
  167. +     {XtNleft,    (XtArgVal) XtChainRight},
  168. +     {XtNright,    (XtArgVal) XtChainRight},
  169. +     {XtNcallback,    (XtArgVal) command_call},
  170. + };
  171. + static    Arg    line_args[] = {
  172. +     {XtNbackground,    (XtArgVal) 0},
  173. +     {XtNwidth,    (XtArgVal) 1},
  174. +     {XtNheight,    (XtArgVal) 0},
  175. +     {XtNfromHoriz,    (XtArgVal) NULL},
  176. +     {XtNborderWidth, (XtArgVal) 0},
  177. +     {XtNtop,    (XtArgVal) XtChainTop},
  178. +     {XtNbottom,    (XtArgVal) XtChainBottom},
  179. +     {XtNleft,    (XtArgVal) XtChainRight},
  180. +     {XtNright,    (XtArgVal) XtChainRight},
  181. +     {XtNresizable,    (XtArgVal) True},
  182. + };
  183. + static    Arg    strut_args[] = {
  184. +     {XtNfromHoriz,    (XtArgVal) NULL},
  185. +     {XtNwidth,    (XtArgVal) 78},
  186. +     {XtNmappedWhenManaged, (XtArgVal) False},
  187. +     {XtNborderWidth, (XtArgVal) 0},
  188. +     {XtNtop,    (XtArgVal) XtChainTop},
  189. +     {XtNbottom,    (XtArgVal) XtChainTop},
  190. +     {XtNleft,    (XtArgVal) XtChainRight},
  191. +     {XtNright,    (XtArgVal) XtChainRight},
  192. + };
  193. + #endif    BUTTONS
  194.   #else    TOOLKIT
  195.   #define    BAR_WID        12    /* width of darkened area */
  196.   #define    BAR_THICK    15    /* gross amount removed */
  197. ***************
  198. *** 229,246 ****
  199.   static    int    x_bgn, x_end, y_bgn, y_end;    /* scrollbar positions */
  200.   #endif    TOOLKIT
  201.   
  202. - #ifdef lint
  203. - #ifndef X10
  204. - char    xdvi_bits[288];
  205. - #ifdef    TOOLKIT
  206. - WidgetClass    viewportWidgetClass, widgetClass;
  207. - #endif    TOOLKIT
  208. - #else X10
  209. - short    xdvi_bits[15], xdvi_mask_bits[15];
  210. - Display    *_XlibCurrentDisplay;
  211. - #endif X10
  212. - #endif lint
  213.   /*
  214.    *    Mechanism to keep track of the magnifier window.  The problems are,
  215.    *    (a) if the button is released while the window is being drawn, this
  216. --- 331,336 ----
  217. ***************
  218. *** 266,277 ****
  219.           sign        = 1;
  220.   static    jmp_buf    canit_env;
  221.   
  222. ! static    void    can_exposures(), read_events();
  223.   
  224.   #ifndef    ANSI_LIB
  225.   char    *sprintf();
  226.   #endif
  227. ! char    *malloc(), *index(), *rindex(), *getenv(), *strcpy(), *strcat();
  228.   
  229.   double    atof();
  230.   
  231. --- 356,382 ----
  232.           sign        = 1;
  233.   static    jmp_buf    canit_env;
  234.   
  235. ! static    void    can_exposures(), read_events(), keystroke();
  236.   
  237. + #ifdef    lint
  238. + #ifndef    X10
  239. + char    xdvi_bits[288];
  240. + #ifdef    TOOLKIT
  241. + WidgetClass    viewportWidgetClass, widgetClass;
  242. + #ifdef    BUTTONS
  243. + WidgetClass    formWidgetClass, commandWidgetClass;
  244. + #endif    BUTTONS
  245. + #endif    TOOLKIT
  246. + #else    X10
  247. + short    xdvi_bits[15], xdvi_mask_bits[15];
  248. + Display    *_XlibCurrentDisplay;
  249. + #endif    X10
  250. + #endif    lint
  251.   #ifndef    ANSI_LIB
  252.   char    *sprintf();
  253.   #endif
  254. ! char    *malloc(), *index(), *rindex(), *strcpy(), *strcat();
  255.   
  256.   double    atof();
  257.   
  258. ***************
  259. *** 504,510 ****
  260.       {XtNy,        (XtArgVal) &window_y},
  261.   };
  262.   
  263. ! #define    get_xy()    XtGetValues(draw_widget, arg_xy, 2)
  264.   
  265.   #define    mane_base_x    0
  266.   #define    mane_base_y    0
  267. --- 609,615 ----
  268.       {XtNy,        (XtArgVal) &window_y},
  269.   };
  270.   
  271. ! #define    get_xy()    XtGetValues(draw_widget, arg_xy, XtNumber(arg_xy))
  272.   
  273.   #define    mane_base_x    0
  274.   #define    mane_base_y    0
  275. ***************
  276. *** 548,555 ****
  277.       };
  278.       register int    old_clip_w;
  279.   
  280. !     XtGetValues(vport_widget, arg_wh, 2);
  281. !     XtGetValues(clip_widget, arg_wh_clip, 2);
  282.       x_bar = XtNameToWidget(vport_widget, "horizontal");
  283.       y_bar = XtNameToWidget(vport_widget, "vertical");
  284.       old_clip_w = clip_w;
  285. --- 653,660 ----
  286.       };
  287.       register int    old_clip_w;
  288.   
  289. !     XtGetValues(vport_widget, arg_wh, XtNumber(arg_wh));
  290. !     XtGetValues(clip_widget, arg_wh_clip, XtNumber(arg_wh_clip));
  291.       x_bar = XtNameToWidget(vport_widget, "horizontal");
  292.       y_bar = XtNameToWidget(vport_widget, "vertical");
  293.       old_clip_w = clip_w;
  294. ***************
  295. *** 598,603 ****
  296. --- 703,721 ----
  297.       resized = True;
  298.   }
  299.   
  300. + #ifdef    BUTTONS
  301. +     /*ARGSUSED*/
  302. + static    void
  303. + handle_command(widget, client_data, call_data)
  304. +     Widget    widget;
  305. +     caddr_t    client_data;
  306. +     caddr_t    call_data;
  307. + {
  308. +     keystroke(((int) client_data) & 0xff, ((int) client_data) >> 8,
  309. +         (((int) client_data) >> 8) != 0, (XEvent *) NULL);
  310. + }
  311. + #endif    BUTTONS
  312.   #else    TOOLKIT
  313.   
  314.   /*
  315. ***************
  316. *** 683,695 ****
  317.           /* process drawing (clip) window */
  318.       if (mane.win == NULL) {    /* initial creation */
  319.   #ifndef X10
  320. !         mane.win = (void *) XCreateSimpleWindow(DISP, top_level,
  321.               y_thick, x_thick, clip_w, clip_h, 0,
  322.               fore_Pixel, back_Pixel);
  323.           XSelectInput(DPY (Window) mane.win, ExposureMask |
  324.               ButtonPressMask | ButtonMotionMask | ButtonReleaseMask);
  325.   #else X10
  326. !         mane.win = (void *) XCreateWindow(top_level,
  327.               y_thick, x_thick, clip_w, clip_h, 0,
  328.               bdrmap, backmap);
  329.           XSelectInput((Window) mane.win,  ExposeRegion | ExposeCopy |
  330. --- 801,813 ----
  331.           /* process drawing (clip) window */
  332.       if (mane.win == NULL) {    /* initial creation */
  333.   #ifndef X10
  334. !         mane.win = (caddr_t) XCreateSimpleWindow(DISP, top_level,
  335.               y_thick, x_thick, clip_w, clip_h, 0,
  336.               fore_Pixel, back_Pixel);
  337.           XSelectInput(DPY (Window) mane.win, ExposureMask |
  338.               ButtonPressMask | ButtonMotionMask | ButtonReleaseMask);
  339.   #else X10
  340. !         mane.win = (caddr_t) XCreateWindow(top_level,
  341.               y_thick, x_thick, clip_w, clip_h, 0,
  342.               bdrmap, backmap);
  343.           XSelectInput((Window) mane.win,  ExposeRegion | ExposeCopy |
  344. ***************
  345. *** 870,876 ****
  346.           attr.border_pixel = fore_Pixel;
  347.           attr.background_pixel = back_Pixel;
  348.           attr.override_redirect = True;
  349. !         alt.win = (void *) XCreateWindow(DISP, RootWindowOfScreen(SCRN),
  350.               x, y, alt.width, alt.height, MAGBORD,
  351.               0,    /* depth from parent */
  352.               InputOutput, CopyFromParent,
  353. --- 988,994 ----
  354.           attr.border_pixel = fore_Pixel;
  355.           attr.background_pixel = back_Pixel;
  356.           attr.override_redirect = True;
  357. !         alt.win = (caddr_t) XCreateWindow(DISP, RootWindowOfScreen(SCRN),
  358.               x, y, alt.width, alt.height, MAGBORD,
  359.               0,    /* depth from parent */
  360.               InputOutput, CopyFromParent,
  361. ***************
  362. *** 878,884 ****
  363.               CWOverrideRedirect, &attr);
  364.           XSelectInput(DISP, (Window) alt.win, ExposureMask);
  365.   #else X10
  366. !         alt.win = (void *) XCreateWindow((Window) mane.win,
  367.               x, y, alt.width, alt.height, MAGBORD,
  368.               bdrmap, backmap);
  369.           XSelectInput((Window) alt.win, ExposeRegion);
  370. --- 996,1002 ----
  371.               CWOverrideRedirect, &attr);
  372.           XSelectInput(DISP, (Window) alt.win, ExposureMask);
  373.   #else X10
  374. !         alt.win = (caddr_t) XCreateWindow((Window) mane.win,
  375.               x, y, alt.width, alt.height, MAGBORD,
  376.               bdrmap, backmap);
  377.           XSelectInput((Window) alt.win, ExposeRegion);
  378. ***************
  379. *** 962,968 ****
  380. --- 1080,1301 ----
  381.   }
  382.   #endif    TOOLKIT
  383.   
  384. + /* |||
  385. +  *    Currently the event handler does not coordinate XCopyArea requests
  386. +  *    with GraphicsExpose events.  This can lead to problems if the window
  387. +  *    is partially obscured and one, for example, drags a scrollbar.
  388. +  */
  389.   #ifndef X10
  390. + #define    XKEY(ev)    (ev).xkey
  391. + #ifndef    TOOLKIT
  392. + #define    XANY(ev)    (ev).xany
  393. + #define    XCONFIG(ev)    (ev).xconfigure
  394. + #define    XEXPOSE(ev)    (ev).xexpose
  395. + #define    XMOTION(ev)    (ev).xmotion
  396. + #define    XBUTTON(ev)    (ev).xbutton
  397. + #define    ISEXPOSE(ev)    ((ev).type == Expose)
  398. + #endif    TOOLKIT
  399. + #else X10
  400. + #define    XANY(ev)    (ev)
  401. + #define    XCONFIG(ev)    (*((XExposeEvent *) &(ev)))
  402. + #define    XEXPOSE(ev)    (*((XExposeEvent *) &(ev)))
  403. + #define    XMOTION(ev)    (*((XMouseMovedEvent *) &(ev)))
  404. + #define    XBUTTON(ev)    (*((XButtonEvent *) &(ev)))
  405. + #define    XKEY(ev)    (*((XKeyEvent *) &(ev)))
  406. + #define    ConfigureNotify    ExposeWindow
  407. + #define    Expose        ExposeRegion
  408. + #define    ISEXPOSE(ev)    ((ev).type == ExposeWindow || (ev).type == ExposeRegion)
  409. + #define    MotionNotify    MouseMoved
  410. + #define    ButtonPress    ButtonPressed
  411. + #define    ButtonRelease    ButtonReleased
  412. + #define    KeyPress    KeyPressed
  413. + #endif X10
  414. + static    void
  415. + keystroke(ch, number0, arg0, eventp)
  416. +     char    ch;
  417. +     int    number0;
  418. +     Boolean    arg0;
  419. +     XEvent    *eventp;
  420. + {
  421. +     int    next_page;
  422. +     next_page = current_page;
  423. +     switch (ch) {
  424. +         case 'q':
  425. +         case '\003':    /* control-C */
  426. +         case '\004':    /* control-D */
  427. +         exit(0);
  428. +         case 'n':
  429. +         case 'f':
  430. +         case ' ':
  431. +         case '\r':
  432. +         case '\n':
  433. +         /* scroll forward; i.e. go to relative page */
  434. +         next_page = current_page + (arg0 ? number0 : 1);
  435. +         break;
  436. +         case 'p':
  437. +         case 'b':
  438. +         case '\b':
  439. +         case '\177':    /* Del */
  440. +         /* scroll backward */
  441. +         next_page = current_page - 1;
  442. +         break;
  443. +         case 'g':
  444. +         /* go to absolute page */
  445. +         next_page = (arg0 ? number0 - pageno_correct :
  446. +             total_pages - 1);
  447. +         break;
  448. +         case 'P':        /* declare current page */
  449. +         pageno_correct = arg0 * number0 - current_page;
  450. +         return;
  451. +         case 'k':        /* toggle keep-position flag */
  452. +         keep_flag = (arg0 ? number0 : !keep_flag);
  453. +         return;
  454. +         case '\f':
  455. +         /* redisplay current page */
  456. +         break;
  457. +         case '^':
  458. +         home(True);
  459. +         return;
  460. + #ifdef    TOOLKIT
  461. +         case 'l':
  462. +         if (!x_bar) goto bad;
  463. +         XtCallCallbacks(x_bar, XtNscrollProc,
  464. +             -2 * (int) clip_w / 3);
  465. +         return;
  466. +         case 'r':
  467. +         if (!x_bar) goto bad;
  468. +         XtCallCallbacks(x_bar, XtNscrollProc,
  469. +             2 * (int) clip_w / 3);
  470. +         return;
  471. +         case 'u':
  472. +         if (!y_bar) goto bad;
  473. +         XtCallCallbacks(y_bar, XtNscrollProc,
  474. +             -2 * (int) clip_h / 3);
  475. +         return;
  476. +         case 'd':
  477. +         if (!y_bar) goto bad;
  478. +         XtCallCallbacks(y_bar, XtNscrollProc,
  479. +             2 * (int) clip_h / 3);
  480. +         return;
  481. +         case 'c':
  482. +         center(eventp->xkey.x, eventp->xkey.y);
  483. +         return;
  484. + #else    TOOLKIT
  485. +         case 'l':
  486. +         if (mane.base_x <= 0) goto bad;
  487. +         scrollmane(mane.base_x - 2 * clip_w / 3, mane.base_y);
  488. +         return;
  489. +         case 'r':
  490. +         if (mane.base_x >= page_w - clip_w) goto bad;
  491. +         scrollmane(mane.base_x + 2 * clip_w / 3, mane.base_y);
  492. +         return;
  493. +         case 'u':
  494. +         if (mane.base_y <= 0) goto bad;
  495. +         scrollmane(mane.base_x, mane.base_y - 2 * clip_h / 3);
  496. +         return;
  497. +         case 'd':
  498. +         if (mane.base_y >= page_h - clip_h) goto bad;
  499. +         scrollmane(mane.base_x, mane.base_y + 2 * clip_h / 3);
  500. +         return;
  501. +         case 'c':    /* unchecked scrollmane() */
  502. +         scrollwindow(&mane, mane.base_x + XKEY(*eventp).x - clip_w/2,
  503. +             mane.base_y + XKEY(*eventp).y - clip_h/2);
  504. +         paint_x_bar();
  505. +         paint_y_bar();
  506. + #ifndef X10
  507. +         XWarpPointer(DISP, None, None, 0, 0, 0, 0,
  508. +             clip_w/2 - XKEY(*eventp).x, clip_h/2 - XKEY(*eventp).y);
  509. + #else X10
  510. +         XWarpMouse(mane.win, clip_w/2, clip_h/2, GXcopy);
  511. + #endif X10
  512. +         return;
  513. + #endif    TOOLKIT
  514. + #ifndef X10
  515. +         case 'M':
  516. +         XTranslateCoordinates(DISP, eventp->xkey.window, mane.win,
  517. +             eventp->xkey.x, eventp->xkey.y, &home_x, &home_y,
  518. +             &number0);    /* throw away last argument */
  519. +         home_x *= mane.shrinkfactor;
  520. +         home_y *= mane.shrinkfactor;
  521. +         return;
  522. +         case '\020':    /* Control P */
  523. +         Printf("Unit = %d, bitord = %d, byteord = %d\n",
  524. +             BitmapUnit(DISP), BitmapBitOrder(DISP),
  525. +             ImageByteOrder(DISP));
  526. +         return;
  527. + #else X10
  528. +         case 'M':
  529. +         home_x = (XKEY(*eventp).x + mane.base_x) * mane.shrinkfactor;
  530. +         home_y = (XKEY(*eventp).y + mane.base_y) * mane.shrinkfactor;
  531. +         return;
  532. + #endif X10
  533. +         case 's':
  534. +         if (!arg0) {
  535. +             long fac1, fac2;
  536. +             shrink_factor = 1;
  537. +             fac1 = ROUNDUP(PAPER_WIDTH, window_w);
  538. +             fac2 = ROUNDUP(PAPER_HEIGHT, window_h);
  539. +             if (fac1 < fac2)
  540. +             number0 = fac2;
  541. +             else
  542. +             number0 = fac1;
  543. +         }
  544. +         if (number0 <= 0) goto bad;
  545. +         if (number0 == mane.shrinkfactor) return;
  546. +         shrink_factor = mane.shrinkfactor = number0;
  547. +         init_page();
  548. +         if (number0 != 1 && number0 != bak_shrink) {
  549. +             bak_shrink = number0;
  550. +             reset_fonts();
  551. +         }
  552. + #ifdef    TOOLKIT
  553. +         XUnmapWindow(DISP, mane.win);
  554. +         set_draw_args();
  555. +         XtSetValues(draw_widget, draw_args, (Cardinal) 2);
  556. +         get_geom();
  557. +         home(False);
  558. +         XMapWindow(DISP, (Window) mane.win);
  559. +         return;
  560. + #else    TOOLKIT
  561. +         reconfig();
  562. +         home(False);
  563. +         break;
  564. + #endif    TOOLKIT
  565. +         case 'S':
  566. +         if (!arg0) goto bad;
  567. +         if (number0 < 0) goto bad;
  568. +         if (number0 == density) return;
  569. +         density = number0;
  570. +         reset_fonts();
  571. +         if (mane.shrinkfactor == 1) return;
  572. +         break;
  573. +         case 'R':
  574. +         /* reread DVI file */
  575. +         --dvi_time;    /* then it will notice a change */
  576. +         break;
  577. +         default:
  578. +         goto bad;
  579. +     }
  580. +     if (0 <= next_page && next_page < total_pages) {
  581. +         if (current_page != next_page) {
  582. +         current_page = next_page;
  583. +         spec_warn = True;
  584. +         if (!keep_flag) home(False);
  585. +         }
  586. +         canit = True;
  587. +         Flush();
  588. +         return;    /* don't use longjmp here:  it might be called from
  589. +              * within the toolkit, and we don't want to longjmp out
  590. +              * of Xt routines. */
  591. +     }
  592. +     bad:  XBell(DISP, 10);
  593. + }
  594. + #ifndef X10
  595.   #define    TRSIZE    100
  596.   #endif X10
  597.   static    void
  598. ***************
  599. *** 978,984 ****
  600.   #endif X10
  601.       char    *string;
  602.       int    nbytes;
  603. -     int    next_page;
  604.   
  605.       alt_canit = False;
  606.       for (;;) {
  607. --- 1311,1316 ----
  608. ***************
  609. *** 985,998 ****
  610.           ch = '\0';
  611.           event_counter = event_freq;
  612.           /*
  613. !          * If we get a hit at this point, then we'll just end up making
  614. !          * an extra call.
  615.            * Also, watch out, if we destroy the magnifying glass while
  616.            * writing it.
  617.            */
  618.           if (!XtPending() && (!wait || canit || mane.min_x < MAXDIM ||
  619.               alt.min_x < MAXDIM || mag_moved))
  620. !         if (alt_canit) longjmp(canit_env, 1);
  621.           else return;
  622.   #ifdef    TOOLKIT
  623.           XtNextEvent(&event);
  624. --- 1317,1331 ----
  625.           ch = '\0';
  626.           event_counter = event_freq;
  627.           /*
  628. !          * The above line clears the flag indicating that an event is
  629. !          * pending.  So if an event comes in right now, the flag will be
  630. !          * set again needlessly, but we just end up making an extra call.
  631.            * Also, watch out, if we destroy the magnifying glass while
  632.            * writing it.
  633.            */
  634.           if (!XtPending() && (!wait || canit || mane.min_x < MAXDIM ||
  635.               alt.min_x < MAXDIM || mag_moved))
  636. !         if (!wait && (canit || alt_canit)) longjmp(canit_env, 1);
  637.           else return;
  638.   #ifdef    TOOLKIT
  639.           XtNextEvent(&event);
  640. ***************
  641. *** 1008,1047 ****
  642.           }
  643.           string = trbuf;
  644.           nbytes = XLookupString(&event, string, TRSIZE, NULL, NULL);
  645. !         if (nbytes > 1) goto bad;
  646.           if (nbytes != 0) ch = *string;
  647.   #else    TOOLKIT
  648.   
  649. - /* |||
  650. -  *    Currently the event handler does not coordinate XCopyArea requests
  651. -  *    with GraphicsExpose events.  This can lead to problems if the window
  652. -  *    is partially obscured and one, for example, drags a scrollbar.
  653. -  */
  654. - #ifndef X10
  655. - #define    XANY(ev)    ev.xany
  656. - #define    XCONFIG(ev)    ev.xconfigure
  657. - #define    XEXPOSE(ev)    ev.xexpose
  658. - #define    XMOTION(ev)    ev.xmotion
  659. - #define    XBUTTON(ev)    ev.xbutton
  660. - #define    XKEY(ev)    ev.xkey
  661. - #define    ISEXPOSE(ev)    ((ev).type == Expose)
  662. - #else X10
  663. - #define    XANY(ev)    ev
  664. - #define    XCONFIG(ev)    (*((XExposeEvent *) &(ev)))
  665. - #define    XEXPOSE(ev)    (*((XExposeEvent *) &(ev)))
  666. - #define    XMOTION(ev)    (*((XMouseMovedEvent *) &(ev)))
  667. - #define    XBUTTON(ev)    (*((XButtonEvent *) &(ev)))
  668. - #define    XKEY(ev)    (*((XKeyEvent *) &(ev)))
  669. - #define    ConfigureNotify    ExposeWindow
  670. - #define    Expose        ExposeRegion
  671. - #define    ISEXPOSE(ev)    ((ev).type == ExposeWindow || (ev).type == ExposeRegion)
  672. - #define    MotionNotify    MouseMoved
  673. - #define    ButtonPress    ButtonPressed
  674. - #define    ButtonRelease    ButtonReleased
  675. - #define    KeyPress    KeyPressed
  676. - #endif X10
  677.           XNextEvent(DPY &event);
  678.           if (XANY(event).window == (Window) mane.win ||
  679.           XANY(event).window == (Window) alt.win) {
  680. --- 1341,1350 ----
  681.           }
  682.           string = trbuf;
  683.           nbytes = XLookupString(&event, string, TRSIZE, NULL, NULL);
  684. !         if (nbytes > 1) ch = '?';
  685.           if (nbytes != 0) ch = *string;
  686.   #else    TOOLKIT
  687.   
  688.           XNextEvent(DPY &event);
  689.           if (XANY(event).window == (Window) mane.win ||
  690.           XANY(event).window == (Window) alt.win) {
  691. ***************
  692. *** 1172,1178 ****
  693.   #else X10
  694.               string = XLookupMapping(&event, &nbytes);
  695.   #endif X10
  696. !             if (nbytes > 1) goto bad;
  697.               if (nbytes != 0) ch = *string;
  698.               break;
  699.           }
  700. --- 1475,1481 ----
  701.   #else X10
  702.               string = XLookupMapping(&event, &nbytes);
  703.   #endif X10
  704. !             if (nbytes > 1) ch = '?';
  705.               if (nbytes != 0) ch = *string;
  706.               break;
  707.           }
  708. ***************
  709. *** 1189,1370 ****
  710.           number = 0;
  711.           continue;
  712.           }
  713. -         arg0 = arg;
  714. -         arg = False;
  715.           number0 = number;
  716.           number = 0;
  717.           sign = 1;
  718. !         next_page = current_page;
  719. !         switch (ch) {
  720. !         case 'q':
  721. !         case '\003':    /* control-C */
  722. !         case '\004':    /* control-D */
  723. !             exit(0);
  724. !         case 'n':
  725. !         case 'f':
  726. !         case ' ':
  727. !         case '\r':
  728. !         case '\n':
  729. !             /* scroll forward; i.e. go to relative page */
  730. !             next_page = current_page + (arg0 ? number0 : 1);
  731. !             break;
  732. !         case 'p':
  733. !         case 'b':
  734. !         case '\b':
  735. !         case '\177':    /* Del */
  736. !             /* scroll backward */
  737. !             next_page = current_page - 1;
  738. !             break;
  739. !         case 'g':
  740. !             /* go to absolute page */
  741. !             next_page = (arg0 ? number0 - pageno_correct :
  742. !             total_pages - 1);
  743. !             break;
  744. !         case 'P':        /* declare current page */
  745. !             pageno_correct = arg0 * number0 - current_page;
  746. !             continue;
  747. !         case 'k':        /* toggle keep-position flag */
  748. !             keep_flag = (arg0 ? number0 : !keep_flag);
  749. !             continue;
  750. !         case '\f':
  751. !             /* redisplay current page */
  752. !             break;
  753. !         case '^':
  754. !             home(True);
  755. !             continue;
  756. ! #ifdef    TOOLKIT
  757. !         case 'l':
  758. !             if (!x_bar) goto bad;
  759. !             XtCallCallbacks(x_bar, XtNscrollProc,
  760. !             -2 * (int) clip_w / 3);
  761. !             continue;
  762. !         case 'r':
  763. !             if (!x_bar) goto bad;
  764. !             XtCallCallbacks(x_bar, XtNscrollProc,
  765. !             2 * (int) clip_w / 3);
  766. !             continue;
  767. !         case 'u':
  768. !             if (!y_bar) goto bad;
  769. !             XtCallCallbacks(y_bar, XtNscrollProc,
  770. !             -2 * (int) clip_h / 3);
  771. !             continue;
  772. !         case 'd':
  773. !             if (!y_bar) goto bad;
  774. !             XtCallCallbacks(y_bar, XtNscrollProc,
  775. !             2 * (int) clip_h / 3);
  776. !             continue;
  777. !         case 'c':
  778. !             center(event.xkey.x, event.xkey.y);
  779. !             continue;
  780. ! #else    TOOLKIT
  781. !         case 'l':
  782. !             if (mane.base_x <= 0) goto bad;
  783. !             scrollmane(mane.base_x - 2 * clip_w / 3, mane.base_y);
  784. !             continue;
  785. !         case 'r':
  786. !             if (mane.base_x >= page_w - clip_w) goto bad;
  787. !             scrollmane(mane.base_x + 2 * clip_w / 3, mane.base_y);
  788. !             continue;
  789. !         case 'u':
  790. !             if (mane.base_y <= 0) goto bad;
  791. !             scrollmane(mane.base_x, mane.base_y - 2 * clip_h / 3);
  792. !             continue;
  793. !         case 'd':
  794. !             if (mane.base_y >= page_h - clip_h) goto bad;
  795. !             scrollmane(mane.base_x, mane.base_y + 2 * clip_h / 3);
  796. !             continue;
  797. !         case 'c':    /* unchecked scrollmane() */
  798. !             scrollwindow(&mane, mane.base_x + XKEY(event).x - clip_w/2,
  799. !             mane.base_y + XKEY(event).y - clip_h/2);
  800. !             paint_x_bar();
  801. !             paint_y_bar();
  802. ! #ifndef X10
  803. !             XWarpPointer(DISP, None, None, 0, 0, 0, 0,
  804. !             clip_w/2 - XKEY(event).x, clip_h/2 - XKEY(event).y);
  805. ! #else X10
  806. !             XWarpMouse(mane.win, clip_w/2, clip_h/2, GXcopy);
  807. ! #endif X10
  808. !             continue;
  809. ! #endif    TOOLKIT
  810. ! #ifndef X10
  811. !         case 'M':
  812. !             XTranslateCoordinates(DISP, event.xkey.window, mane.win,
  813. !                 event.xkey.x, event.xkey.y, &home_x, &home_y,
  814. !                 &number0);    /* throw away last argument */
  815. !             home_x *= mane.shrinkfactor;
  816. !             home_y *= mane.shrinkfactor;
  817. !             continue;
  818. !         case '\020':    /* Control P */
  819. !             Printf("Unit = %d, bitord = %d, byteord = %d\n",
  820. !             BitmapUnit(DISP), BitmapBitOrder(DISP),
  821. !             ImageByteOrder(DISP));
  822. !             continue;
  823. ! #else X10
  824. !         case 'M':
  825. !             home_x = (XKEY(event).x + mane.base_x) * mane.shrinkfactor;
  826. !             home_y = (XKEY(event).y + mane.base_y) * mane.shrinkfactor;
  827. !             continue;
  828. ! #endif X10
  829. !         case 's':
  830. !             if (!arg0) {
  831. !             long fac1, fac2;
  832. !             shrink_factor = 1;
  833. !             fac1 = ROUNDUP(PAPER_WIDTH, window_w);
  834. !             fac2 = ROUNDUP(PAPER_HEIGHT, window_h);
  835. !             if (fac1 < fac2)
  836. !                 number0 = fac2;
  837. !             else
  838. !                 number0 = fac1;
  839. !             }
  840. !             if (number0 <= 0) goto bad;
  841. !             if (number0 == mane.shrinkfactor) continue;
  842. !             shrink_factor = mane.shrinkfactor = number0;
  843. !             init_page();
  844. !             if (number0 != 1 && number0 != bak_shrink) {
  845. !             bak_shrink = number0;
  846. !             reset_fonts();
  847. !             }
  848. ! #ifdef    TOOLKIT
  849. !             XUnmapWindow(DISP, mane.win);
  850. !             set_draw_args();
  851. !             XtSetValues(draw_widget, draw_args, 2);
  852. !             get_geom();
  853. !             home(False);
  854. !             XMapWindow(DISP, (Window) mane.win);
  855. !             continue;
  856. ! #else    TOOLKIT
  857. !             reconfig();
  858. !             home(False);
  859. !             break;
  860. ! #endif    TOOLKIT
  861. !         case 'S':
  862. !             if (!arg0) goto bad;
  863. !             if (number0 < 0) goto bad;
  864. !             if (number0 == density) continue;
  865. !             density = number0;
  866. !             reset_fonts();
  867. !             if (mane.shrinkfactor == 1) continue;
  868. !             break;
  869. !         case 'R':
  870. !             /* reread DVI file */
  871. !             --dvi_time;    /* then it will notice a change */
  872. !             break;
  873. !         default:
  874. !             goto bad;
  875. !         }
  876. !         if (0 <= next_page && next_page < total_pages) {
  877. !         if (current_page != next_page) {
  878. !             current_page = next_page;
  879. !             spec_warn = True;
  880. !             if (!keep_flag) home(False);
  881. !         }
  882. !         canit = True;
  883. !         Flush();
  884. !         longjmp(canit_env, 1);
  885. !         }
  886. !         bad:  XBell(DISP, 10);
  887.       }
  888.   }
  889.   
  890. --- 1492,1503 ----
  891.           number = 0;
  892.           continue;
  893.           }
  894.           number0 = number;
  895.           number = 0;
  896.           sign = 1;
  897. !         arg0 = arg;
  898. !         arg = False;
  899. !         keystroke(ch, number0, arg0, &event);
  900.       }
  901.   }
  902.   
  903. ***************
  904. *** 1469,1475 ****
  905.       (void) signal(SIGIO, handle_intr);
  906.       (void) fcntl(socket, F_SETOWN, getpid());
  907.       (void) fcntl(socket, F_SETFL, fcntl(socket, F_GETFL, 0) | FASYNC);
  908. ! #endif
  909.   }
  910.   
  911.   static
  912. --- 1602,1608 ----
  913.       (void) signal(SIGIO, handle_intr);
  914.       (void) fcntl(socket, F_SETOWN, getpid());
  915.       (void) fcntl(socket, F_SETFL, fcntl(socket, F_GETFL, 0) | FASYNC);
  916. ! #endif    HAS_SIGIO
  917.   }
  918.   
  919.   static
  920. ***************
  921. *** 1487,1493 ****
  922.           redraw_page();
  923.           exit(0);
  924.       }
  925. !     else {
  926.           enable_intr();
  927.           (void) setjmp(canit_env);
  928.           for (;;) {
  929. --- 1620,1626 ----
  930.           redraw_page();
  931.           exit(0);
  932.       }
  933. !     else {    /* normal operation */
  934.           enable_intr();
  935.           (void) setjmp(canit_env);
  936.           for (;;) {
  937. ***************
  938. *** 1524,1532 ****
  939.       [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
  940.   [-cr <color>]\n\
  941.       [-margins <inches>] [-sidemargin <inches>] [-topmargin <inches>]\n\
  942. !     [-mgs[n] <size>] [-geometry <geometry>]  [#<geometry>]\n\
  943. !     [-altfont <font>] [-thorough] [-copy] [-display <host:display>] \
  944. ! dvi_file\n", stderr);
  945.   #else X10
  946.       fputs("\
  947.   Usage: xdvi [+[<page>]] [-s <shrink>] [-S <density>] [-p <pixels>] [-l] [-rv]\n\
  948. --- 1657,1665 ----
  949.       [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
  950.   [-cr <color>]\n\
  951.       [-margins <inches>] [-sidemargin <inches>] [-topmargin <inches>]\n\
  952. !     [-pagewidth <inches>] [-pageheight <inches>] [-mgs[n] <size>]\n\
  953. !     [-altfont <font>] [#<geometry>] [-geometry <geometry>]\n\
  954. !     [-display <host:display>] [-copy] [-thorough] dvi_file\n", stderr);
  955.   #else X10
  956.       fputs("\
  957.   Usage: xdvi [+[<page>]] [-s <shrink>] [-S <density>] [-p <pixels>] [-l] [-rv]\n\
  958. ***************
  959. *** 1533,1541 ****
  960.       [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
  961.   [-cr <color>]\n\
  962.       [-margins <inches>] [-sidemargin <inches>] [-topmargin <inches>]\n\
  963. !     [-mgs[n] <size>] [-geometry <geometry> | =<geometry>]\n\
  964. !     [-altfont <font>] [-display <host:display> | host:display] dvi_file\n",
  965. !     stderr);
  966.   #endif X10
  967.       exit(1);
  968.   }
  969. --- 1666,1674 ----
  970.       [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
  971.   [-cr <color>]\n\
  972.       [-margins <inches>] [-sidemargin <inches>] [-topmargin <inches>]\n\
  973. !     [-pagewidth <inches>] [-pageheight <inches>] [-mgs[n] <size>]\n\
  974. !     [-altfont <font>] [-geometry <geometry> | =<geometry>]\n\
  975. !     [-display <host:display> | <host:display>] dvi_file\n", stderr);
  976.   #endif X10
  977.       exit(1);
  978.   }
  979. ***************
  980. *** 1551,1556 ****
  981. --- 1684,1690 ----
  982.   #endif X10
  983.   
  984.   #ifdef    TOOLKIT
  985.   static    XrmOptionDescRec    options[] = {
  986.   {"-d",        ".debugLevel",    XrmoptionSepArg,    (caddr_t) NULL},
  987.   {"+",        ".gotoPage",    XrmoptionStickyArg,    (caddr_t) NULL},
  988. ***************
  989. *** 1560,1565 ****
  990. --- 1694,1701 ----
  991.   {"-margins",    ".margins",    XrmoptionSepArg,    (caddr_t) NULL},
  992.   {"-sidemargin",    ".sideMargin",    XrmoptionSepArg,    (caddr_t) NULL},
  993.   {"-topmargin",    ".topMargin",    XrmoptionSepArg,    (caddr_t) NULL},
  994. + {"-pagewidth",    ".pageWidth",    XrmoptionSepArg,    (caddr_t) NULL},
  995. + {"-pageheight",    ".pageHeight",    XrmoptionSepArg,    (caddr_t) NULL},
  996.   {"-altfont",    ".altFont",    XrmoptionSepArg,    (caddr_t) NULL},
  997.   {"-l",        ".listFonts",    XrmoptionNoArg,        (caddr_t) "on"},
  998.   {"+l",        ".listFonts",    XrmoptionNoArg,        (caddr_t) "off"},
  999. ***************
  1000. *** 1599,1604 ****
  1001. --- 1735,1744 ----
  1002.     (Cardinal) &sidemargin, XtRString, NULL},
  1003.   {"topMargin", "Margin", XtRString, sizeof(char *),
  1004.     (Cardinal) &topmargin, XtRString, NULL},
  1005. + {"pageWidth", "PageWidth", XtRString, sizeof(char *),
  1006. +   (Cardinal) &arg_page_w, XtRString, (caddr_t) DEFAULT_PAGE_WIDTH},
  1007. + {"pageHeight", "PageHeight", XtRString, sizeof(char *),
  1008. +   (Cardinal) &arg_page_h, XtRString, (caddr_t) DEFAULT_PAGE_HEIGHT},
  1009.   {"altFont", "AltFont", XtRString, sizeof(char *),
  1010.     (Cardinal) &alt_font, XtRString, (caddr_t) ALTFONT},
  1011.   {"listFonts", "ListFonts", XtRBoolean, sizeof(Boolean),
  1012. ***************
  1013. *** 1622,1628 ****
  1014.   {"cursorColor", "CursorColor", XtRString, sizeof(char *),
  1015.     (Cardinal)&curs_color, XtRString, NULL},
  1016.   {"iconGeometry", "IconGeometry", XtRString, sizeof(char *),
  1017. !   (Cardinal)&icon_geometry, XtRString, (caddr_t) NULL},
  1018.   {"copy", "Copy", XtRBoolean, sizeof(Boolean),
  1019.     (Cardinal)©, XtRBoolean, (caddr_t) ©},
  1020.   {"thorough", "Thorough", XtRBoolean, sizeof(Boolean),
  1021. --- 1762,1768 ----
  1022.   {"cursorColor", "CursorColor", XtRString, sizeof(char *),
  1023.     (Cardinal)&curs_color, XtRString, NULL},
  1024.   {"iconGeometry", "IconGeometry", XtRString, sizeof(char *),
  1025. !   (Cardinal)&icon_geometry, XtRString, NULL},
  1026.   {"copy", "Copy", XtRBoolean, sizeof(Boolean),
  1027.     (Cardinal)©, XtRBoolean, (caddr_t) ©},
  1028.   {"thorough", "Thorough", XtRBoolean, sizeof(Boolean),
  1029. ***************
  1030. *** 1656,1661 ****
  1031. --- 1796,1802 ----
  1032.       {XtNwidth,    (XtArgVal) 0},
  1033.       {XtNheight,    (XtArgVal) 0},
  1034.       {XtNiconPixmap,    (XtArgVal) 0},
  1035. +     {XtNinput,    (XtArgVal) True},
  1036.   };
  1037.   
  1038.   #else    TOOLKIT
  1039. ***************
  1040. *** 1714,1719 ****
  1041. --- 1855,1862 ----
  1042.   {"-sidemargin",    "sideMargin",    SepArg,    StringArg,    (caddr_t) &sidemargin},
  1043.   {"-topmargin",    "topMargin",    SepArg,    StringArg,    (caddr_t) &topmargin},
  1044.   {"-altfont",    "altFont",    SepArg,    StringArg,    (caddr_t) &alt_font},
  1045. + {"-pagewidth",    "pageWidth",    SepArg,    StringArg,    (caddr_t) &arg_page_w},
  1046. + {"-pageheight",    "pageHeight",    SepArg,    StringArg,    (caddr_t) &arg_page_h},
  1047.   {"-l",        "listFonts",    TrueArg, BooleanArg,    (caddr_t) &list_fonts},
  1048.   {"+l",        NULL,        FalseArg, BooleanArg,    (caddr_t) &list_fonts},
  1049.   {"-rv",        "reverseVideo",    TrueArg, BooleanArg,    (caddr_t) &reverse},
  1050. ***************
  1051. *** 1851,1856 ****
  1052. --- 1994,2000 ----
  1053.                   (strcmp(optstring, "on") == 0);
  1054.           }
  1055.   }
  1056.   #endif    TOOLKIT
  1057.   
  1058.   /*
  1059. ***************
  1060. *** 1861,1866 ****
  1061. --- 2005,2011 ----
  1062.       int argc;
  1063.       char **argv;
  1064.   {
  1065.   #ifndef    TOOLKIT
  1066.   #ifndef X10
  1067.       XSizeHints    size_hints;
  1068. ***************
  1069. *** 1910,1924 ****
  1070.       if (margins) home_x = home_y = atof(margins) * pixels_per_inch;
  1071.       if (sidemargin) home_x = atof(sidemargin) * pixels_per_inch;
  1072.       if (topmargin) home_y = atof(topmargin) * pixels_per_inch;
  1073.   
  1074. !     if ((font_path = getenv(FONT_PATH)) == NULL)
  1075. !         font_path = default_font_path;
  1076. !     else if (*font_path == ':')
  1077. !         /*concatenate default_font_path before font_path */
  1078. !         font_path = strcat(strcpy(malloc((unsigned)
  1079. !         strlen(default_font_path) + strlen(font_path) + 1),
  1080. !         default_font_path), font_path);
  1081.       open_dvi_file();
  1082.       if (curr_page) {
  1083.           current_page = (*curr_page ? atoi(curr_page) : total_pages) - 1;
  1084. --- 2055,2064 ----
  1085.       if (margins) home_x = home_y = atof(margins) * pixels_per_inch;
  1086.       if (sidemargin) home_x = atof(sidemargin) * pixels_per_inch;
  1087.       if (topmargin) home_y = atof(topmargin) * pixels_per_inch;
  1088. +     unshrunk_page_w = atof(arg_page_w) * pixels_per_inch + 0.5;
  1089. +     unshrunk_page_h = atof(arg_page_h) * pixels_per_inch + 0.5;
  1090.   
  1091. !     init_pxl_open();
  1092.       open_dvi_file();
  1093.       if (curr_page) {
  1094.           current_page = (*curr_page ? atoi(curr_page) : total_pages) - 1;
  1095. ***************
  1096. *** 1999,2019 ****
  1097.   
  1098.           XGeometry(DISP, scr, icon_geometry, "", 0, 0, 0, 0, 0,
  1099.                 &temp_args1[0].value, &temp_args1[1].value, &junk, &junk);
  1100. !         XtSetValues(top_level, temp_args1, 2);
  1101.       }
  1102.           /* Set default window size and icon */
  1103.       XtGetValues(top_level, &temp_args2, 1);    /* get border width */
  1104.       screen_w = WidthOfScreen(SCRN) - 2*bwidth;
  1105.       screen_h = HeightOfScreen(SCRN) - 2*bwidth;
  1106.       temp_args3[0].value = (XtArgVal) (page_w<screen_w ? page_w : screen_w);
  1107.       temp_args3[1].value = (XtArgVal) (page_h<screen_h ? page_h : screen_h);
  1108.       temp_args3[2].value = (XtArgVal) (XCreateBitmapFromData(DISP,
  1109.                   RootWindowOfScreen(SCRN),
  1110.                   xdvi_bits, xdvi_width, xdvi_height));
  1111. !     XtSetValues(top_level, temp_args3, 3);
  1112.   
  1113.       vport_widget = XtCreateManagedWidget("vport", viewportWidgetClass,
  1114.           top_level, vport_args, XtNumber(vport_args));
  1115.       clip_widget = XtNameToWidget(vport_widget, "clip");
  1116.       set_draw_args();
  1117.       draw_widget = XtCreateManagedWidget("drawing", widgetClass,
  1118. --- 2139,2195 ----
  1119.   
  1120.           XGeometry(DISP, scr, icon_geometry, "", 0, 0, 0, 0, 0,
  1121.                 &temp_args1[0].value, &temp_args1[1].value, &junk, &junk);
  1122. !         XtSetValues(top_level, temp_args1, XtNumber(temp_args1));
  1123.       }
  1124.           /* Set default window size and icon */
  1125.       XtGetValues(top_level, &temp_args2, 1);    /* get border width */
  1126.       screen_w = WidthOfScreen(SCRN) - 2*bwidth;
  1127.       screen_h = HeightOfScreen(SCRN) - 2*bwidth;
  1128. + #ifdef    BUTTONS
  1129. +     temp_args3[0].value = (XtArgVal) (page_w + 100 < screen_w ?
  1130. +                       page_w + 100 : screen_w);
  1131. + #else    BUTTONS
  1132.       temp_args3[0].value = (XtArgVal) (page_w<screen_w ? page_w : screen_w);
  1133. + #endif    BUTTONS
  1134.       temp_args3[1].value = (XtArgVal) (page_h<screen_h ? page_h : screen_h);
  1135.       temp_args3[2].value = (XtArgVal) (XCreateBitmapFromData(DISP,
  1136.                   RootWindowOfScreen(SCRN),
  1137.                   xdvi_bits, xdvi_width, xdvi_height));
  1138. !     XtSetValues(top_level, temp_args3, XtNumber(temp_args3));
  1139.   
  1140. + #ifdef    BUTTONS
  1141. +     form_widget = XtCreateManagedWidget("form", formWidgetClass,
  1142. +         top_level, form_args, XtNumber(form_args));
  1143. +     vport_args[0].value = temp_args3[0].value - 79;
  1144. +     vport_args[1].value = temp_args3[1].value;
  1145.       vport_widget = XtCreateManagedWidget("vport", viewportWidgetClass,
  1146. +         form_widget, vport_args, XtNumber(vport_args));
  1147. +     line_args[0].value = (XtArgVal) high_color ? hl_Pixel : fore_Pixel;
  1148. +     line_args[2].value = temp_args3[1].value;
  1149. +     line_args[3].value = (XtArgVal) vport_widget;
  1150. +     strut_args[0].value = (XtArgVal) XtCreateManagedWidget("line",
  1151. +         widgetClass, form_widget, line_args, XtNumber(line_args));
  1152. +     (void) XtCreateManagedWidget("strut", widgetClass, form_widget,
  1153. +         strut_args, XtNumber(strut_args));
  1154. +     command_args[2].value = (XtArgVal) vport_widget;
  1155. +     {
  1156. +         int i;
  1157. +         for (i = 0; i < XtNumber(command_table); ++i) {
  1158. +         command_args[0].value = (XtArgVal) command_table[i].label;
  1159. +         command_args[1].value = (XtArgVal) command_table[i].y_pos;
  1160. +         command_call[0].closure = (caddr_t) command_table[i].closure;
  1161. +         command_wid[i] = XtCreateManagedWidget(command_table[i].name,
  1162. +             commandWidgetClass, form_widget,
  1163. +             command_args, XtNumber(command_args));
  1164. +         }
  1165. +     }
  1166. + #else    BUTTONS
  1167. +     vport_widget = XtCreateManagedWidget("vport", viewportWidgetClass,
  1168.           top_level, vport_args, XtNumber(vport_args));
  1169. + #endif    BUTTONS
  1170.       clip_widget = XtNameToWidget(vport_widget, "clip");
  1171.       set_draw_args();
  1172.       draw_widget = XtCreateManagedWidget("drawing", widgetClass,
  1173. ***************
  1174. *** 2036,2043 ****
  1175.       XtAddEventHandler(draw_widget, ButtonReleaseMask, False, handle_release,
  1176.           (caddr_t) NULL);
  1177.       XtRealizeWidget(top_level);
  1178. -     curr.win = mane.win = (void *) XtWindow(draw_widget);
  1179.   
  1180.   #else    TOOLKIT
  1181.   
  1182.       /*
  1183. --- 2212,2220 ----
  1184.       XtAddEventHandler(draw_widget, ButtonReleaseMask, False, handle_release,
  1185.           (caddr_t) NULL);
  1186.       XtRealizeWidget(top_level);
  1187.   
  1188. +     curr.win = mane.win = (caddr_t) XtWindow(draw_widget);
  1189.   #else    TOOLKIT
  1190.   
  1191.       /*
  1192. ***************
  1193. *** 2100,2106 ****
  1194.       image->bitmap_bit_order = MSBFirst;
  1195.   #endif    MSBITFIRST
  1196.       {
  1197. !         short endian = (MSBFirst << 8) + LSBFirst;
  1198.           image->byte_order = *((char *) &endian);
  1199.       }
  1200.   
  1201. --- 2277,2283 ----
  1202.       image->bitmap_bit_order = MSBFirst;
  1203.   #endif    MSBITFIRST
  1204.       {
  1205. !         short endian = MSBFirst << 8 | LSBFirst;
  1206.           image->byte_order = *((char *) &endian);
  1207.       }
  1208.   
  1209. diff -cr old/xdvi.h new/xdvi.h
  1210. *** old/xdvi.h    Fri Nov 17 21:23:17 1989
  1211. --- new/xdvi.h    Sat Nov  4 16:25:24 1989
  1212. ***************
  1213. *** 96,103 ****
  1214.   #define ZZ      stack[stackp].z
  1215.   #define ROUNDUP(x,y) (((x)+(y)-1)/(y))
  1216.   
  1217. ! #define    PAPER_WIDTH    ROUNDUP(17*pixels_per_inch, shrink_factor*2)
  1218. ! #define    PAPER_HEIGHT    ROUNDUP(11*pixels_per_inch, shrink_factor)
  1219.   
  1220.   extern    int    current_page;
  1221.   extern    int    total_pages;
  1222. --- 96,103 ----
  1223.   #define ZZ      stack[stackp].z
  1224.   #define ROUNDUP(x,y) (((x)+(y)-1)/(y))
  1225.   
  1226. ! #define    PAPER_WIDTH    ROUNDUP(unshrunk_page_w, shrink_factor)
  1227. ! #define    PAPER_HEIGHT    ROUNDUP(unshrunk_page_h, shrink_factor)
  1228.   
  1229.   extern    int    current_page;
  1230.   extern    int    total_pages;
  1231. ***************
  1232. *** 171,176 ****
  1233. --- 171,177 ----
  1234.       struct font *next;        /* link to next font info block */
  1235.       int TeXnumber;            /* font number (in DVI file) */
  1236.       int scale;            /* scaled size in SPELL units */
  1237. +     float factor;            /* multiply char. widths by this */
  1238.       char *fontname;            /* PXL file name */
  1239.       short size;            /* dots per 5 inches */
  1240.       FILE *file;            /* open PXL file or NULL */
  1241. ***************
  1242. *** 199,204 ****
  1243. --- 200,206 ----
  1244.   extern    Boolean    list_fonts;
  1245.   
  1246.   extern    int    pixels_per_inch;
  1247. + extern    int    unshrunk_page_w, unshrunk_page_h;
  1248.   extern    int    density;
  1249.   
  1250.   extern    char    *dvi_name;
  1251. ***************
  1252. *** 206,212 ****
  1253.   extern    char    *prog;
  1254.   
  1255.   extern    struct    WindowRec {
  1256. !     void    *win;        /* type Window is not defined yet */
  1257.       int    shrinkfactor;
  1258.       int    base_x, base_y;
  1259.       int    width, height;
  1260. --- 208,214 ----
  1261.   extern    char    *prog;
  1262.   
  1263.   extern    struct    WindowRec {
  1264. !     caddr_t    win;        /* type Window is not defined yet */
  1265.       int    shrinkfactor;
  1266.       int    base_x, base_y;
  1267.       int    width, height;
  1268. diff -cr old/xdvi.man.sed new/xdvi.man.sed
  1269. *** old/xdvi.man.sed    Fri Nov 17 21:23:20 1989
  1270. --- new/xdvi.man.sed    Sat Nov  4 16:25:32 1989
  1271. ***************
  1272. *** 1,4 ****
  1273. --- 1,8 ----
  1274. + #ifx11
  1275.   .TH XDVI SIPB "8 May 1989" "X Version 11"
  1276. + #ifx10
  1277. + .TH XDVI SIPB "8 May 1989" "X Version 10"
  1278. + #endif
  1279.   .SH NAME
  1280.   xdvi \- DVI Previewer for the X Window System
  1281.   .SH SYNOPSIS
  1282. ***************
  1283. *** 5,15 ****
  1284.   .B xdvi
  1285.   .nh
  1286.   [+[\fIpage\fP]] [\-s \fIshrink\fP] [\-S \fIdensity\fP] [\-p \fIpixels\fP]
  1287. ! [\-altfont \fIfont\fP] [\-l] [\-rv] [\-fg \fIcolor\fP] [\-bg \fIcolor\fP]
  1288. ! [\-hl \fIcolor\fP] [\-bd \fIcolor\fP] [\-cr \fIcolor\fP] [-thorough] [-copy]
  1289.   [\-margins \fIinches\fP] [\-sidemargin \fIinches\fP] [\-topmargin \fIinches\fP]
  1290. ! [\-mgs[\fIn\fP] \fIsize\fP] [\-geometry \fIgeometry\fP | =\fIgeometry\fP]
  1291. ! [%\fIgeometry\fP] [\-display \fIdisplay\fP] file
  1292.   .hy
  1293.   .SH DESCRIPTION
  1294.   .I Xdvi
  1295. --- 9,27 ----
  1296.   .B xdvi
  1297.   .nh
  1298.   [+[\fIpage\fP]] [\-s \fIshrink\fP] [\-S \fIdensity\fP] [\-p \fIpixels\fP]
  1299. ! [\-l] [\-rv] [\-fg \fIcolor\fP] [\-bg \fIcolor\fP]
  1300. ! [\-hl \fIcolor\fP] [\-bd \fIcolor\fP] [\-cr \fIcolor\fP]
  1301.   [\-margins \fIinches\fP] [\-sidemargin \fIinches\fP] [\-topmargin \fIinches\fP]
  1302. ! [\-pagewidth \fIinches\fP] [\-pageheight \fIinches\fP]
  1303. ! [\-mgs[\fIn\fP] \fIsize\fP] [\-altfont \fIfont\fP]
  1304. ! #ifx11
  1305. ! [#\fIgeometry\fP] [\-geometry \fIgeometry\fP] [\-display \fIdisplay\fP]
  1306. ! [-copy] [-thorough]
  1307. ! #ifx10
  1308. ! [\-geometry \fIgeometry\fP | =\fIgeometry\fP]
  1309. ! [\-display \fIhost\fP:\fIdisplay\fP | \fIhost\fP:\fIdisplay\fP]
  1310. ! #endif
  1311. ! dvi_file
  1312.   .hy
  1313.   .SH DESCRIPTION
  1314.   .I Xdvi
  1315. ***************
  1316. *** 16,32 ****
  1317.   is a program which runs under the X window system. It is used to preview
  1318.   DVI files, such as are produced by TeX.
  1319.   .PP
  1320. ! This program has the capability of
  1321. ! showing the file shrunken by various (integer) factors, and also has a
  1322. ! ``magnifying glass'' which allows one to see a small part of the unshrunk
  1323. ! image momentarily.
  1324.   .PP
  1325. ! Also, before displaying any page or part thereof, it checks to see if the dvi
  1326.   file has changed since the last time it was displayed.  If this is the case,
  1327.   then \fIxdvi\fR will reinitialize itself for the new dvi file.  For this reason,
  1328.   exposing parts of the \fIxdvi\fR window while \fITeX\fR is running should be
  1329.   avoided.  This feature allows you to preview many versions
  1330.   of the same file while running \fIxdvi\fR only once.
  1331.   .SH OPTIONS
  1332.   In addition to specifying the .\fPdvi\fR file (with or without the .\fPdvi\fR),
  1333.   \fIXdvi\fR supports the following command line options.
  1334. --- 28,49 ----
  1335.   is a program which runs under the X window system. It is used to preview
  1336.   DVI files, such as are produced by TeX.
  1337.   .PP
  1338. ! This program has the capability of showing the file shrunken by various
  1339. ! (integer) factors, and also has a ``magnifying glass'' which allows one
  1340. ! to see a small part of the unshrunk image momentarily.
  1341.   .PP
  1342. ! Before displaying any page or part thereof, it checks to see if the dvi
  1343.   file has changed since the last time it was displayed.  If this is the case,
  1344.   then \fIxdvi\fR will reinitialize itself for the new dvi file.  For this reason,
  1345.   exposing parts of the \fIxdvi\fR window while \fITeX\fR is running should be
  1346.   avoided.  This feature allows you to preview many versions
  1347.   of the same file while running \fIxdvi\fR only once.
  1348. + #ifbuttons
  1349. + .PP
  1350. + In addition to using keystrokes to move within the file, \fIxdvi\fR provides
  1351. + buttons on the right side of the window, which are synonymous with various
  1352. + sequences of keystrokes.
  1353. + #endif
  1354.   .SH OPTIONS
  1355.   In addition to specifying the .\fPdvi\fR file (with or without the .\fPdvi\fR),
  1356.   \fIXdvi\fR supports the following command line options.
  1357. ***************
  1358. *** 34,42 ****
  1359. --- 51,65 ----
  1360.   .RB ` + '
  1361.   instead of a
  1362.   .RB ` \- ',
  1363. + #ifx11
  1364.   the option is restored to its default value.  By default, these options can
  1365.   be set via the resource names given in parentheses in the description of
  1366.   each option.
  1367. + #ifx10
  1368. + the option is restored to its default value.  These options override those
  1369. + set in the ``.Xdefaults'' file (via the resource names given in parentheses
  1370. + in the description of each option).
  1371. + #endif
  1372.   .TP
  1373.   .IB + page
  1374.   Specifies the first page to show.  If \fI+\fR is given without a
  1375. ***************
  1376. *** 43,77 ****
  1377.   number, the last page is assumed; the first page is the default.
  1378.   .TP
  1379.   .BI \-s " shrink"
  1380. ! (.shrinkFactor)
  1381.   Defines the initial shrink factor.  The default value is 3.
  1382.   .TP
  1383.   .BI \-S " density"
  1384. ! (.densityPercent)
  1385.   Determines the density used when shrinking bitmaps for fonts.
  1386.   A higher value produces a lighter font.  The default value is 40.
  1387.   .TP
  1388.   .BI \-p " pixels"
  1389. ! (.pixelsPerInch)
  1390.   Defines the size of the fonts to use, in pixels per inch.  The
  1391.   default value is 300.
  1392.   .TP
  1393.   .BI \-altfont " font"
  1394. ! (.altFont)
  1395.   Declares a default font to use when the font in the dvi file cannot be found.
  1396.   This is useful, for example, with PostScript <tm> fonts.
  1397.   .TP
  1398.   .B \-l
  1399. ! (.listFonts)
  1400.   Causes the names of the fonts used to be listed.
  1401.   .TP
  1402.   .B \-rv
  1403. ! (.reverseVideo)
  1404.   Causes the page to be displayed with white characters on a
  1405.   black background, instead of vice versa.
  1406.   .TP
  1407.   .BI \-bw " width"
  1408. ! (.borderWidth)
  1409.   Specifies the width of the border of the window.
  1410.   .TP
  1411.   .BI \-borderwidth " width"
  1412. --- 66,100 ----
  1413.   number, the last page is assumed; the first page is the default.
  1414.   .TP
  1415.   .BI \-s " shrink"
  1416. ! (%%dot%%shrinkFactor)
  1417.   Defines the initial shrink factor.  The default value is 3.
  1418.   .TP
  1419.   .BI \-S " density"
  1420. ! (%%dot%%densityPercent)
  1421.   Determines the density used when shrinking bitmaps for fonts.
  1422.   A higher value produces a lighter font.  The default value is 40.
  1423.   .TP
  1424.   .BI \-p " pixels"
  1425. ! (%%dot%%pixelsPerInch)
  1426.   Defines the size of the fonts to use, in pixels per inch.  The
  1427.   default value is 300.
  1428.   .TP
  1429.   .BI \-altfont " font"
  1430. ! (%%dot%%altFont)
  1431.   Declares a default font to use when the font in the dvi file cannot be found.
  1432.   This is useful, for example, with PostScript <tm> fonts.
  1433.   .TP
  1434.   .B \-l
  1435. ! (%%dot%%listFonts)
  1436.   Causes the names of the fonts used to be listed.
  1437.   .TP
  1438.   .B \-rv
  1439. ! (%%dot%%reverseVideo)
  1440.   Causes the page to be displayed with white characters on a
  1441.   black background, instead of vice versa.
  1442.   .TP
  1443.   .BI \-bw " width"
  1444. ! (%%dot%%borderWidth)
  1445.   Specifies the width of the border of the window.
  1446.   .TP
  1447.   .BI \-borderwidth " width"
  1448. ***************
  1449. *** 78,84 ****
  1450.   Same as \fB-bw\fR, above.
  1451.   .TP
  1452.   .BI \-fg " color"
  1453. ! (.foreground)
  1454.   Determines the color of the text (foreground).
  1455.   .TP
  1456.   .BI \-foreground " color"
  1457. --- 101,107 ----
  1458.   Same as \fB-bw\fR, above.
  1459.   .TP
  1460.   .BI \-fg " color"
  1461. ! (%%dot%%foreground)
  1462.   Determines the color of the text (foreground).
  1463.   .TP
  1464.   .BI \-foreground " color"
  1465. ***************
  1466. *** 85,91 ****
  1467.   Same as \fB-fg\fR, above.
  1468.   .TP
  1469.   .BI \-bg " color"
  1470. ! (.background)
  1471.   Determines the color of the background.
  1472.   .TP
  1473.   .BI \-background " color"
  1474. --- 108,114 ----
  1475.   Same as \fB-fg\fR, above.
  1476.   .TP
  1477.   .BI \-bg " color"
  1478. ! (%%dot%%background)
  1479.   Determines the color of the background.
  1480.   .TP
  1481.   .BI \-background " color"
  1482. ***************
  1483. *** 92,108 ****
  1484.   Same as \fB-bg\fR, above.
  1485.   .TP
  1486.   .BI \-hl " color"
  1487. ! (.highlight)
  1488.   Determines the color of the page border.
  1489.   .TP
  1490.   .BI \-bd " color"
  1491. ! (.borderColor)
  1492.   Determines the color of the window border.
  1493.   .TP
  1494.   .BI \-cr " color"
  1495. ! (.cursorColor)
  1496.   Determines the color of the cursor.  The default is the
  1497.   foreground color.
  1498.   .TP
  1499.   .B \-thorough
  1500.   (.thorough)
  1501. --- 115,132 ----
  1502.   Same as \fB-bg\fR, above.
  1503.   .TP
  1504.   .BI \-hl " color"
  1505. ! (%%dot%%highlight)
  1506.   Determines the color of the page border.
  1507.   .TP
  1508.   .BI \-bd " color"
  1509. ! (%%dot%%borderColor)
  1510.   Determines the color of the window border.
  1511.   .TP
  1512.   .BI \-cr " color"
  1513. ! (%%dot%%cursorColor)
  1514.   Determines the color of the cursor.  The default is the
  1515.   foreground color.
  1516. + #ifx11
  1517.   .TP
  1518.   .B \-thorough
  1519.   (.thorough)
  1520. ***************
  1521. *** 120,128 ****
  1522.   Always use the \fIcopy\fR operation when writing characters to the display.
  1523.   This option may be necessary for correct operation on a color display, but
  1524.   overstrike characters will be incorrect.
  1525.   .TP
  1526.   .BI \-margins " inches"
  1527. ! (.margins)
  1528.   Specifies the size of both the top margin and side margin.  This
  1529.   can be a decimal number, \fIe.g.\fR, 1.5.  It determines
  1530.   the ``home'' position of the page within the window as follows.  If the entire
  1531. --- 144,153 ----
  1532.   Always use the \fIcopy\fR operation when writing characters to the display.
  1533.   This option may be necessary for correct operation on a color display, but
  1534.   overstrike characters will be incorrect.
  1535. + #endif
  1536.   .TP
  1537.   .BI \-margins " inches"
  1538. ! (%%dot%%margins)
  1539.   Specifies the size of both the top margin and side margin.  This
  1540.   can be a decimal number, \fIe.g.\fR, 1.5.  It determines
  1541.   the ``home'' position of the page within the window as follows.  If the entire
  1542. ***************
  1543. *** 135,147 ****
  1544.   the KEY\%STROKES section.
  1545.   .TP
  1546.   .BI \-sidemargin " inches"
  1547. ! (.sideMargin)
  1548.   Specifies the side margin (see above).
  1549.   .TP
  1550.   .BI \-topmargin " inches"
  1551. ! (.topMargin)
  1552.   Specifies the top and bottom margins (see above).
  1553.   .TP
  1554.   .BI "\-mgs[n]" " size"
  1555.   (.magnifierSize[n])
  1556.   Specifies the size of the window to be used for the ``magnifying glass''
  1557. --- 160,182 ----
  1558.   the KEY\%STROKES section.
  1559.   .TP
  1560.   .BI \-sidemargin " inches"
  1561. ! (%%dot%%sideMargin)
  1562.   Specifies the side margin (see above).
  1563.   .TP
  1564.   .BI \-topmargin " inches"
  1565. ! (%%dot%%topMargin)
  1566.   Specifies the top and bottom margins (see above).
  1567.   .TP
  1568. + .BI \-pagewidth " inches"
  1569. + (%%dot%%pageWidth)
  1570. + Specifies the width of the printed page.
  1571. + .TP
  1572. + .BI \-pageheight " inches"
  1573. + (%%dot%%pageHeight)
  1574. + Specifies the height of the printed page.  By default, the page size
  1575. + is %%defaultpagesize%%.
  1576. + .TP
  1577. + #ifx11
  1578.   .BI "\-mgs[n]" " size"
  1579.   (.magnifierSize[n])
  1580.   Specifies the size of the window to be used for the ``magnifying glass''
  1581. ***************
  1582. *** 150,167 ****
  1583.   .TP
  1584.   .BI \-mgs " size"
  1585.   Same as \fB-mgs1\fR, above.
  1586.   .TP
  1587. ! .BI = geometry
  1588.   (*geometry)
  1589.   Specifies the initial geometry of the window.
  1590.   .TP
  1591. - .BI \-geometry " geometry"
  1592. - Same as above.
  1593. - .TP
  1594.   .BI # geometry
  1595. ! (.iconGeometry)
  1596.   Specifies the initial position for the icon.
  1597.   .TP
  1598.   .BI \-display " host:display"
  1599.   Specifies the host and screen to be used for displaying the dvi file.
  1600.   This is normally obtained from the environment variable ``DISPLAY.''
  1601. --- 185,227 ----
  1602.   .TP
  1603.   .BI \-mgs " size"
  1604.   Same as \fB-mgs1\fR, above.
  1605. + #ifx10
  1606. + .BI \-mgs " size"
  1607. + (magnifierSize1)
  1608. + Specifies the size of the window to be used for the ``magnifying glass''
  1609. + for the left button.  See the MOUSE ACTIONS section.  Default is 200.
  1610.   .TP
  1611. ! .BI \-mgs1 " size"
  1612. ! Same as \fB-mgs\fR, above.
  1613. ! .TP
  1614. ! .BI \-mgs2 " size"
  1615. ! (magnifierSize2)
  1616. ! Specifies the ``magnifying glass'' size for the middle
  1617. ! button.  Default is 350.
  1618. ! .TP
  1619. ! .BI \-mgs3 " size"
  1620. ! (magnifierSize3)
  1621. ! Specifies the ``magnifying glass'' size for the right
  1622. ! button.  Default is 600.
  1623. ! #endif
  1624. ! .TP
  1625. ! #ifx11
  1626. ! .BI \-geometry " geometry"
  1627.   (*geometry)
  1628.   Specifies the initial geometry of the window.
  1629.   .TP
  1630.   .BI # geometry
  1631. ! (%%dot%%iconGeometry)
  1632.   Specifies the initial position for the icon.
  1633. + #ifx10
  1634. + .BI = geometry
  1635. + (geometry)
  1636. + Specifies the initial geometry of the window.
  1637.   .TP
  1638. + .BI \-geometry " geometry"
  1639. + Same as above.
  1640. + #endif
  1641. + .TP
  1642.   .BI \-display " host:display"
  1643.   Specifies the host and screen to be used for displaying the dvi file.
  1644.   This is normally obtained from the environment variable ``DISPLAY.''
  1645. ***************
  1646. *** 254,260 ****
  1647.   Uses the environment variable ``DISPLAY'' to specify which bit map display
  1648.   terminal to use.
  1649.   .PP
  1650. ! The environment variable ``%%FONT_PATH%%'' determines the path(s) searched for
  1651.   fonts in the following manner.  The string consists of one or more strings
  1652.   separated by colons.  In each such string, the substring ``%f'' is
  1653.   changed to the font name; ``%d'' is changed to the magnification; and
  1654. --- 314,320 ----
  1655.   Uses the environment variable ``DISPLAY'' to specify which bit map display
  1656.   terminal to use.
  1657.   .PP
  1658. ! The environment variable ``XDVIFONTS'' determines the path(s) searched for
  1659.   fonts in the following manner.  The string consists of one or more strings
  1660.   separated by colons.  In each such string, the substring ``%f'' is
  1661.   changed to the font name; ``%d'' is changed to the magnification; and
  1662. ***************
  1663. *** 263,270 ****
  1664.   the end.  For example, if the string is ``/usr/local/tex/fonts'' and the font is
  1665.   cmr10 at 300dpi, then it searches for /usr/local/tex/fonts/cmr10.300gf,
  1666.   /usr/local/tex/fonts/cmr10.300pk, and /usr/local/tex/fonts/cmr10.1500pxl,
  1667. ! in that order.  If the first character of the ``%%FONT_PATH%%'' variable
  1668. ! is a colon, then the system default paths are tried first.
  1669.   .SH FILES
  1670.   .br
  1671.   %%DEFAULT_FONT_PATH%%   Font pixel files.
  1672. --- 323,342 ----
  1673.   the end.  For example, if the string is ``/usr/local/tex/fonts'' and the font is
  1674.   cmr10 at 300dpi, then it searches for /usr/local/tex/fonts/cmr10.300gf,
  1675.   /usr/local/tex/fonts/cmr10.300pk, and /usr/local/tex/fonts/cmr10.1500pxl,
  1676. ! in that order.  If the first character of the ``XDVIFONTS'' variable
  1677. ! is a colon, then the system default paths are tried first.  If the font is not
  1678. ! found in the desired size, then \fIxdvi\fR will try to find the nearest size.
  1679. ! If the font cannot be found at all, then \fIxdvi\fR will try to vary the point
  1680. ! size of the font (within a certain range), and if this fails, then it will
  1681. ! use the font specified as the alternate font (cf. \fB-altfont\fR).
  1682. ! .PP
  1683. ! The ``XDVISIZES'' variable must be set to indicate which sizes of fonts are
  1684. ! available.  It should consists of a list of numbers separated by colons.  If
  1685. ! the list begins with a colon, the system default sizes are used, as well.
  1686. ! Sizes are expressed in dots per inch; decimals may be used for ``pxl'' files:
  1687. ! for example, a 300 dots per inch file magnified by half a step comes out to
  1688. ! 1643 dots per five inches, which should be encoded as 328.6.  The current
  1689. ! default set of sizes is %%DEFAULT_FONT_SIZES%%.
  1690.   .SH FILES
  1691.   .br
  1692.   %%DEFAULT_FONT_PATH%%   Font pixel files.
  1693.