diff -c ../xfig.3.2.3a/Fig.ad ./Fig.ad
*** ../xfig.3.2.3a/Fig.ad	Thu May  4 16:48:26 2000
--- ./Fig.ad	Fri May  5 15:45:45 2000
***************
*** 163,174 ****
--- 163,181 ----
  ! Note that you shouldn't remove the following "Fig*international: false".  
  ! It must be there to cancel any *international: true that may defined via xrdb.
  ! This can cause problems on xfig even if the i18n facility is used.
+ !
  Fig*international: false
  
  Fig.translations: #override \n\
           <Key>: \n\
           <KeyUp>:
  
+ ! Comment out following lines if you had problem when you set
+ ! and open Edit panel for i18n'ed text.
+ !
+ Fig*edit_panel*Text_text*international: true
+ Fig*edit_panel*inputMethod: xim
+ 
  ! keyboard accelerators
  
  Fig*accelerators: \
***************
*** 457,460 ****
--- 464,528 ----
  Fig*menu_divider.justify:		center
  Fig*menu_divider.topShadowContrast:	0
  Fig*menu_divider.bottomShadowContrast:	0
+ 
+ 
+ ! ----------------------------------------------------------------
+ ! WHEEL-MOUSE SUPPORT:
+ ! unofficial patch by T.Sato <VEF00200@nifty.ne.jp>, 2000/5/5
+ ! xfig must compiled with -DWHEELMOUSE
+ 
+ ! switch setting via wheel rotation
+ !
+ Fig*ind_panel*Command.translations: #override \
+     <Btn4Down>:PressMiddle()\n\
+     <Btn4Up>:ReleaseMiddle()\n\
+     <Btn5Down>:PressRight()\n\
+     <Btn5Up>:ReleaseRight()
+ 
+ ! up/down numeric value via wheel rotation
+ !
+ Fig*spinner_form*Text.translations: #override \
+     <Btn4Down>: SpinnerUpDown(-) \n\
+     <Btn5Down>: SpinnerUpDown(+) \n\
+     <Btn4Up>: SpinnerUpDown(-) \n\
+     <Btn5Up>: SpinnerUpDown(+)
+ 
+ Fig*spinner_form*Command.translations: #override \
+     <BtnDown>:	set() \n\
+     <BtnUp>:	notify() unset()
+ 
+ ! move scrollbar via wheel rotation
+ !
+ Fig*Scrollbar.translations: #override \
+     <Btn4Down>: StartScroll(Backward) StartScroll(Backward) \
+         StartScroll(Backward) StartScroll(Backward) StartScroll(Backward) \n\
+     <Btn5Down>: StartScroll(Forward) StartScroll(Forward) \
+         StartScroll(Forward) StartScroll(Forward) StartScroll(Forward)
+ 
+ ! popup drawing/editing menu via wheel rotation.
+ ! if Control is pressed, zoom in/zoom out via wheel rotation.
+ !
+ Fig*canvas.translations: #override \
+     Ctrl<Btn4Down>: ZoomOut() \n\
+     Ctrl<Btn5Down>: ZoomIn() \n\
+     <Btn4Down>: PopupModePanel(draw) \n\
+     <Btn5Down>: PopupModePanel(edit)
+ 
+ Fig*draw_menu*translations: #override \
+     <Message>WM_PROTOCOLS: PopdownModePanel() \n\
+     <Btn5Down>: PopdownModePanel()
+ 
+ Fig*edit_menu*translations: #override \
+     <Message>WM_PROTOCOLS: PopdownModePanel() \n\
+     <Btn4Down>: PopdownModePanel()
+ 
+ Fig*draw_menu*highlightThickness: 1
+ Fig*edit_menu*highlightThickness: 1
+ 
+ ! do not want to popup SimpleMenu via wheel rotation
+ !
+ Fig*MenuButton.translations: #override \
+     <Btn4Down>: \n\
+     <Btn5Down>:
+ 
  
