wdvi

network DVI viewer
Log | Files | Refs

commit 94ce672689153a71e84b4a72d7e530e6e7ff7fb6
parent b4ea3db242146da371f2d29212ca2072c5723c85
Author: Kyle Milz <milz@macbook.0x30.net>
Date:   Tue, 18 Aug 2020 12:44:58 -0700

unifdef -UMOTIF

Remove Motif support.

Diffstat:
Mdvi-init.c | 3---
Mevents.c | 332+------------------------------------------------------------------------------
Mpopups.c | 15---------------
Mxdvi.c | 142+------------------------------------------------------------------------------
Mxdvi.h | 20--------------------
5 files changed, 2 insertions(+), 510 deletions(-)

diff --git a/dvi-init.c b/dvi-init.c @@ -1004,9 +1004,6 @@ reload_dvi_file() XClearWindow(DISP, mane.win); dvi_popup = warning_popup_long( "Xdvi cannot read the DVI file\n%s\nReason: %s", -# if MOTIF - XmDIALOG_ERROR, -# endif "Reload", dvi_callback, dvi_name, dvi_oops_msg); if (dvi_file != NULL) { Fclose(dvi_file); diff --git a/events.c b/events.c @@ -171,12 +171,7 @@ extern struct _resource resource; #define clip_h mane.height static Position main_x, main_y; static Position mag_x, mag_y, new_mag_x, new_mag_y; -#if !MOTIF static int mag_conv_x, mag_conv_y; -#else -#define mag_conv_x 0 -#define mag_conv_y 0 -#endif static Boolean dragcurs = False; static sigset_t all_signals; @@ -410,14 +405,9 @@ compile_action(str, app) #if BUTTONS static Widget line_widget; static int destroy_count = 0; -# if MOTIF -static Widget panel_widget; /* otherwise it's defined in xdvi.h */ -# endif #endif /* BUTTONS */ -#ifndef MOTIF static Widget x_bar, y_bar; /* horizontal and vertical scroll bars */ -#endif static Arg resize_args[] = { {XtNwidth, (XtArgVal) 0}, @@ -434,7 +424,6 @@ static Arg resize_args[] = { #if BUTTONS -#ifndef MOTIF static Arg resizable_on[] = { {XtNresizable, (XtArgVal) True}, }; @@ -442,28 +431,19 @@ static Arg resizable_on[] = { static Arg resizable_off[] = { {XtNresizable, (XtArgVal) False}, }; -#endif static Arg line_args[] = { {XtNbackground, (XtArgVal) 0}, {XtNwidth, (XtArgVal) 1}, -#if !MOTIF {XtNfromHoriz, (XtArgVal) NULL}, {XtNborderWidth, (XtArgVal) 0}, {XtNtop, (XtArgVal) XtChainTop}, {XtNbottom, (XtArgVal) XtChainBottom}, {XtNleft, (XtArgVal) XtChainRight}, {XtNright, (XtArgVal) XtChainRight}, -#else /* MOTIF */ - {XmNleftWidget, (XtArgVal) NULL}, - {XmNleftAttachment, (XtArgVal) XmATTACH_WIDGET}, - {XmNtopAttachment, (XtArgVal) XmATTACH_FORM}, - {XmNbottomAttachment, (XtArgVal) XmATTACH_FORM}, -#endif /* MOTIF */ }; static Arg panel_args[] = { -#if !MOTIF {XtNborderWidth, (XtArgVal) 0}, {XtNfromHoriz, (XtArgVal) NULL}, {XtNtranslations, (XtArgVal) NULL}, @@ -471,11 +451,6 @@ static Arg panel_args[] = { {XtNbottom, (XtArgVal) XtChainBottom}, {XtNleft, (XtArgVal) XtChainRight}, {XtNright, (XtArgVal) XtChainRight}, -#else /* MOTIF */ - {XmNleftAttachment, (XtArgVal) XmATTACH_FORM}, - {XmNtopAttachment, (XtArgVal) XmATTACH_FORM}, - {XmNbottomAttachment, (XtArgVal) XmATTACH_FORM}, -#endif /* MOTIF */ }; static void handle_command(); @@ -486,19 +461,11 @@ static XtCallbackRec command_call[] = { }; static Arg command_args[] = { -#ifndef MOTIF {XtNlabel, (XtArgVal) NULL}, -#else - {XmNlabelString, (XtArgVal) NULL}, -#endif {XtNx, (XtArgVal) 0}, {XtNy, (XtArgVal) 0}, {XtNborderWidth,(XtArgVal) 0}, -#ifndef MOTIF {XtNcallback, (XtArgVal) command_call}, -#else - {XmNactivateCallback, (XtArgVal) command_call}, -#endif }; struct button_info { @@ -680,11 +647,7 @@ refers to non-existent shrink action.\n", button_number + 1); if (q > label + len) oops("Internal error computing button labels"); -#if !MOTIF command_args[0].value = (XtArgVal) label; -#else /* MOTIF */ - command_args[0].value = (XtArgVal) XmCvtCTToXmString(label); -#endif /* MOTIF */ command_args[2].value = (XtArgVal) y_pos; command_call[0].closure = (XtPointer) action; if (++button_number > 99) break; /* if too many buttons */ @@ -717,9 +680,7 @@ refers to non-existent shrink action.\n", button_number + 1); width_arg.value = (XtArgVal) xtra_wid; XtSetValues(panel_widget, &width_arg, 1); -#if !MOTIF ++xtra_wid; -#endif width_arg.value = (XtArgVal) max_button_width; for (bp = b_head; bp != NULL; bp = bp->next) { @@ -727,13 +688,6 @@ refers to non-existent shrink action.\n", button_number + 1); XtManageChild(bp->widget); } -#if MOTIF - line_args[2].value = (XtArgVal) panel_widget; - line_widget = XtCreateManagedWidget("line", widgetClass, form_widget, - line_args, XtNumber(line_args)); - XtVaSetValues(vport_widget, XmNleftAttachment, XmATTACH_WIDGET, - XmNleftWidget, line_widget, NULL); -#endif } @@ -1559,25 +1513,6 @@ static Arg arg_xy[] = { #define mane_base_y 0 -#ifdef MOTIF - -static int -set_bar_value(bar, value, max) - Widget bar; - int value; - int max; -{ - XmScrollBarCallbackStruct call_data; - - if (value > max) value = max; - if (value < 0) value = 0; - call_data.value = value; - XtVaSetValues(bar, XmNvalue, value, NULL); - XtCallCallbacks(bar, XmNvalueChangedCallback, &call_data); - return value; -} - -#endif /* MOTIF */ void @@ -1585,7 +1520,6 @@ home(scrl) wide_bool scrl; { if (!scrl) XUnmapWindow(DISP, mane.win); -#ifndef MOTIF get_xy(); if (x_bar != NULL) { int coord = (page_w - clip_w) / 2; @@ -1603,21 +1537,6 @@ home(scrl) XtCallCallbacks(y_bar, XtNscrollProc, (XtPointer) (ptrdiff_t) (window_y + coord)); } -#else /* MOTIF */ - { - int value; - - value = (page_w - clip_w) / 2; - if (value > home_x / mane.shrinkfactor) - value = home_x / mane.shrinkfactor; - (void) set_bar_value(x_bar, value, (int) (page_w - clip_w)); - - value = (page_h - clip_h) / 2; - if (value > home_y / mane.shrinkfactor) - value = home_y / mane.shrinkfactor; - (void) set_bar_value(y_bar, value, (int) (page_h - clip_h)); - } -#endif /* MOTIF */ if (!scrl) { XMapWindow(DISP, mane.win); /* Wait for the server to catch up---this eliminates flicker. */ @@ -1651,7 +1570,6 @@ home_bottom P1C(wide_bool, scrl) } -#ifndef MOTIF /*ARGSUSED*/ static void handle_destroy_bar(w, client_data, call_data) @@ -1661,7 +1579,6 @@ handle_destroy_bar(w, client_data, call_data) { * (Widget *) client_data = NULL; } -#endif static Boolean resized = False; @@ -1678,7 +1595,6 @@ get_geom() XtGetValues(vport_widget, arg_wh, XtNumber(arg_wh)); XtGetValues(clip_widget, arg_wh_clip, XtNumber(arg_wh_clip)); -#ifndef MOTIF /* Note: widgets may be destroyed but not forgotten */ if (x_bar == NULL) { x_bar = XtNameToWidget(vport_widget, "horizontal"); @@ -1692,7 +1608,6 @@ get_geom() XtAddCallback(y_bar, XtNdestroyCallback, handle_destroy_bar, (XtPointer) &y_bar); } -#endif old_clip_w = clip_w; /* we need to do this because */ /* sizeof(Dimension) != sizeof(int) */ @@ -1741,7 +1656,6 @@ handle_destroy_buttons(w, client_data, call_data) XtPointer call_data; { if (--destroy_count != 0) return; -#ifndef MOTIF XtSetValues(vport_widget, resizable_on, XtNumber(resizable_on)); if (resource.expert) { /* destroy buttons */ @@ -1753,24 +1667,13 @@ handle_destroy_buttons(w, client_data, call_data) XdviResizeWidget(vport_widget, window_w -= xtra_wid, window_h); set_button_panel_height((XtArgVal) window_h); } -#else /* MOTIF */ - if (resource.expert) - XtVaSetValues(vport_widget, - XmNleftAttachment, XmATTACH_FORM, - XmNleftOffset, 0, - NULL); - else { - create_buttons(); - window_w -= xtra_wid; - } -#endif /* MOTIF */ } #endif /* BUTTONS */ void reconfig() { -#if BUTTONS && !MOTIF +#if BUTTONS XtSetValues(vport_widget, resizable_off, XtNumber(resizable_off)); #endif XdviResizeWidget(draw_widget, page_w, page_h); @@ -1797,106 +1700,6 @@ goto_page(n, proc) } -#if MOTIF - -struct pd_act { - XtActionProc proc; - Cardinal num_params; - String param; -}; - -static void -do_pulldown_action(actp) - struct pd_act *actp; -{ - (actp->proc)(/* widget */ NULL, NULL, &actp->param, &actp->num_params); -} - -static struct pd_act file_pulldown_actions[] = { - {Act_open_dvi_file, 0, NULL}, - {Act_reread_dvi_file, 0, NULL}, - {Act_print, 0, NULL}, - {Act_quit, 0, NULL}}; - -/* ARGSUSED */ -void -file_pulldown_callback(w, client_data, call_data) - Widget w; - XtPointer client_data; - XtPointer call_data; -{ - do_pulldown_action(file_pulldown_actions + (ptrdiff_t) client_data); -} - -static struct pd_act navigate_pulldown_actions[] = { - {Act_back_page, 1, "10"}, - {Act_back_page, 1, "5"}, - {Act_back_page, 0, NULL}, - {Act_forward_page, 0, NULL}, - {Act_forward_page, 1, "5"}, - {Act_forward_page, 1, "10"}}; - -/* ARGSUSED */ -void -navigate_pulldown_callback(w, client_data, call_data) - Widget w; - XtPointer client_data; - XtPointer call_data; -{ - do_pulldown_action(navigate_pulldown_actions + (ptrdiff_t) client_data); -} - - -static struct pd_act scale_pulldown_actions[] = { - {Act_set_shrink_factor, 1, "1"}, - {Act_set_shrink_factor, 1, "2"}, - {Act_set_shrink_factor, 1, "3"}, - {Act_set_shrink_factor, 1, "4"}}; - -/* ARGSUSED */ -void -scale_pulldown_callback(w, client_data, call_data) - Widget w; - XtPointer client_data; - XtPointer call_data; -{ - do_pulldown_action(scale_pulldown_actions + (ptrdiff_t) client_data); -} - -void -set_shrink_factor(shrink) - int shrink; -{ - static Widget active_shrink_button = NULL; - Widget new_shrink_button; - - mane.shrinkfactor = shrink; - new_shrink_button = (shrink > 0 && shrink <= XtNumber(shrink_button) - ? shrink_button[shrink - 1] : NULL); - if (new_shrink_button != active_shrink_button) { - if (active_shrink_button != NULL) - XmToggleButtonSetState(active_shrink_button, False, False); - if (new_shrink_button != NULL) - XmToggleButtonSetState(new_shrink_button, True, False); - active_shrink_button = new_shrink_button; - } -} - -static unsigned int ungrab_serial = 0; - -/* ARGSUSED */ -void -popdown_callback(w, client_data, call_data) - Widget w; - XtPointer client_data; - XtPointer call_data; -{ - /* Lesstif gives call_data == NULL */ - if (call_data != NULL && *((XtGrabKind *) call_data) != XtGrabNone) - ungrab_serial = LastKnownRequestProcessed(DISP); -} - -#endif /* MOTIF */ @@ -2094,7 +1897,6 @@ ACTION(Act_center) return; /* button actions do not provide events */ #endif -#if !MOTIF x = event->xkey.x - clip_w / 2; y = event->xkey.y - clip_h / 2; @@ -2105,19 +1907,6 @@ ACTION(Act_center) XtCallCallbacks(y_bar, XtNscrollProc, (XtPointer) (ptrdiff_t) y); XWarpPointer(DISP, None, None, 0, 0, 0, 0, -x, -y); -#else /* MOTIF */ - - get_xy(); - /* The clip widget gives a more exact value. */ - x = event->xkey.x - clip_w / 2; - y = event->xkey.y - clip_h / 2; - - x = set_bar_value(x_bar, x, (int) (page_w - clip_w)); - y = set_bar_value(y_bar, y, (int) (page_h - clip_h)); - XWarpPointer(DISP, None, None, 0, 0, 0, 0, - -x - window_x, -y - window_y); - -#endif /* MOTIF */ } @@ -2144,80 +1933,51 @@ ACTION(Act_set_keep_flag) static ACTION(Act_left) { -#if !MOTIF if (x_bar != NULL) XtCallCallbacks(x_bar, XtNscrollProc, (XtPointer) (*num_params == 0 ? (-2 * (ptrdiff_t) clip_w / 3) : (ptrdiff_t) (-atof(*params) * clip_w))); else XBell(DISP, 0); -#else /* MOTIF */ - get_xy(); - (void) set_bar_value(x_bar, (*num_params == 0 ? (-2 * (int) clip_w / 3) - : (int) (-atof(*params) * clip_w)) - window_x, - (int) (page_w - clip_w)); -#endif /* MOTIF */ } static ACTION(Act_right) { -#if !MOTIF if (x_bar != NULL) XtCallCallbacks(x_bar, XtNscrollProc, (XtPointer) (*num_params == 0 ? (2 * (ptrdiff_t) clip_w / 3) : (ptrdiff_t) (atof(*params) * clip_w))); else XBell(DISP, 0); -#else /* MOTIF */ - get_xy(); - (void) set_bar_value(x_bar, (*num_params == 0 ? (2 * (int) clip_w / 3) - : (int) (atof(*params) * clip_w)) - window_x, - (int) (page_w - clip_w)); -#endif /* MOTIF */ } static ACTION(Act_up) { -#if !MOTIF if (y_bar != NULL) XtCallCallbacks(y_bar, XtNscrollProc, (XtPointer) (*num_params == 0 ? (-2 * (ptrdiff_t) clip_h / 3) : (ptrdiff_t) (-atof(*params) * clip_h))); else XBell(DISP, 0); -#else /* MOTIF */ - get_xy(); - (void) set_bar_value(y_bar, (*num_params == 0 ? (-2 * (int) clip_h / 3) - : (int) (-atof(*params) * clip_h)) - window_y, - (int) (page_h - clip_h)); -#endif /* MOTIF */ } static ACTION(Act_down) { -#if !MOTIF if (y_bar != NULL) XtCallCallbacks(y_bar, XtNscrollProc, (XtPointer) (*num_params == 0 ? (2 * (ptrdiff_t) clip_h / 3) : (ptrdiff_t) (atof(*params) * clip_h))); else XBell(DISP, 0); -#else /* MOTIF */ - get_xy(); - (void) set_bar_value(y_bar, (*num_params == 0 ? (2 * (int) clip_h / 3) - : (int) (atof(*params) * clip_h)) - window_y, - (int) (page_h - clip_h)); -#endif /* MOTIF */ } static ACTION(Act_down_or_next) { if (!resource.keep_flag) { -#if !MOTIF if (y_bar != NULL) { get_xy(); if (window_y > (int) clip_h - (int) page_h) { @@ -2228,16 +1988,6 @@ ACTION(Act_down_or_next) return; } } -#else /* MOTIF */ - get_xy(); - if (window_y > (int) clip_h - (int) page_h) { - (void) set_bar_value(y_bar, - (*num_params == 0 ? (2 * (int) clip_h / 3) - : (int) (atof(*params) * clip_h)) - window_y, - (int) (page_h - clip_h)); - return; - } -#endif /* MOTIF */ } /* !keep_flag */ if (current_page < total_pages - 1) { @@ -2256,7 +2006,6 @@ static ACTION(Act_up_or_previous) { if (!resource.keep_flag) { -#if !MOTIF if (y_bar != NULL) { get_xy(); if (window_y < 0) { @@ -2267,16 +2016,6 @@ ACTION(Act_up_or_previous) return; } } -#else /* MOTIF */ - get_xy(); - if (window_y < 0) { - (void) set_bar_value(y_bar, - (*num_params == 0 ? (-2 * (int) clip_h / 3) - : (int) (-atof(*params) * clip_h)) - window_y, - (int) (page_h - clip_h)); - return; - } -#endif /* MOTIF */ } /* !keep_flag */ if (current_page > 0) { @@ -2323,18 +2062,7 @@ shrink_to_fit() value1 = ROUNDUP(unshrunk_page_w, window_w - 2); -#if !MOTIF value2 = ROUNDUP(unshrunk_page_h, window_h - 2); -#else /* MOTIF */ - { /* account for menubar */ - static Dimension new_h; - - /* get rid of scrollbar */ - XdviResizeWidget(draw_widget, 1, 1); - XtVaGetValues(clip_widget, XtNheight, &new_h, NULL); - value2 = ROUNDUP(unshrunk_page_h, new_h - 2); - } -#endif /* MOTIF */ return value1 > value2 ? value1 : value2; } @@ -2354,11 +2082,7 @@ ACTION(Act_set_shrink_factor) if (arg == mane.shrinkfactor) return; -#if !MOTIF mane.shrinkfactor = arg; -#else - set_shrink_factor(arg); -#endif if (arg != 1 && arg != bak_shrink) { bak_shrink = arg; #if GREY @@ -2400,11 +2124,7 @@ ACTION(Act_shrink_to_dpi) if (arg == mane.shrinkfactor) return; -#if !MOTIF mane.shrinkfactor = arg; -#else - set_shrink_factor(arg); -#endif if (arg != 1 && arg != bak_shrink) { bak_shrink = arg; #if GREY @@ -2575,15 +2295,10 @@ ACTION(Act_set_expert_mode) if (resource.expert) { /* create buttons */ resource.expert = False; if (destroy_count != 0) return; -#if !MOTIF create_buttons(); /* this determines xtra_wid */ XtSetValues(vport_widget, resizable_on, XtNumber(resizable_on)); XdviResizeWidget(vport_widget, window_w -= xtra_wid, window_h); set_button_panel_height((XtArgVal) window_h); -#else /* MOTIF */ - create_buttons(); - window_w -= xtra_wid; -#endif /* MOTIF */ } else { /* destroy buttons */ resource.expert = True; @@ -2681,24 +2396,6 @@ ACTION(Act_magnifier) if (!check_dvi_file() || !dvi_file_ready) return; -#if MOTIF - /* - * There's an apparent bug in Motif related to the interaction between - * the menubar menus and the magnifier. - * - * If you click on a menu on the menubar and then click on the drawing - * widget to pop up a magnifier, the keyboard and pointer are still - * grabbed, leading to a weird situation in which the magnifier stays - * around even after you release the pointer. The following statement - * works around this bug by ignoring such pointer events. - * - * This bug occurs in Motif 1.2 and OpenMotif 2.2.2 (at least). It - * does not occur in Lesstif. - */ - - if (event->xany.serial < ungrab_serial) - return; -#endif if (event->type != ButtonPress || mouse_release != null_mouse @@ -2731,10 +2428,8 @@ ACTION(Act_magnifier) return; } } -#if !MOTIF (void) XTranslateCoordinates(DISP, event->xbutton.window, mane.win, 0, 0, &mag_conv_x, &mag_conv_y, &throwaway); -#endif mag_x = event->xbutton.x + mag_conv_x; @@ -2876,35 +2571,20 @@ ACTION(Act_drag) static void drag_motion P1C(XEvent *, event) { -#if MOTIF - get_xy(); -#endif if (drag_flags & 2) { /* if horizontal motion */ -#if !MOTIF if (x_bar != NULL) XtCallCallbacks(x_bar, XtNscrollProc, (XtPointer) (ptrdiff_t) (drag_last_x - event->xbutton.x_root)); -#else /* MOTIF */ - (void) set_bar_value(x_bar, - drag_last_x - event->xbutton.x_root - window_x, - (int) (page_w - clip_w)); -#endif /* MOTIF */ drag_last_x = event->xbutton.x_root; } if (drag_flags & 1) { /* if vertical motion */ -#if !MOTIF if (y_bar != NULL) XtCallCallbacks(y_bar, XtNscrollProc, (XtPointer) (ptrdiff_t) (drag_last_y - event->xbutton.y_root)); -#else /* MOTIF */ - (void) set_bar_value(y_bar, - drag_last_y - event->xbutton.y_root - window_y, - (int) (page_h - clip_h)); -#endif /* MOTIF */ drag_last_y = event->xbutton.y_root; } } @@ -2939,13 +2619,8 @@ ACTION(Act_wheel) } dist = (index(*params, '.') == NULL) ? atoi(*params) : (int) (atof(*params) * resource.wheel_unit); -#if !MOTIF if (y_bar != NULL) XtCallCallbacks(y_bar, XtNscrollProc, (XtPointer) (ptrdiff_t) dist); -#else /* MOTIF */ - get_xy(); - (void) set_bar_value(y_bar, dist - window_y, (int) (page_h - clip_h)); -#endif /* MOTIF */ if (event != NULL) wheel_button = event->xbutton.button; @@ -2964,13 +2639,8 @@ ACTION(Act_hwheel) } dist = (index(*params, '.') == NULL) ? atoi(*params) : (int) (atof(*params) * resource.wheel_unit); -#if !MOTIF if (x_bar != NULL) XtCallCallbacks(x_bar, XtNscrollProc, (XtPointer) (ptrdiff_t) dist); -#else /* MOTIF */ - get_xy(); - (void) set_bar_value(x_bar, dist - window_x, (int) (page_w - clip_w)); -#endif /* MOTIF */ if (event != NULL) wheel_h_button = event->xbutton.button; diff --git a/popups.c b/popups.c @@ -572,9 +572,6 @@ warning_popup(message, button_name, callback) Widget #if NeedVarargsPrototypes warning_popup_long(_Xconst char *format, -# if MOTIF - int mtype, -# endif _Xconst char *button_name, XtCallbackProc callback, ...) #else /* ! NeedVarargsPrototypes */ warning_popup_long(format, button_name, callback, va_alist) @@ -2734,14 +2731,8 @@ print_precheck() print_confirm = confirm_popup(msg, "OK", cb_print_confirm, (XtPointer) print_shell, NULL); free(msg); -#if MOTIF - XtFree(dest); -#endif return; } -#if MOTIF - XtFree(dest); -#endif } print_do_it(); @@ -3009,9 +3000,6 @@ print_do_it() #endif p[-1] = '\n'; -#if MOTIF - *p = '\0'; -#endif printlog_length = 0; @@ -3183,9 +3171,6 @@ read_from_dvips() if (bytes == 0) break; else { -#if MOTIF - line[bytes] = '\0'; -#endif printlog_append(line, bytes); } } diff --git a/xdvi.c b/xdvi.c @@ -142,29 +142,13 @@ extern double atof ARGS((_Xconst char *)); #if XtSpecificationRelease >= 4 -#ifndef MOTIF # include <X11/Xaw/Viewport.h> #define VPORT_WIDGET_CLASS viewportWidgetClass #define DRAW_WIDGET_CLASS drawWidgetClass -#else /* MOTIF */ -#include <Xm/MainW.h> -#include <Xm/ToggleB.h> -#include <Xm/RowColumn.h> -#include <Xm/MenuShell.h> -#include <Xm/DrawingA.h> -#include <Xm/Protocols.h> -#define VPORT_WIDGET_CLASS xmMainWindowWidgetClass -#define DRAW_WIDGET_CLASS xmDrawingAreaWidgetClass -#endif /* MOTIF */ #ifdef BUTTONS -#ifndef MOTIF # include <X11/Xaw/Command.h> #define FORM_WIDGET_CLASS formWidgetClass -#else /* MOTIF */ -#include <Xm/Form.h> -#define FORM_WIDGET_CLASS xmFormWidgetClass -#endif /* MOTIF */ #endif /* BUTTONS */ #else /* XtSpecificationRelease < 4 */ @@ -303,18 +287,10 @@ struct WindowRec currwin= {(Window) 0, 1, 0, 0, 0, 0, MAXDIM, 0, MAXDIM, 0}; #ifdef lint WidgetClass widgetClass; -#ifndef MOTIF WidgetClass viewportWidgetClass; #ifdef BUTTONS WidgetClass formWidgetClass, compositeWidgetClass, commandWidgetClass; #endif /* BUTTONS */ -#else /* MOTIF */ -WidgetClass xmMainWindowWidgetClass, xmDrawingAreaWidgetClass; -#ifdef BUTTONS -WidgetClass xmFormWidgetClass, xmBulletinBoardWidgetClass; -WidgetClass xmPushButtonWidgetClass; -#endif /* BUTTONS */ -#endif /* MOTIF */ #endif /* lint */ static char * atom_names[] = {"XDVI WINDOWS", "DVI NAME", "SRC GOTO", @@ -483,10 +459,6 @@ static _Xconst char base_translations[] = "" "\"b\":back-page()\n" "<Key>Delete:up-or-previous()\n" "<Key>BackSpace:up-or-previous()\n" -#if MOTIF -"<Key>osfDelete:up-or-previous()\n" -"<Key>osfBackSpace:up-or-previous()\n" -#endif "\"P\":declare-page-number()\n" "\"g\":goto-page()\n" "\"\\^\":home()\n" @@ -821,7 +793,6 @@ static _Xconst char *usagestr[] = { }; -#ifndef MOTIF #ifdef NOQUERY #define drawWidgetClass widgetClass @@ -887,10 +858,8 @@ static WidgetClassRec drawingWidgetClass = { #define drawWidgetClass &drawingWidgetClass #endif /* NOQUERY */ -#endif /* MOTIF */ static Arg vport_args[] = { -#if ! MOTIF #ifdef BUTTONS {XtNborderWidth, (XtArgVal) 0}, {XtNtop, (XtArgVal) XtChainTop}, @@ -900,38 +869,19 @@ static Arg vport_args[] = { #endif {XtNallowHoriz, (XtArgVal) True}, {XtNallowVert, (XtArgVal) True}, -#else /* MOTIF */ - {XmNscrollingPolicy, (XtArgVal) XmAUTOMATIC}, - {XmNborderWidth, (XtArgVal) 0}, - {XmNleftAttachment, (XtArgVal) XmATTACH_FORM}, - {XmNtopAttachment, (XtArgVal) XmATTACH_FORM}, - {XmNbottomAttachment, (XtArgVal) XmATTACH_FORM}, - {XmNrightAttachment, (XtArgVal) XmATTACH_FORM}, -#endif /* MOTIF */ }; static Arg draw_args[] = { -#ifndef MOTIF {XtNwidth, (XtArgVal) 0}, {XtNheight, (XtArgVal) 0}, {XtNx, (XtArgVal) 0}, {XtNy, (XtArgVal) 0}, {XtNlabel, (XtArgVal) ""}, -#else /* MOTIF */ - {XmNwidth, (XtArgVal) 0}, - {XmNheight, (XtArgVal) 0}, - {XmNbottomAttachment, (XtArgVal) XmATTACH_WIDGET}, -#endif /* MOTIF */ }; #if BUTTONS static Arg form_args[] = { -#if !MOTIF {XtNdefaultDistance, (XtArgVal) 0}, -#else /* MOTIF */ - {XmNhorizontalSpacing, (XtArgVal) 0}, - {XmNverticalSpacing, (XtArgVal) 0}, -#endif /* MOTIF */ }; #endif @@ -1860,10 +1810,6 @@ main(argc, argv) char **argv; { -#ifdef MOTIF - Widget menubar; - Widget scale_menu; -#endif Dimension screen_w, screen_h; int i; @@ -2409,91 +2355,15 @@ argument is to override any papersize specials in the dvi file.\n\n", stderr); vport_widget = XtCreateManagedWidget("vport", VPORT_WIDGET_CLASS, form_or_top, vport_args, XtNumber(vport_args)); -#ifndef MOTIF clip_widget = XtNameToWidget(vport_widget, "clip"); -#else /* MOTIF */ - - menubar = XmVaCreateSimpleMenuBar(vport_widget, "menubar", - XmNdepth, (XtArgVal) our_depth, - XmNvisual, (XtArgVal) our_visual, - XmNcolormap, (XtArgVal) our_colormap, - XmVaCASCADEBUTTON, XmCvtCTToXmString("File"), (KeySym) 0, - XmVaCASCADEBUTTON, XmCvtCTToXmString("Navigate"), (KeySym) 0, - XmVaCASCADEBUTTON, XmCvtCTToXmString("Scale"), (KeySym) 0, - NULL); - XmVaCreateSimplePulldownMenu(menubar, - "file_pulldown", 0, file_pulldown_callback, - XmNtearOffModel, (XtArgVal) XmTEAR_OFF_ENABLED, - XmNdepth, (XtArgVal) our_depth, - XmNvisual, (XtArgVal) our_visual, - XmNcolormap, (XtArgVal) our_colormap, - XmVaPUSHBUTTON, XmCvtCTToXmString("Open file"), - (KeySym) 0, (String) 0, (XmString) 0, - XmVaPUSHBUTTON, XmCvtCTToXmString("Reload"), - (KeySym) 0, (String) 0, (XmString) 0, - XmVaPUSHBUTTON, XmCvtCTToXmString("Print"), - (KeySym) 0, (String) 0, (XmString) 0, - XmVaSEPARATOR, - XmVaPUSHBUTTON, XmCvtCTToXmString("Quit"), - (KeySym) 0, (String) 0, (XmString) 0, - NULL); - XmVaCreateSimplePulldownMenu(menubar, - "navigate_pulldown", 1, navigate_pulldown_callback, - XmNtearOffModel, (XtArgVal) XmTEAR_OFF_ENABLED, - XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Page-10"), - (KeySym) 0, (String) 0, (XmString) 0, - XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Page-5"), - (KeySym) 0, (String) 0, (XmString) 0, - XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Prev"), - (KeySym) 0, (String) 0, (XmString) 0, - XmVaSEPARATOR, - XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Next"), - (KeySym) 0, (String) 0, (XmString) 0, - XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Page+5"), - (KeySym) 0, (String) 0, (XmString) 0, - XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Page+10"), - (KeySym) 0, (String) 0, (XmString) 0, - NULL); - scale_menu = XmVaCreateSimplePulldownMenu(menubar, - "scale_pulldown", 2, scale_pulldown_callback, - XmNradioBehavior, (XtArgVal) True, - XmNtearOffModel, (XtArgVal) XmTEAR_OFF_ENABLED, - XmVaRADIOBUTTON, (XtArgVal) XmCvtCTToXmString("Shrink1"), - (KeySym) 0, (String) 0, (XmString) 0, - XmVaRADIOBUTTON, (XtArgVal) XmCvtCTToXmString("Shrink2"), - (KeySym) 0, (String) 0, (XmString) 0, - XmVaRADIOBUTTON, (XtArgVal) XmCvtCTToXmString("Shrink3"), - (KeySym) 0, (String) 0, (XmString) 0, - XmVaRADIOBUTTON, (XtArgVal) XmCvtCTToXmString("Shrink4"), - (KeySym) 0, (String) 0, (XmString) 0, - NULL); - shrink_button[0] = XtNameToWidget(scale_menu, "button_0"); - shrink_button[1] = XtNameToWidget(scale_menu, "button_1"); - shrink_button[2] = XtNameToWidget(scale_menu, "button_2"); - shrink_button[3] = XtNameToWidget(scale_menu, "button_3"); - - /* All of the pulldown menus have the same parent. */ - XtAddCallback(XtParent(scale_menu), XtNpopdownCallback, - popdown_callback, (XtPointer) 0); - - x_bar = XtNameToWidget(vport_widget, "HorScrollBar"); - y_bar = XtNameToWidget(vport_widget, "VertScrollBar"); - -#endif /* MOTIF */ draw_args[0].value = (XtArgVal) page_w; draw_args[1].value = (XtArgVal) page_h; draw_widget = XtCreateManagedWidget("drawing", DRAW_WIDGET_CLASS, vport_widget, draw_args, XtNumber(draw_args)); -#ifdef MOTIF - XtVaSetValues(vport_widget, XmNworkWindow, draw_widget, - XmNmenuBar, menubar, NULL); - XtManageChild(menubar); - XtVaGetValues(vport_widget, XmNclipWindow, &clip_widget, NULL); -#endif /* MOTIF */ #if XtSpecificationRelease < 5 if (resource.main_translations != NULL) { @@ -2527,11 +2397,7 @@ argument is to override any papersize specials in the dvi file.\n\n", stderr); #endif /* XtSpecificationRelease */ XtOverrideTranslations( -#if !MOTIF form_or_vport, -#else - draw_widget, -#endif XtParseTranslationTable("\ \"0\":digit(0)\n\ \"1\":digit(1)\n\ @@ -2624,9 +2490,6 @@ argument is to override any papersize specials in the dvi file.\n\n", stderr); XtSetValues(vport_widget, set_wh_args, XtNumber(set_wh_args)); #endif /* BUTTONS */ } -#ifdef MOTIF - set_shrink_factor(mane.shrinkfactor); -#endif /* @@ -2634,13 +2497,10 @@ argument is to override any papersize specials in the dvi file.\n\n", stderr); */ -#if BUTTONS && !MOTIF +#if BUTTONS if (!resource.expert) set_button_panel_height(set_wh_args[1].value); #endif -#if MOTIF - XtSetSensitive(draw_widget, TRUE); -#endif XtAddEventHandler(top_level, PropertyChangeMask, False, handle_property_change, (XtPointer) NULL); XtAddEventHandler(vport_widget, StructureNotifyMask, False, diff --git a/xdvi.h b/xdvi.h @@ -98,12 +98,6 @@ NOTE: #if (defined(VMS) && (XtSpecificationRelease <= 4)) || defined(lint) # include <X11/IntrinsicP.h> #endif -#if MOTIF -# include <Xm/Xm.h> -# ifndef MOTIF_TIMERS /* see comment in events.c */ -# define MOTIF_TIMERS (XmVERSION >= 2) -# endif -#endif #if EXTRA_APP_DEFAULTS && !SELFAUTO @@ -846,9 +840,6 @@ struct wheel_acts { EXTERN struct wheel_acts *wheel_actions; -#if MOTIF && BUTTONS -EXTERN XtTranslations wheel_trans_table INIT(NULL); -#endif #ifdef GREY EXTERN Pixel *pixeltbl; @@ -942,10 +933,6 @@ EXTERN Boolean drawing_mag INIT(False); EXTERN Widget top_level INIT(0); EXTERN Widget vport_widget, draw_widget, clip_widget; -# if MOTIF -EXTERN Widget shrink_button[4]; -EXTERN Widget x_bar, y_bar; /* horizontal and vert. scroll bars */ -# endif # if BUTTONS EXTERN Widget form_widget; EXTERN int xtra_wid INIT(0); @@ -1127,13 +1114,6 @@ extern void handle_property_change ARGS((Widget, XtPointer, XEvent *, Boolean *)); extern void handle_messages ARGS((Widget, XtPointer, XEvent *, Boolean *)); extern void goto_page ARGS((int, home_proc)); -#if MOTIF -extern void file_pulldown_callback ARGS((Widget, XtPointer, XtPointer)); -extern void navigate_pulldown_callback ARGS((Widget, XtPointer, XtPointer)); -extern void scale_pulldown_callback ARGS((Widget, XtPointer, XtPointer)); -extern void set_shrink_factor ARGS((int)); -extern void popdown_callback ARGS((Widget, XtPointer, XtPointer)); -#endif extern void set_chld ARGS((struct xchild *)); extern void clear_chld ARGS((struct xchild *)); extern void set_io ARGS((struct xio *));