diff -c ../xfig.3.2.3a/Imakefile ./Imakefile
*** ../xfig.3.2.3a/Imakefile	Tue Jan 25 07:07:02 2000
--- ./Imakefile	Fri May  5 11:33:29 2000
***************
*** 232,238 ****
  
  DEFINES =             $(STRDEFINES) $(USEINLINE) $(DUSEXPM) $(DUSEXAW3D) \
  			$(DUSEJPEG) $(I18N_DEFS) \
! 			$(HAVE_NO_DIRENT) 
  
  XFIGSRC =	d_arc.c d_arcbox.c d_box.c d_ellipse.c d_picobj.c \
  		d_subspline.c d_line.c d_regpoly.c d_spline.c d_text.c \
--- 232,238 ----
  
  DEFINES =             $(STRDEFINES) $(USEINLINE) $(DUSEXPM) $(DUSEXAW3D) \
  			$(DUSEJPEG) $(I18N_DEFS) \
! 			$(HAVE_NO_DIRENT) -DWHEELMOUSE
  
  XFIGSRC =	d_arc.c d_arcbox.c d_box.c d_ellipse.c d_picobj.c \
  		d_subspline.c d_line.c d_regpoly.c d_spline.c d_text.c \
diff -c ../xfig.3.2.3a/e_edit.c ./e_edit.c
*** ../xfig.3.2.3a/e_edit.c	Tue Jan  4 03:09:42 2000
--- ./e_edit.c	Fri May  5 03:18:20 2000
***************
*** 1022,1028 ****
  	form = XtCreateManagedWidget("form", formWidgetClass, viewp, Args, ArgCount);
  	below = NULL;
  	for (t=c->texts, i=0; t && i<MAX_COMPOUND_TEXT_PANELS; t=t->next, i++) {
! 	    str_panel(t->cstring, "Text", &compound_text_panels[i], 220, True);
  	    if (i>0) {
  		/* scrunch the texts together vertically */
  		FirstArg(XtNvertDistance, 1);
--- 1022,1028 ----
  	form = XtCreateManagedWidget("form", formWidgetClass, viewp, Args, ArgCount);
  	below = NULL;
  	for (t=c->texts, i=0; t && i<MAX_COMPOUND_TEXT_PANELS; t=t->next, i++) {
! 	    str_panel(t->cstring, "Text", &compound_text_panels[i], 220, True, False);
  	    if (i>0) {
  		/* scrunch the texts together vertically */
  		FirstArg(XtNvertDistance, 1);
***************
*** 1219,1225 ****
  				MIN_DEPTH, MAX_DEPTH, 1);
  	if (!strcmp(new_l->pic->file, EMPTY_PIC))
  	    new_l->pic->file[0] = '\0';
! 	str_panel(new_l->pic->file, "Picture Filename", &pic_name_panel, 290, False);
  
  	/* make a button to reread the picture file */
  	FirstArg(XtNfromVert, beside);
--- 1219,1225 ----
  				MIN_DEPTH, MAX_DEPTH, 1);
  	if (!strcmp(new_l->pic->file, EMPTY_PIC))
  	    new_l->pic->file[0] = '\0';
! 	str_panel(new_l->pic->file, "Picture Filename", &pic_name_panel, 290, False, False);
  
  	/* make a button to reread the picture file */
  	FirstArg(XtNfromVert, beside);
***************
*** 1834,1840 ****
      /* make the popup font menu */
      font_image_panel(new_psflag ? psfont_menu_bitmaps[new_t->font + 1] :
  		latexfont_menu_bitmaps[new_t->font], "Font", &font_panel);
!     str_panel(new_t->cstring, "Text", &text_panel, 220, True);
  }
  
  static void
--- 1834,1845 ----
      /* make the popup font menu */
      font_image_panel(new_psflag ? psfont_menu_bitmaps[new_t->font + 1] :
  		latexfont_menu_bitmaps[new_t->font], "Font", &font_panel);
! #ifdef I18N
!     str_panel(new_t->cstring, "Text", &text_panel, 220, True,
! 	      appres.latin_keyboard || is_i18n_font(new_t->fontstruct));
! #else
!     str_panel(new_t->cstring, "Text", &text_panel, 220, True, False);
! #endif
  }
  
  static void
***************
*** 3678,3689 ****
  }
  
  static void
! str_panel(string, name, pi_x, width, size_to_width)
      char	   *string;
      char	   *name;
      Widget	   *pi_x;
      int		    width;
      Boolean	    size_to_width;
  {
      int		    nlines, i;
      Dimension	    pwidth;
--- 3683,3695 ----
  }
  
  static void
! str_panel(string, name, pi_x, width, size_to_width, international)
      char	   *string;
      char	   *name;
      Widget	   *pi_x;
      int		    width;
      Boolean	    size_to_width;
+     Boolean	    international;
  {
      int		    nlines, i;
      Dimension	    pwidth;
***************
*** 3732,3738 ****
      NextArg(XtNheight, max_char_height(temp_font) * nlines + 20);
      NextArg(XtNscrollHorizontal, XawtextScrollWhenNeeded);
      NextArg(XtNscrollVertical, XawtextScrollWhenNeeded);
! 
      *pi_x = XtCreateManagedWidget(textname, asciiTextWidgetClass, form, Args, ArgCount);
  
      /* make CR do nothing for now */
--- 3738,3747 ----
      NextArg(XtNheight, max_char_height(temp_font) * nlines + 20);
      NextArg(XtNscrollHorizontal, XawtextScrollWhenNeeded);
      NextArg(XtNscrollVertical, XawtextScrollWhenNeeded);
! #ifdef I18N
!     if (!appres.international || !international)
!       NextArg(XtNinternational, False);
! #endif
      *pi_x = XtCreateManagedWidget(textname, asciiTextWidgetClass, form, Args, ArgCount);
  
      /* make CR do nothing for now */
diff -c ../xfig.3.2.3a/main.c ./main.c
*** ../xfig.3.2.3a/main.c	Thu Jan 13 09:22:21 2000
--- ./main.c	Fri May  5 11:27:14 2000
***************
*** 66,71 ****
--- 66,75 ----
  int		update_fig_files();
  static int	screen_res;
  
+ #ifdef WHEELMOUSE  /* T.Sato, 2000/5/4 */
+ int spinner_up_down();
+ #endif
+ 
  /************** FIG options ******************/
  
  DeclareStaticArgs(10);
***************
*** 104,109 ****
--- 108,116 ----
      {"Man",		(XtActionProc) launch_man},
      {"HowToGuide",	(XtActionProc) launch_howto},
      {"AboutXfig",	(XtActionProc) launch_about},
+ #ifdef WHEELMOUSE  /* T.Sato, 2000/5/4 */
+     {"SpinnerUpDown",	(XtActionProc) spinner_up_down},
+ #endif
  };
  
  static XtResource application_resources[] = {
diff -c ../xfig.3.2.3a/mode.h ./mode.h
*** ../xfig.3.2.3a/mode.h	Tue Jan  4 03:09:38 2000
--- ./mode.h	Fri May  5 10:29:25 2000
***************
*** 281,284 ****
--- 281,285 ----
  extern char	file_header[];
  extern char	cut_buf_name[];		/* path of .xfig cut buffer file */
  extern char	xfigrc_name[];		/* path of .xfigrc file */
+ 
  #endif /* MODE_H */
diff -c ../xfig.3.2.3a/w_canvas.c ./w_canvas.c
*** ../xfig.3.2.3a/w_canvas.c	Thu Jan 20 10:47:35 2000
--- ./w_canvas.c	Fri May  5 11:24:44 2000
***************
*** 38,43 ****
--- 38,49 ----
  #include "w_util.h"
  #include "w_zoom.h"
  
+ #ifdef WHEELMOUSE  /* T.Sato, 2000/5/4 */
+ #include "w_modepanel.h"
+ static popup_mode_panel();
+ static popdown_mode_panel();
+ #endif
+ 
  #ifndef SYSV
  #include <sys/time.h>
  #endif /* SYSV */
***************
*** 143,148 ****
--- 149,158 ----
      {"ToggleShowLengths", (XtActionProc) toggle_show_lengths},
      {"ToggleShowVertexnums", (XtActionProc) toggle_show_vertexnums},
      {"ToggleShowBorders", (XtActionProc) toggle_show_borders},
+ #ifdef WHEELMOUSE  /* T.Sato, 2000/5/4 */
+     {"PopupModePanel", (XtActionProc)popup_mode_panel},
+     {"PopdownModePanel", (XtActionProc)popdown_mode_panel},
+ #endif
  };
  
  /* need the ~Meta for the EventCanv action so that the accelerators still work 
***************
*** 757,759 ****
--- 767,869 ----
      refresh_view_menu();
  }
  
+ 
+ 
+ /* popup drawing/editing mode panel on the canvas.
+   This can be useful especially if wheel-mouse is in use.  - T.Sato */
+ 
+ #ifdef WHEELMOUSE  /* T.Sato, 2000/5/4 */
+ 
+ static Widget draw_panel = None;
+ static Widget edit_panel = None;
+ static Widget active_mode_panel = None;
+ 
+ extern mode_sw_info mode_switches[];
+ 
+ static popdown_mode_panel()
+ {
+   if (active_mode_panel != None) XtPopdown(active_mode_panel);
+   active_mode_panel = None;
+ }
+ 
+ static mode_panel_button_selected(Widget w, char *icon, char *call_data)
+ {
+   change_mode(icon);
+   popdown_mode_panel();
+ }
+ 
+ static void create_mode_panel()
+ {
+   Widget draw_form, edit_form;
+   Widget form, entry;
+   icon_struct *icon;
+   Widget up = None, left = None;
+   int max_wd = 150, wd = 0;
+   int i;
+ 
+   draw_panel = XtVaCreatePopupShell("draw_menu", transientShellWidgetClass, tool,
+ 				    XtNtitle, "Drawing Modes", NULL);
+   draw_form = XtVaCreateManagedWidget("form", formWidgetClass, draw_panel,
+ 				    XtNdefaultDistance, 0, NULL);
+ 
+   edit_panel = XtVaCreatePopupShell("edit_menu", transientShellWidgetClass, tool,
+ 				    XtNtitle, "Editing Modes", NULL);
+   edit_form = XtVaCreateManagedWidget("form", formWidgetClass, edit_panel,
+ 				    XtNdefaultDistance, 0, NULL);
+ 
+   form = draw_form;
+   for (i = 0; mode_switches[i].mode != F_NULL; i++) {
+     if (form == draw_form && FIRST_EDIT_MODE <= mode_switches[i].mode) {
+       form = edit_form;
+       left = None;
+       up = None;
+       wd = 0;
+     }
+     icon = mode_switches[i].icon;
+     wd = wd + icon->width;
+     if (max_wd < wd) {
+       up = left;
+       left = None;
+       wd = icon->width;
+     }
+     entry = XtVaCreateManagedWidget("button", commandWidgetClass, form,
+ 			    XtNlabel, "", XtNresizable, False,
+ 			    XtNtop, XawChainTop, XtNbottom, XawChainTop,
+ 			    XtNleft, XawChainLeft, XtNright, XawChainLeft,
+ 			    XtNwidth, icon->width, XtNheight, icon->height,
+ 			    XtNbackgroundPixmap, mode_switches[i].pixmap,
+ 			    NULL);
+     if (up != None) XtVaSetValues(entry, XtNfromVert, up, NULL);
+     if (left != None) XtVaSetValues(entry, XtNfromHoriz, left, NULL);
+     XtAddCallback(entry, XtNcallback, (XtCallbackProc)mode_panel_button_selected,
+ 		  (XtPointer)mode_switches[i].icon);
+     left = entry;
+   }
+ }
+ 
+ static popup_mode_panel(widget, event, params, num_params)
+      Widget	 widget;
+      XButtonEvent	*event;
+      String	*params;
+      Cardinal	*num_params;
+ {
+   Dimension wd, ht;
+   Widget panel;
+ 
+   if (draw_panel == None) {
+     create_mode_panel();
+     XtRealizeWidget(draw_panel);
+     XtRealizeWidget(edit_panel);
+     XSetWMProtocols(tool_d, XtWindow(draw_panel), &wm_delete_window, 1);
+     XSetWMProtocols(tool_d, XtWindow(edit_panel), &wm_delete_window, 1);
+   }
+   panel = (strcmp(params[0], "edit") == 0) ? edit_panel : draw_panel;
+   if (active_mode_panel != panel) popdown_mode_panel();
+   XtVaGetValues(panel, XtNwidth, &wd, XtNheight, &ht, NULL);
+   XtVaSetValues(panel, XtNx, event->x_root - wd / 2,
+ 		XtNy, event->y_root - ht * 2 / 3, NULL);
+   XtPopup(panel, XtGrabNone);
+   active_mode_panel = panel;
+ }
+ 
+ #endif  /* WHEELMOUSE */
diff -c ../xfig.3.2.3a/w_indpanel.c ./w_indpanel.c
*** ../xfig.3.2.3a/w_indpanel.c	Thu Jan 20 10:47:35 2000
--- ./w_indpanel.c	Fri May  5 15:32:52 2000
***************
*** 993,998 ****
--- 993,1004 ----
      app_flush();
  
      xbutton = event->xbutton;
+ #ifdef WHEELMOUSE
+     switch (xbutton.button) {
+     case Button4: xbutton.button = Button2; break;
+     case Button5: xbutton.button = Button3; break;
+     }
+ #endif
      if ((xbutton.button == Button2)  ||
                (xbutton.button == Button3 && xbutton.state & Mod1Mask)) { /* middle button */
  	dec_action(isw);
***************
*** 3189,3202 ****
--- 3195,3231 ----
  
  /* ZOOM */
  
+ #ifdef WHEELMOUSE  /* T.Sato, 2000/5/5 */
+ #define BACKX2(x) round(x/display_zoomscale*ZOOM_FACTOR+zoomxoff)
+ #define BACKY2(y) round(y/display_zoomscale*ZOOM_FACTOR+zoomyoff)
+ #endif
+ 
  void
  inc_zoom(sw)
      ind_sw_info	   *sw;
  {
+ #ifdef WHEELMOUSE  /* T.Sato, 2000/5/5 */
+     Window root, child;
+     int x1, y1, junk;
+     int hot_x, hot_y;
+     Boolean centering;
+ #endif  /* WHEELMOUSE */
+ 
      /* don't allow zooming while previewing */
      if (preview_in_progress || check_action_on())
  	return;
  
+ #ifdef WHEELMOUSE  /* T.Sato, 2000/5/5 */
+     XQueryPointer(XtDisplay(canvas_sw), XtWindow(canvas_sw),
+ 		  &root, &child, &junk, &junk, &x1, &y1, &junk);
+     centering = False;
+     if (0 <= x1 && x1 <= CANVAS_WD && 0 <= y1 && y1 <= CANVAS_HT) {
+ 	centering = True;
+ 	hot_x = BACKX2(x1);
+ 	hot_y = BACKY2(y1);
+     }
+ #endif  /* WHEELMOUSE */
+ 
      if (display_zoomscale < (float) 0.1) {
  	display_zoomscale = (int)(display_zoomscale * 100.0 + 0.1) + 1.0;
  	display_zoomscale /= 100.0;
***************
*** 3207,3214 ****
  	    display_zoomscale += 0.1; /* always quantized */
  	display_zoomscale = (int)(display_zoomscale*10.0+0.01);
  	display_zoomscale /= 10.0;
!     } else
  	display_zoomscale = (int)display_zoomscale + 1.0;
      /* use zoom_sw instead of one passed to us because we might have come
         here from an accelerator */
      show_zoom(zoom_sw);
--- 3236,3252 ----
  	    display_zoomscale += 0.1; /* always quantized */
  	display_zoomscale = (int)(display_zoomscale*10.0+0.01);
  	display_zoomscale /= 10.0;
!     } else {
  	display_zoomscale = (int)display_zoomscale + 1.0;
+     }
+ 
+ #ifdef WHEELMOUSE  /* T.Sato, 2000/5/5 */
+     if (centering) {
+       zoomxoff += hot_x - BACKX2(x1);
+       zoomyoff += hot_y - BACKY2(y1);
+     }
+ #endif  /* WHEELMOUSE */
+ 
      /* use zoom_sw instead of one passed to us because we might have come
         here from an accelerator */
      show_zoom(zoom_sw);
***************
*** 3218,3231 ****
--- 3256,3288 ----
  dec_zoom(sw)
      ind_sw_info	   *sw;
  {
+ #ifdef WHEELMOUSE  /* T.Sato, 2000/5/5 */
+     Window root, child;
+     int x1, y1, junk;
+     int hot_x, hot_y;
+     Boolean centering;
+ #endif  /* WHEELMOUSE */
+ 
      /* don't allow zooming while previewing */
      if (preview_in_progress || check_action_on())
  	return;
      
+ #ifdef WHEELMOUSE  /* T.Sato, 2000/5/5 */
+     XQueryPointer(XtDisplay(canvas_sw), XtWindow(canvas_sw),
+ 		  &root, &child, &junk, &junk, &x1, &y1, &junk);
+     centering = False;
+     if (0 <= x1 && x1 <= CANVAS_WD && 0 <= y1 && y1 <= CANVAS_HT) {
+ 	centering = True;
+ 	hot_x = BACKX2(x1);
+ 	hot_y = BACKY2(y1);
+     }
+ #endif  /* WHEELMOUSE */
+ 
  	/* RER: It was a mistake to make these float instead of double... */
      if (display_zoomscale <= (float) 0.1) {
  	display_zoomscale = ((int)(display_zoomscale * 100.0 + 0.1)) - 1.0;
  	display_zoomscale /= 100.0;
+ 	if (display_zoomscale <= 0.01) display_zoomscale = 0.01;
      } else if (display_zoomscale < (float) 0.3) {
  	display_zoomscale = 0.1; /* always quantized */
      } else if (display_zoomscale <= (float) 1.0) {
***************
*** 3240,3245 ****
--- 3297,3310 ----
  	if (display_zoomscale < (float) 1.0)
  		display_zoomscale = 1.0;
      }
+ 
+ #ifdef WHEELMOUSE  /* T.Sato, 2000/5/5 */
+     if (centering) {
+       zoomxoff += hot_x - BACKX2(x1);
+       zoomyoff += hot_y - BACKY2(y1);
+     }
+ #endif  /* WHEELMOUSE */
+ 
      /* use zoom_sw instead of one passed to us because we might have come
         here from an accelerator */
      show_zoom(zoom_sw);
diff -c ../xfig.3.2.3a/w_modepanel.c ./w_modepanel.c
*** ../xfig.3.2.3a/w_modepanel.c	Thu Jan 20 10:47:35 2000
--- ./w_modepanel.c	Fri May  5 11:17:25 2000
***************
*** 29,34 ****
--- 29,35 ----
  #include "w_indpanel.h"
  #include "w_mousefun.h"
  #include "w_msgpanel.h"
+ #include "w_modepanel.h"
  #include "w_setup.h"
  #include "w_util.h"
  #include "d_spline.h"
***************
*** 112,130 ****
  
  /**************	    local variables and routines   **************/
  
- #define MAX_MODEMSG_LEN 80
- typedef struct mode_switch_struct {
-     icon_struct	   *icon;
-     int		    mode;
-     void	    (*setmode_func) ();
-     int		    objmask;
-     unsigned long   indmask;		/* mask to display indicators for this func */
-     char	    modemsg[MAX_MODEMSG_LEN];
-     Boolean	    popup;		/* true for commands that popup something */
-     Widget	    widget;
-     Pixmap	    pixmap, reversePM;
- }               mode_sw_info;
- 
  DeclareStaticArgs(13);
  /* pointer to current mode switch */
  static mode_sw_info *current = NULL;
--- 113,118 ----
***************
*** 147,153 ****
     cases, the LeaveWindow event never happens on that button so the balloon popup
     would never be destroyed in that case.  */
  
! static mode_sw_info mode_switches[] = {
  
      /* DRAWING MODES */
  
--- 135,141 ----
     cases, the LeaveWindow event never happens on that button so the balloon popup
     would never be destroyed in that case.  */
  
! mode_sw_info mode_switches[] = {
  
      /* DRAWING MODES */
  
***************
*** 302,310 ****
         I_ADD_DEL_ARROW,
         "ADD/DELETE ARROWHEADS   (Shift-a)",
         False},
  };
  
! int	NUM_MODE_SW = (sizeof(mode_switches) / sizeof(mode_sw_info));
  
  static Arg      button_args[] =
  {
--- 290,299 ----
         I_ADD_DEL_ARROW,
         "ADD/DELETE ARROWHEADS   (Shift-a)",
         False},
+     { NULL, 0 }
  };
  
! int	NUM_MODE_SW = (sizeof(mode_switches) / sizeof(mode_sw_info)) - 1;
  
  static Arg      button_args[] =
  {
diff -c ../xfig.3.2.3a/w_modepanel.h ./w_modepanel.h
*** ../xfig.3.2.3a/w_modepanel.h	Tue Jan  4 03:09:40 2000
--- ./w_modepanel.h	Fri May  5 11:26:26 2000
***************
*** 19,21 ****
--- 19,38 ----
  extern void	force_nopositioning();
  extern void	force_anglegeom();
  extern void	force_noanglegeom();
+ 
+ 
+ #include "w_icons.h"
+ 
+ #define MAX_MODEMSG_LEN 80
+ typedef struct mode_switch_struct {
+     icon_struct	   *icon;
+     int		    mode;
+     void	    (*setmode_func) ();
+     int		    objmask;
+     unsigned long   indmask;		/* mask to display indicators for this func */
+     char	    modemsg[MAX_MODEMSG_LEN];
+     Boolean	    popup;		/* true for commands that popup something */
+     Widget	    widget;
+     Pixmap	    pixmap, reversePM;
+ }               mode_sw_info;
+ 
diff -c ../xfig.3.2.3a/w_rulers.c ./w_rulers.c
*** ../xfig.3.2.3a/w_rulers.c	Thu Jan 20 10:47:35 2000
--- ./w_rulers.c	Fri May  5 11:25:59 2000
***************
*** 680,685 ****
--- 680,691 ----
  {
      XButtonEvent   *be = (XButtonEvent *) event;
  
+ #ifdef WHEELMOUSE  /* T.Sato, 2000/5/4 */
+     switch (be->button) {
+     case Button4: be->button = Button1; break;
+     case Button5: be->button = Button3; break;
+     }
+ #endif
      switch (event->type) {
      case ButtonPress:
  	if (be->button == Button3 && be->state & Mod1Mask) {
***************
*** 1061,1066 ****
--- 1067,1078 ----
  {
      XButtonEvent   *be = (XButtonEvent *) event;
  
+ #ifdef WHEELMOUSE  /* T.Sato, 2000/5/4 */
+     switch (be->button) {
+     case Button4: be->button = Button1; break;
+     case Button5: be->button = Button3; break;
+     }
+ #endif
      switch (event->type) {
      case ButtonPress:
  	if (be->button == Button3 && be->state & Mod1Mask) {
diff -c ../xfig.3.2.3a/w_util.c ./w_util.c
*** ../xfig.3.2.3a/w_util.c	Thu Jan 20 10:47:35 2000
--- ./w_util.c	Fri May  5 11:25:34 2000
***************
*** 1518,1520 ****
--- 1518,1542 ----
      *exact = *color;
      return XAllocColor(tool_d,tool_cm,color);
  }
+ 
+ 
+ #ifdef WHEELMOUSE  /* T.Sato, 2000/5/4 */
+ 
+ spinner_up_down(w, ev, params, num_params)
+     Widget          w;
+     XButtonEvent   *ev;
+     String	   *params;
+     Cardinal	   *num_params;
+ {
+   w = XtParent(w);
+   if (params[0][0] == '+') w = XtNameToWidget(w, "*spinup");
+   else w = XtNameToWidget(w, "*spindown");
+   if (w == None) {
+     fprintf(stderr, "spinner_up_down() is called for wrong widget\n");
+   } else {
+     ev->window = XtWindow(w);
+     XSendEvent(ev->display, ev->window, TRUE, ButtonPressMask, (XEvent *)ev);
+   }
+ }
+ 
+ #endif  /* WHEELMOUSE */
