diff options
author | Dejan Lesjak <lesi@FreeBSD.org> | 2005-08-31 23:09:59 +0000 |
---|---|---|
committer | Dejan Lesjak <lesi@FreeBSD.org> | 2005-08-31 23:09:59 +0000 |
commit | 3654a4e3aaeee32d04908e15ec447d3c4a29da53 (patch) | |
tree | 24289075ceef8753b0c6018d332d78643d3ade9e /graphics | |
parent | o Fix PLIST (diff) |
Fix crashes with Xaw3d 1.5E.
Merge changes in patch-aa with patch-Imakefile.
Obtained from: Xaw3d homepage (http://www.visi.com/~hawkeyd/xaw3d.html)
Notes
Notes:
svn path=/head/; revision=141651
Diffstat (limited to 'graphics')
22 files changed, 2212 insertions, 14 deletions
diff --git a/graphics/xfig-devel/Makefile b/graphics/xfig-devel/Makefile index ce3fb590caa0..68146ae332eb 100644 --- a/graphics/xfig-devel/Makefile +++ b/graphics/xfig-devel/Makefile @@ -7,7 +7,7 @@ PORTNAME= xfig PORTVERSION= 3.2.4 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= graphics MASTER_SITES= http://www.xfig.org/xfigdist/ \ ftp://www-epb.lbl.gov/xfig/%SUBDIR%/ diff --git a/graphics/xfig-devel/files/patch-aa b/graphics/xfig-devel/files/patch-Imakefile index 1109ba739b18..a35284a2fa8f 100644 --- a/graphics/xfig-devel/files/patch-aa +++ b/graphics/xfig-devel/files/patch-Imakefile @@ -1,5 +1,5 @@ --- Imakefile.orig Thu Dec 19 18:57:11 2002 -+++ Imakefile Wed Jul 23 16:27:24 2003 ++++ Imakefile Wed Aug 31 09:58:41 2005 @@ -48,8 +48,8 @@ XCOMM Redefine the following if your PNG library and/or include file XCOMM are in different places @@ -38,7 +38,7 @@ #endif XCOMM Uncomment the following definiton if you want to use the small icons -@@ -105,17 +105,17 @@ +@@ -105,17 +105,20 @@ XCOMM Then be sure to change the XAW3DINC to point to the directory where your XCOMM 3D Athena widget headers are located @@ -50,6 +50,9 @@ +XAW3DINC = -I$(INCDIR)/X11/Xaw3d DUSEXAW3D = -DXAW3D XAWLIB = -lXaw3d ++#else ++XAW_SRC = w_menuentry.c SmeCascade.c SmeBSB.c SimpleMenu.c ++XAW_OBJ = w_menuentry.o SmeCascade.o SmeBSB.o SimpleMenu.o #endif XCOMM Uncomment the following if you have a wheel mouse. See docs for description. @@ -59,7 +62,7 @@ #ifdef WHEELMOUSE DUSEWHEELMOUSE = -DWHEELMOUSE -@@ -154,7 +154,7 @@ +@@ -154,7 +157,7 @@ XCOMM inline functions. With the "INLINE" keyword, you should notice that XCOMM the display will be a bit faster in complex figures @@ -68,7 +71,7 @@ XCOMM use (and change) the following if you want the multi-key data base file XCOMM somewhere other than the standard X11 library directory -@@ -166,7 +166,7 @@ +@@ -166,7 +169,7 @@ XCOMM XFIGDOCDIR tells where the html and pdf documentation should go XCOMM XFIGDOCDIR = $(DOCDIR)/xfig @@ -77,7 +80,7 @@ XCOMM MANDIR tells where the standard man pages should go (no need to change it XCOMM if you want the man pages installed in the standard place on your system -@@ -234,7 +234,7 @@ +@@ -234,7 +237,7 @@ #endif /* USEJPEG */ #ifdef I18N @@ -86,7 +89,7 @@ I18N_SRC = w_i18n.c I18N_OBJ = w_i18n.o #endif -@@ -251,11 +251,13 @@ +@@ -251,11 +254,13 @@ $(HAVE_NO_STRCASECMP) \ $(NEED_STRERROR) @@ -100,3 +103,48 @@ #ifdef USESMALLICONS DUSESMALLICONS = -DUSE_SMALL_ICONS +@@ -299,12 +304,12 @@ + u_elastic.c u_error.c u_fonts.c u_free.c u_geom.c \ + u_list.c u_markers.c u_pan.c u_print.c u_redraw.c u_scale.c u_search.c \ + u_smartsearch.c u_translate.c u_undo.c w_digitize.c w_listwidget.c \ +- w_browse.c w_capture.c w_srchrepl.c w_help.c w_layers.c w_menuentry.c \ ++ w_browse.c w_capture.c w_srchrepl.c w_help.c w_layers.c \ + w_canvas.c w_cmdpanel.c w_color.c w_cursor.c w_dir.c w_drawprim.c \ + w_export.c w_file.c w_fontbits.c w_fontpanel.c w_grid.c w_icons.c \ + w_indpanel.c w_library.c w_modepanel.c w_mousefun.c w_msgpanel.c \ + w_print.c w_rottext.c w_rulers.c w_setup.c w_style.c w_util.c w_zoom.c \ +- $(I18N_SRC) SmeCascade.c SmeBSB.c SimpleMenu.c ++ $(I18N_SRC) $(XAW_SRC) + + XFIGOBJ = d_arc.o d_arcbox.o d_box.o d_ellipse.o d_picobj.o \ + d_subspline.o d_line.o d_regpoly.o d_spline.o d_text.o \ +@@ -321,12 +326,12 @@ + u_elastic.o u_error.o u_fonts.o u_free.o u_geom.o \ + u_list.o u_markers.o u_pan.o u_print.o u_redraw.o u_scale.o u_search.o \ + u_smartsearch.o u_translate.o u_undo.o w_digitize.o w_listwidget.o \ +- w_browse.o w_capture.o w_srchrepl.o w_help.o w_layers.o w_menuentry.o \ ++ w_browse.o w_capture.o w_srchrepl.o w_help.o w_layers.o \ + w_canvas.o w_cmdpanel.o w_color.o w_cursor.o w_dir.o w_drawprim.o \ + w_export.o w_file.o w_fontbits.o w_fontpanel.o w_grid.o w_icons.o \ + w_indpanel.o w_library.o w_modepanel.o w_mousefun.o w_msgpanel.o \ + w_print.o w_rottext.o w_rulers.o w_setup.o w_style.o w_util.o w_zoom.o \ +- $(I18N_OBJ) SmeCascade.o SmeBSB.o SimpleMenu.o ++ $(I18N_OBJ) $(XAW_OBJ) + + XCOMM Other dependencies should be handled by "make depend" + +@@ -541,11 +546,13 @@ + SpecialObjectRule(w_grid.o, w_grid.c mode.h, ) + SpecialObjectRule(w_indpanel.o, w_indpanel.c mode.h w_indpanel.h object.h, ) + SpecialObjectRule(w_library.o, w_library.c mode.h, ) +-SpecialObjectRule(w_menuentry.o, w_menuentry.c w_menuentry.h w_menuentryP.h, ) + SpecialObjectRule(w_modepanel.o, w_modepanel.c mode.h w_indpanel.h w_icons.h object.h, $(DUSESMALLICONS)) + SpecialObjectRule(w_msgpanel.o, w_msgpanel.c mode.h, ) + SpecialObjectRule(w_rulers.o, w_rulers.c mode.h, ) + SpecialObjectRule(w_zoom.o, w_zoom.c mode.h, ) ++#ifndef XAW3D ++SpecialObjectRule(w_menuentry.o, w_menuentry.c w_menuentry.h w_menuentryP.h, ) ++#endif + + #ifdef USEJPEG + #ifndef USEINSTALLEDJPEG diff --git a/graphics/xfig-devel/files/patch-figx.h b/graphics/xfig-devel/files/patch-figx.h new file mode 100644 index 000000000000..5591d2ae6afc --- /dev/null +++ b/graphics/xfig-devel/files/patch-figx.h @@ -0,0 +1,10 @@ +--- figx.h.orig Fri Sep 20 23:00:53 2002 ++++ figx.h Wed Aug 31 09:49:42 2005 +@@ -36,6 +36,7 @@ + #include <X11/Xaw3d/SmeBSB.h> + #include <X11/Xaw3d/Sme.h> + #include <X11/Xaw3d/SmeLine.h> ++#include <X11/Xaw3d/Tip.h> + #include <X11/Xaw3d/Toggle.h> + #include <X11/Xaw3d/Paned.h> + #include <X11/Xaw3d/Viewport.h> diff --git a/graphics/xfig-devel/files/patch-w_cmdpanel.c b/graphics/xfig-devel/files/patch-w_cmdpanel.c new file mode 100644 index 000000000000..bc6cadc8a7fe --- /dev/null +++ b/graphics/xfig-devel/files/patch-w_cmdpanel.c @@ -0,0 +1,283 @@ +--- w_cmdpanel.c.orig Thu Dec 19 18:51:19 2002 ++++ w_cmdpanel.c Wed Aug 31 09:49:42 2005 +@@ -37,7 +37,6 @@ + #include "w_icons.h" + #include "w_indpanel.h" + #include "w_layers.h" +-#include "w_menuentry.h" + #include "w_msgpanel.h" + #include "w_mousefun.h" + #include "w_print.h" +@@ -46,6 +45,9 @@ + #include "w_setup.h" + #include "w_style.h" + #include "w_zoom.h" ++#ifndef XAW3D ++#include "w_menuentry.h" ++#endif + #ifdef I18N + #include "d_text.h" + #endif /* I18N */ +@@ -59,6 +61,15 @@ + Widget global_popup = 0; + Widget global_panel; + ++#define menu_item_bitmap_width 9 ++#define menu_item_bitmap_height 8 ++static unsigned char menu_item_bitmap_bits[] = { ++ 0x00, 0x01, 0x80, 0x01, 0xc0, 0x00, 0x60, 0x00, ++ 0x31, 0x00, 0x1b, 0x00, 0x0e, 0x00, 0x04, 0x00 ++}; ++ ++static Pixmap menu_item_bitmap = None; ++ + /* Widgets holding the ascii values for the string-based settings */ + + Widget bal_delay; +@@ -90,6 +101,13 @@ + static int off_paste_x,off_paste_y; + static int orig_paste_x,orig_paste_y; + ++#ifdef XAW3D ++extern update_indpanel(); ++extern update_modepanel(); ++extern update_layerpanel(); ++extern update_mousepanel(); ++extern update_rulerpanel(); ++#else + /* popup message over command button when mouse enters it */ + static void cmd_balloon_trigger(); + static void cmd_unballoon(); +@@ -97,6 +115,7 @@ + /* popup message over filename window when mouse enters it */ + static void filename_balloon_trigger(); + static void filename_unballoon(); ++#endif + + String global_translations = + "<Message>WM_PROTOCOLS: DismissGlobal()\n"; +@@ -143,29 +162,28 @@ + {NULL, 0, NULL}, + }; + +-#define PAGE_BRD_MSG "page borders (Meta-B)" ++#define PAGE_BRD_MSG "page borders (Meta-B)" + #define DPTH_MGR_MSG "depth manager" +-#define INFO_BAL_MSG "info balloons (Meta-Y)" +-#define LINE_LEN_MSG "line lengths (Meta-L)" +-#define VRTX_NUM_MSG "vertex numbers " ++#define INFO_BAL_MSG "info balloons (Meta-Y)" ++#define LINE_LEN_MSG "line lengths (Meta-L)" ++#define VRTX_NUM_MSG "vertex numbers" + + menu_def view_menu_items[] = { +- {"Manage Styles... (Ctrl-Y)", 7, popup_manage_style_panel}, +- {"Redraw (Ctrl-L)", 0, redisplay_canvas}, +- {"Portrait/Landscape (Meta-C)", 3, change_orient}, +- {"Zoom In (Shift-Z)", 5, inc_zoom}, +- {"Zoom Out (z)", 5, dec_zoom}, +- {"Zoom to Fit canvas (Ctrl-Z)", 8, fit_zoom}, +- {"Unzoom", 0, unzoom}, +- {"Pan to origin", 0, pan_origin}, +- {"-", 0, NULL}, /* make a dividing line */ ++ {"Manage Styles... (Ctrl-Y)", 7, popup_manage_style_panel}, ++ {"Redraw (Ctrl-L)", 0, redisplay_canvas}, ++ {"Portrait/Landscape (Meta-C)", 3, change_orient}, ++ {"Zoom In (Shift-Z)", 5, inc_zoom}, ++ {"Zoom Out (z)", 5, dec_zoom}, ++ {"Zoom to Fit canvas (Ctrl-Z)", 8, fit_zoom}, ++ {"Unzoom", 0, unzoom}, ++ {"Pan to origin", 0, pan_origin}, ++ {"-", 0, NULL}, /* make a dividing line */ + /* the following menu labels will be refreshed in refresh_view_menu() */ +- /* 2 must be added to the underline value because of the "* " preceding the text */ +- {PAGE_BRD_MSG, 12, toggle_show_borders}, +- {DPTH_MGR_MSG, 7, toggle_show_depths}, +- {INFO_BAL_MSG, 8, toggle_show_balloons}, +- {LINE_LEN_MSG, 12, toggle_show_lengths}, +- {VRTX_NUM_MSG, 7, toggle_show_vertexnums}, ++ {PAGE_BRD_MSG, 10, toggle_show_borders}, ++ {DPTH_MGR_MSG, 5, toggle_show_depths}, ++ {INFO_BAL_MSG, 6, toggle_show_balloons}, ++ {LINE_LEN_MSG, 5, toggle_show_lengths}, ++ {VRTX_NUM_MSG, 5, toggle_show_vertexnums}, + {NULL, 0, NULL}, + }; + +@@ -241,11 +259,13 @@ + NextArg(XtNborderWidth, INTERNAL_BW); + name_panel = XtCreateManagedWidget("file_name", labelWidgetClass, tool, + Args, ArgCount); ++#ifndef XAW3D + /* popup balloon when mouse passes over filename */ + XtAddEventHandler(name_panel, EnterWindowMask, False, + filename_balloon_trigger, (XtPointer) name_panel); + XtAddEventHandler(name_panel, LeaveWindowMask, False, + filename_unballoon, (XtPointer) name_panel); ++#endif + /* add actions to position the menus if the user uses an accelerator */ + XtAppAddActions(tool_app, menu_actions, XtNumber(menu_actions)); + refresh_view_menu(); +@@ -276,12 +296,14 @@ + + /* now the menu itself */ + menu->menuwidget = create_menu_item(menu); +- ++ ++#ifndef XAW3D + /* popup when mouse passes over button */ + XtAddEventHandler(menu->widget, EnterWindowMask, False, + cmd_balloon_trigger, (XtPointer) menu); + XtAddEventHandler(menu->widget, LeaveWindowMask, False, + cmd_unballoon, (XtPointer) menu); ++#endif + + return menu->widget; + } +@@ -304,7 +326,11 @@ + sprintf(id, "%1d", j + 1); + FirstArg(XtNvertSpace, 10); + NextArg(XtNunderline, 0); /* underline # digit */ ++#ifndef XAW3D + entry = XtCreateWidget(id, figSmeBSBObjectClass, menu, Args, ArgCount); ++#else ++ entry = XtCreateWidget(id, smeBSBObjectClass, menu, Args, ArgCount); ++#endif + XtAddCallback(entry, XtNcallback, load_recent_file, (XtPointer) my_strdup(id)); + if (j < max_recent_files) + XtManageChild(entry); +@@ -354,8 +380,13 @@ + /* normal menu entry */ + FirstArg(XtNvertSpace, 10); + NextArg(XtNunderline, menup->menu[i].u_line); /* any underline */ ++#ifndef XAW3D + entry = XtCreateManagedWidget(menup->menu[i].name, figSmeBSBObjectClass, + menu, Args, ArgCount); ++#else ++ entry = XtCreateManagedWidget(menup->menu[i].name, smeBSBObjectClass, ++ menu, Args, ArgCount); ++#endif + XtAddCallback(entry, XtNcallback, menup->menu[i].func, + (XtPointer) menup->widget); + } +@@ -381,6 +412,7 @@ + } + } + ++#ifndef XAW3D + /* come here when the mouse passes over a button in the command panel */ + + static Widget cmd_balloon_popup = (Widget) 0; +@@ -466,6 +498,7 @@ + cmd_balloon_popup = (Widget) 0; + } + } ++#endif + + static void + enter_cmd_but(widget, closure, event, continue_to_dispatch) +@@ -1229,7 +1262,7 @@ + strcpy(cur_pdfviewer, panel_get_value(pdfview)); + + XtPopdown(global_popup); +- ++ + refresh_view_menu(); + } + +@@ -1242,6 +1275,7 @@ + global_popup = (Widget) 0; + } + ++#ifndef XAW3D + /* come here when the mouse passes over the filename window */ + + static Widget filename_balloon_popup = (Widget) 0; +@@ -1313,6 +1347,7 @@ + filename_balloon_popup = (Widget) 0; + } + } ++#endif + + /* + * Update the current filename in the name_panel widget, and the xfig icon. +@@ -1459,6 +1494,7 @@ + Boolean state; + { + Widget menu, w; ++ Pixmap bitmap; + char name[60]; + DeclareStaticArgs(10); + +@@ -1471,25 +1507,36 @@ + if (w == NULL) { + fprintf(stderr, "xfig: can't find \"viewmenu%s\"\n", name); + } else { +- if (state) +- sprintf(name, "Don't show %s", label); +- else +- sprintf(name, "Show %s", label); +- if (state) +- sprintf(name, "* Show %s", label); +- else +- sprintf(name, " Show %s", label); ++ sprintf(name, "Show %s", label); + FirstArg(XtNlabel, name); ++ if (state) { ++ if (menu_item_bitmap == None) ++ menu_item_bitmap = XCreateBitmapFromData(XtDisplay(menu), ++ RootWindowOfScreen(XtScreen(menu)), ++ (char *)menu_item_bitmap_bits, ++ menu_item_bitmap_width, ++ menu_item_bitmap_height); ++ bitmap = menu_item_bitmap; ++ } else ++ bitmap = None; ++ NextArg(XtNleftBitmap, bitmap); ++ NextArg(XtNleftMargin, menu_item_bitmap_width + 4); + SetValues(w); + } + } + } + +-/* update the menu entries with or without an asterisk */ ++/* update the menu entries with or without a checkmark, ++ and set or clear all Tip widgets */ + + void + refresh_view_menu() + { ++#ifdef XAW3D ++ int i; ++ register main_menu_info *menu; ++#endif ++ + /* turn off Compose key LED */ + setCompLED(0); + +@@ -1498,4 +1545,25 @@ + refresh_view_menu_item(INFO_BAL_MSG, appres.showballoons); + refresh_view_menu_item(LINE_LEN_MSG, appres.showlengths); + refresh_view_menu_item(VRTX_NUM_MSG, appres.shownums); ++ ++#ifdef XAW3D ++ if (appres.showballoons) { ++ XawTipEnable(name_panel, "Current filename"); ++ for (i = 0; i < NUM_CMD_MENUS; ++i) { ++ menu = &main_menus[i]; ++ XawTipEnable(menu->widget, menu->hint); ++ } ++ } else { ++ XawTipDisable(name_panel); ++ for (i = 0; i < NUM_CMD_MENUS; ++i) { ++ menu = &main_menus[i]; ++ XawTipDisable(menu->widget); ++ } ++ } ++ update_indpanel(cur_indmask); ++ update_modepanel(); ++ update_layerpanel(); ++ update_mousepanel(); ++ update_rulerpanel(); ++#endif + } diff --git a/graphics/xfig-devel/files/patch-w_indpanel.c b/graphics/xfig-devel/files/patch-w_indpanel.c new file mode 100644 index 000000000000..4be94f44b745 --- /dev/null +++ b/graphics/xfig-devel/files/patch-w_indpanel.c @@ -0,0 +1,194 @@ +--- w_indpanel.c.orig Sat Oct 19 01:05:41 2002 ++++ w_indpanel.c Wed Aug 31 09:49:42 2005 +@@ -60,9 +60,11 @@ + + #define MAX_ARROWSIZE 3 /* maximum value for cur_arrowsizeshown */ + ++#ifndef XAW3D + /* popup message over button when mouse enters it */ + static void ind_balloon_trigger(); + static void ind_unballoon(); ++#endif + + /***** value panel set translations *****/ + static String set_translations = +@@ -471,7 +473,7 @@ + 0x3f, 0x02, 0x7f, 0x02, 0xff, 0x02, 0xff, 0x03}; + + /* create a ind_sw_info struct for the update widget +- so we can use the balloon routines */ ++ so we can use the balloon routines or the Tip widget */ + + static ind_sw_info upd_sw_info, upd_set_sw_info, upd_clr_sw_info, upd_tog_sw_info; + +@@ -506,10 +508,12 @@ + strcpy(upd_sw_info.line1,"Selects which settings are updated"); + upd_sw_info.line2[0] = '\0'; + upd_sw_info.sw_width = 70; /* rough guess */ ++#ifndef XAW3D + XtAddEventHandler(upd_ctrl, EnterWindowMask, False, + ind_balloon_trigger, (XtPointer) &upd_sw_info); + XtAddEventHandler(upd_ctrl, LeaveWindowMask, False, + ind_unballoon, (XtPointer) &upd_sw_info); ++#endif + + FirstArg(XtNborderWidth, 0); + NextArg(XtNjustify, XtJustifyCenter); +@@ -518,11 +522,12 @@ + NextArg(XtNinternalHeight, 0); + upd_ctrl_lab = XtCreateManagedWidget("upd_ctrl_label", labelWidgetClass, + upd_ctrl, Args, ArgCount); +- ++#ifndef XAW3D + XtAddEventHandler(upd_ctrl_lab, EnterWindowMask, False, + ind_balloon_trigger, (XtPointer) &upd_sw_info); + XtAddEventHandler(upd_ctrl_lab, LeaveWindowMask, False, + ind_unballoon, (XtPointer) &upd_sw_info); ++#endif + + FirstArg(XtNdefaultDistance, 0); + NextArg(XtNborderWidth, 0); +@@ -545,10 +550,12 @@ + strcpy(upd_set_sw_info.line1,"Sets all update flags"); + upd_set_sw_info.line2[0] = '\0'; + upd_set_sw_info.sw_width = UPD_BITS+6; ++#ifndef XAW3D + XtAddEventHandler(set_upd, EnterWindowMask, False, + ind_balloon_trigger, (XtPointer) &upd_set_sw_info); + XtAddEventHandler(set_upd, LeaveWindowMask, False, + ind_unballoon, (XtPointer) &upd_set_sw_info); ++#endif + + clr_upd = XtCreateManagedWidget("clr_upd", commandWidgetClass, + upd_ctrl_btns, Args, ArgCount); +@@ -558,10 +565,12 @@ + strcpy(upd_clr_sw_info.line1,"Clears all update flags"); + upd_clr_sw_info.line2[0] = '\0'; + upd_clr_sw_info.sw_width = UPD_BITS+6; ++#ifndef XAW3D + XtAddEventHandler(clr_upd, EnterWindowMask, False, + ind_balloon_trigger, (XtPointer) &upd_clr_sw_info); + XtAddEventHandler(clr_upd, LeaveWindowMask, False, + ind_unballoon, (XtPointer) &upd_clr_sw_info); ++#endif + + tog_upd = XtCreateManagedWidget("tog_upd", commandWidgetClass, + upd_ctrl_btns, Args, ArgCount); +@@ -571,10 +580,12 @@ + strcpy(upd_tog_sw_info.line1,"Toggles all update flags"); + upd_tog_sw_info.line2[0] = '\0'; + upd_tog_sw_info.sw_width = UPD_BITS+6; ++#ifndef XAW3D + XtAddEventHandler(tog_upd, EnterWindowMask, False, + ind_balloon_trigger, (XtPointer) &upd_tog_sw_info); + XtAddEventHandler(tog_upd, LeaveWindowMask, False, + ind_unballoon, (XtPointer) &upd_tog_sw_info); ++#endif + + /* start with all components affected by update */ + cur_updatemask = I_UPDATEMASK; +@@ -669,11 +680,13 @@ + /* (callbacks pass same data for ANY button) */ + XtAddEventHandler(sw->button, ButtonReleaseMask, False, + sel_ind_but, (XtPointer) sw); ++#ifndef XAW3D + /* popup when mouse passes over button */ + XtAddEventHandler(sw->button, EnterWindowMask, False, + ind_balloon_trigger, (XtPointer) sw); + XtAddEventHandler(sw->button, LeaveWindowMask, False, + ind_unballoon, (XtPointer) sw); ++#endif + XtOverrideTranslations(sw->button, + XtParseTranslationTable(ind_translations)); + } +@@ -898,6 +911,7 @@ + + } + ++#ifndef XAW3D + /* come here when the mouse passes over a button in the indicator panel */ + + static Widget ind_balloon_popup = (Widget) 0; +@@ -980,6 +994,7 @@ + ind_balloon_popup = (Widget) 0; + } + } ++#endif + + generate_choice_pixmaps(isw) + ind_sw_info *isw; +@@ -1002,13 +1017,62 @@ + update_indpanel(mask) + unsigned long mask; + { ++#ifdef XAW3D ++ char msg[60]; ++#endif + register int i; + register ind_sw_info *isw; + ++ /* ++ * We must test for the widgets, as this is called by ++ * w_cmdpanel.c:refresh_view_menu(). ++ */ ++ ++#ifdef XAW3D ++ if (upd_ctrl) ++ if (appres.showballoons) ++ XawTipEnable(upd_ctrl, upd_sw_info.line1); ++ else ++ XawTipDisable(upd_ctrl); ++ if (upd_ctrl_lab) ++ if (appres.showballoons) ++ XawTipEnable(upd_ctrl_lab, upd_sw_info.line1); ++ else ++ XawTipDisable(upd_ctrl_lab); ++ if (set_upd) ++ if (appres.showballoons) ++ XawTipEnable(set_upd, upd_set_sw_info.line1); ++ else ++ XawTipDisable(set_upd); ++ if (clr_upd) ++ if (appres.showballoons) ++ XawTipEnable(clr_upd, upd_clr_sw_info.line1); ++ else ++ XawTipDisable(clr_upd); ++ if (tog_upd) ++ if (appres.showballoons) ++ XawTipEnable(tog_upd, upd_tog_sw_info.line1); ++ else ++ XawTipDisable(tog_upd); ++ for (isw = ind_switches, i = 0; i < NUM_IND_SW; isw++, i++) { ++ if (!isw->button) ++ continue; ++ if (appres.showballoons) { ++ sprintf(msg, "%s", isw->line1); ++ if (strlen(isw->line2)) ++ sprintf(msg + strlen(msg), " %s", isw->line2); ++ XawTipEnable(isw->button, msg); ++ } else ++ XawTipDisable(isw->button); ++ } ++#endif ++ + /* only update current mask if user wants to see relevant ind buttons */ + if (appres.ShowAllButtons) + return; + ++ if (!ind_box) ++ return; + cur_indmask = mask; + XtUnmanageChild(ind_box); + for (isw = ind_switches, i = 0; i < NUM_IND_SW; isw++, i++) { +@@ -1034,9 +1098,11 @@ + XButtonEvent xbutton; + ind_sw_info *isw = (ind_sw_info *) closure; + ++#ifndef XAW3D + /* since this command popups a window, destroy the balloon popup now. */ + ind_unballoon((Widget) 0, (XtPointer) 0, (XEvent*) 0, (Boolean*) 0); + app_flush(); ++#endif + + xbutton = event->xbutton; + #ifdef WHEELMOUSE diff --git a/graphics/xfig-devel/files/patch-w_layers.c b/graphics/xfig-devel/files/patch-w_layers.c new file mode 100644 index 000000000000..fa086e928150 --- /dev/null +++ b/graphics/xfig-devel/files/patch-w_layers.c @@ -0,0 +1,126 @@ +--- w_layers.c.orig Tue Nov 5 20:38:18 2002 ++++ w_layers.c Wed Aug 31 09:49:42 2005 +@@ -63,9 +63,11 @@ + static XtCallbackProc switch_layer_mode(); + static XtActionProc layer_exposed(); + ++#ifndef XAW3D + /* popup message over command button when mouse enters it */ + static void layer_balloon_trigger(); + static void layer_unballoon(); ++#endif + + static void draw_layer_button(); + static void draw_layer_buttons(); +@@ -144,11 +146,13 @@ + below = all_active_but = XtCreateManagedWidget("all_active", commandWidgetClass, + layer_form, Args, ArgCount); + XtAddCallback(below, XtNcallback, (XtCallbackProc)all_active, (XtPointer) NULL); ++#ifndef XAW3D + /* popup when mouse passes over button */ + XtAddEventHandler(below, EnterWindowMask, False, + layer_balloon_trigger, (XtPointer) "Display all depths"); + XtAddEventHandler(below, LeaveWindowMask, False, + layer_unballoon, (XtPointer) NULL); ++#endif + + FirstArg(XtNlabel, "All Off"); + NextArg(XtNfromVert, below); +@@ -159,11 +163,13 @@ + below = all_inactive_but = XtCreateManagedWidget("all_inactive", commandWidgetClass, + layer_form, Args, ArgCount); + XtAddCallback(below, XtNcallback, (XtCallbackProc)all_inactive, (XtPointer) NULL); ++#ifndef XAW3D + /* popup when mouse passes over button */ + XtAddEventHandler(below, EnterWindowMask, False, + layer_balloon_trigger, (XtPointer) "Hide all depths"); + XtAddEventHandler(below, LeaveWindowMask, False, + layer_unballoon, (XtPointer) NULL); ++#endif + + FirstArg(XtNlabel, "Toggle "); + NextArg(XtNfromVert, below); +@@ -174,11 +180,13 @@ + below = toggle_all_but = XtCreateManagedWidget("toggle_all", commandWidgetClass, + layer_form, Args, ArgCount); + XtAddCallback(below, XtNcallback, (XtCallbackProc)toggle_all, (XtPointer) NULL); ++#ifndef XAW3D + /* popup when mouse passes over button */ + XtAddEventHandler(below, EnterWindowMask, False, + layer_balloon_trigger, (XtPointer) "Toggle displayed/hidden depths"); + XtAddEventHandler(below, LeaveWindowMask, False, + layer_unballoon, (XtPointer) NULL); ++#endif + + /* radio buttons to switch between graying out inactive layers or blanking altogether */ + +@@ -286,12 +294,13 @@ + NextArg(XtNright, XtChainRight); + layer_viewp = XtCreateManagedWidget("layer_viewp", viewportWidgetClass, + layer_viewform, Args, ArgCount); ++#ifndef XAW3D + /* popup when mouse passes over button */ +- + XtAddEventHandler(layer_viewp, EnterWindowMask, False, + layer_balloon_trigger, (XtPointer) "Display or hide any depth"); + XtAddEventHandler(layer_viewp, LeaveWindowMask, False, + layer_unballoon, (XtPointer) NULL); ++#endif + XtAddEventHandler(layer_viewp, StructureNotifyMask, False, + update_layers, (XtPointer) NULL); + +@@ -321,6 +330,9 @@ + XtOverrideTranslations(layer_canvas, + XtParseTranslationTable(layer_translations)); + ++#ifdef XAW3D ++ update_layerpanel(); ++#endif + } + + /* now that the mouse function and indicator panels have been sized +@@ -728,6 +740,36 @@ + return False; + } + ++#ifdef XAW3D ++update_layerpanel() ++{ ++ /* ++ * We must test for the widgets, as this is called by ++ * w_cmdpanel.c:refresh_view_menu(). ++ */ ++ ++ if (all_active_but) ++ if (appres.showballoons) ++ XawTipEnable(all_active_but, "Display all depths"); ++ else ++ XawTipDisable(all_active_but); ++ if (all_inactive_but) ++ if (appres.showballoons) ++ XawTipEnable(all_inactive_but, "Hide all depths"); ++ else ++ XawTipDisable(all_inactive_but); ++ if (toggle_all_but) ++ if (appres.showballoons) ++ XawTipEnable(toggle_all_but, "Toggle displayed/hidden depths"); ++ else ++ XawTipDisable(toggle_all_but); ++ if (layer_viewp) ++ if (appres.showballoons) ++ XawTipEnable(layer_viewp, "Display or hide any depth"); ++ else ++ XawTipDisable(layer_viewp); ++} ++#else + static Widget layer_balloon_popup = (Widget) 0; + static XtIntervalId balloon_id = (XtIntervalId) 0; + static Widget balloon_w; +@@ -831,6 +873,7 @@ + layer_balloon_popup = (Widget) 0; + } + } ++#endif + + /* map/unmap the depth manager on the right side */ + diff --git a/graphics/xfig-devel/files/patch-w_library.c b/graphics/xfig-devel/files/patch-w_library.c new file mode 100644 index 000000000000..25f44a85b2ef --- /dev/null +++ b/graphics/xfig-devel/files/patch-w_library.c @@ -0,0 +1,151 @@ +--- w_library.c.orig Mon Nov 11 18:58:48 2002 ++++ w_library.c Wed Aug 31 09:49:42 2005 +@@ -40,7 +40,9 @@ + #include "w_setup.h" + #include "w_icons.h" + #include "w_zoom.h" ++#ifndef XAW3D + #include "SmeCascade.h" ++#endif + + #ifdef HAVE_NO_DIRENT + #include <sys/dir.h> +@@ -73,7 +75,10 @@ + static Widget library_popup=0; + static Widget put_cur_obj; + static Widget library_form, title; +-static Widget lib_obj_label, library_label, library_menu, library_menu_button; ++static Widget lib_obj_label, library_label, library_menu_button; ++#ifndef XAW3D ++static Widget library_menu; ++#endif + static Widget sel_view_button; + static Widget object_form; + static Widget icon_form, icon_viewport, icon_box; +@@ -272,8 +277,10 @@ + Dimension lwidth, lheight; + Dimension lawidth, laheight; + ++#ifndef XAW3D + /* pop down the menu */ + XtPopdown(library_menu); ++#endif + + /* if already in the middle of loading a library, return */ + if (loading_library) { +@@ -629,8 +636,8 @@ + menuButtonWidgetClass, + library_form, Args, ArgCount); + /* make the menu and attach it to the button */ +- (void) make_library_menu(library_menu_button, +- library_rec, num_library_names); ++ (void) make_library_menu(library_menu_button, "menu", ++ library_rec, num_library_names); + + if (!actions_added) { + XtAppAddActions(tool_app, library_actions, XtNumber(library_actions)); +@@ -1000,20 +1007,27 @@ + XtInstallAccelerators(library_form, cancel); + } + ++#ifndef XAW3D + extern void popdown_subs(); ++#endif + + static Widget +-make_library_menu(parent, librec, num) ++make_library_menu(parent, name, librec, num) + Widget parent; ++ char *name; + struct lib_rec *librec[]; + int num; + { +- Widget menu, entry, submenu; +- char name[200]; ++ Widget menu, entry; ++#ifndef XAW3D ++ Widget submenu; ++#endif ++ char menu_name[200]; + int i; + +- menu = XtCreatePopupShell("menu", simpleMenuWidgetClass, +- parent, NULL, ZERO); ++ menu = XtCreatePopupShell(name, simpleMenuWidgetClass, ++ parent, NULL, ZERO); ++#ifndef XAW3D + /* if this is the toplevel menu, add a callback to popdown any submenus if + the user releases the pointer button outside a submenu */ + if (XtIsSubclass(parent, menuButtonWidgetClass)) { +@@ -1021,29 +1035,54 @@ + library_menu = menu; + XtAddCallback(menu, XtNpopdownCallback, popdown_subs, (XtPointer) NULL); + } +- ++#endif ++ + for (i = 0; i < num; i++) { +- /* add one blank in front and after name to allow space for diamond and/or arrow */ +- sprintf(name," %s ",librec[i]->name); ++#ifndef XAW3D ++ sprintf(menu_name, " %s ", librec[i]->name); ++#else ++ sprintf(menu_name, "%sMenu", librec[i]->name); ++#endif + if (librec[i]->nsubs) { +- submenu = make_library_menu(menu, librec[i]->subdirs, +- librec[i]->nsubs); ++#ifndef XAW3D ++ submenu = make_library_menu(menu, menu_name, librec[i]->subdirs, ++ librec[i]->nsubs); + FirstArg(XtNsubMenu, submenu); +- NextArg(XtNrightBitmap, menu_cascade_arrow); /* use arrow to indicate cascade */ +- NextArg(XtNrightMargin, 9); /* room to the right of the arrow */ ++ NextArg(XtNrightMargin, 9); ++#else ++ FirstArg(XtNmenuName, XtNewString(menu_name)); ++#endif ++ NextArg(XtNrightBitmap, menu_cascade_arrow); + if (librec[i]->figs_at_top) { +- NextArg(XtNselectCascade, True); /* if there are fig files, make the */ +- NextArg(XtNleftBitmap, diamond_pixmap); /* cascade selectable and add a bitmap */ +- } /* in the left bitmap of the BSB */ +- entry = XtCreateManagedWidget(name, smeCascadeObjectClass, menu, +- Args, ArgCount); +- /* if there are fig files at this level, make the dir name selectable */ ++#ifndef XAW3D ++ NextArg(XtNselectCascade, True); ++#endif ++ NextArg(XtNleftBitmap, diamond_pixmap); ++ } ++#ifndef XAW3D ++ entry = XtCreateManagedWidget(menu_name, smeCascadeObjectClass, ++ menu, Args, ArgCount); ++#else ++ entry = XtCreateManagedWidget(librec[i]->name, smeBSBObjectClass, ++ menu, Args, ArgCount); ++#endif + if (librec[i]->figs_at_top) +- XtAddCallback(entry, XtNcallback, load_library, (XtPointer) librec[i]); ++ XtAddCallback(entry, XtNcallback, load_library, ++ (XtPointer) librec[i]); ++#ifdef XAW3D ++ (void) make_library_menu(menu, menu_name, librec[i]->subdirs, ++ librec[i]->nsubs); ++#endif + } else { +- entry = XtCreateManagedWidget(name, smeCascadeObjectClass, menu, +- NULL, ZERO); +- XtAddCallback(entry, XtNcallback, load_library, (XtPointer) librec[i]); ++#ifndef XAW3D ++ entry = XtCreateManagedWidget(menu_name, smeCascadeObjectClass, ++ menu, NULL, ZERO); ++#else ++ entry = XtCreateManagedWidget(librec[i]->name, smeBSBObjectClass, ++ menu, NULL, ZERO); ++#endif ++ XtAddCallback(entry, XtNcallback, load_library, ++ (XtPointer) librec[i]); + } + } + return menu; diff --git a/graphics/xfig-devel/files/patch-w_modepanel.c b/graphics/xfig-devel/files/patch-w_modepanel.c new file mode 100644 index 000000000000..43415e45fd9c --- /dev/null +++ b/graphics/xfig-devel/files/patch-w_modepanel.c @@ -0,0 +1,143 @@ +--- w_modepanel.c.orig Mon Sep 16 23:11:35 2002 ++++ w_modepanel.c Wed Aug 31 09:49:42 2005 +@@ -132,9 +132,11 @@ + /* button selection event handler */ + static void sel_mode_but(); + ++#ifndef XAW3D + /* popup message over button when mouse enters it */ + static void mode_balloon_trigger(); + static void mode_unballoon(); ++#endif + + /* popdown message */ + static void turn_on(); +@@ -414,14 +416,21 @@ + /* left button changes mode */ + XtAddEventHandler(sw->widget, ButtonPressMask, False, + sel_mode_but, (XtPointer) sw); ++#ifndef XAW3D + /* popup when mouse passes over button */ + XtAddEventHandler(sw->widget, EnterWindowMask, False, + mode_balloon_trigger, (XtPointer) sw); + XtAddEventHandler(sw->widget, LeaveWindowMask, False, + mode_unballoon, (XtPointer) sw); ++#endif + XtOverrideTranslations(sw->widget, + XtParseTranslationTable(mode_translations)); + } ++ ++#ifdef XAW3D ++ update_modepanel(); ++#endif ++ + return; + } + +@@ -467,6 +476,28 @@ + SetValues(mode_panel); + } + ++#ifdef XAW3D ++update_modepanel() ++{ ++ register int i; ++ register mode_sw_info *sw; ++ ++ /* ++ * We must test for the widgets, as this is called by ++ * w_cmdpanel.c:refresh_view_menu(). ++ */ ++ ++ for (i = 0; i < NUM_MODE_SW; ++i) { ++ sw = &mode_switches[i]; ++ if (!sw->widget) ++ continue; ++ if (appres.showballoons) { ++ XawTipEnable(sw->widget, sw->modemsg); ++ } else ++ XawTipDisable(sw->widget); ++ } ++} ++#else + /* come here when the mouse passes over a button in the mode panel */ + + static Widget mode_balloon_popup = (Widget) 0; +@@ -557,6 +588,7 @@ + mode_balloon_popup = (Widget) 0; + } + } ++#endif + + /* come here when a button is pressed in the mode panel */ + +@@ -585,45 +617,46 @@ + else if (highlighting) + erase_objecthighlight(); + ++#ifndef XAW3D + /* if this command popups a window, destroy the balloon popup now. See the + note above about this above the command panel definition. */ + if (msw->popup) { + mode_unballoon((Widget) 0, (XtPointer) 0, (XEvent*) 0, (Boolean*) 0); + } + app_flush(); ++#endif + + if (xbutton.button == Button1) { /* left button */ + turn_off_current(); + turn_on(msw); +- if (msw->mode == F_UPDATE) { /* map the set/clr/toggle button for update */ ++ ++ update_indpanel(0); /* first remove ind buttons */ ++ XtUnmanageChild(ind_panel); ++ if (msw->mode != F_UPDATE) ++ XtUnmanageChild(upd_ctrl); ++ FirstArg(XtNwidth, 1); /* force a resize to update scrollbar */ ++ SetValues(ind_panel); ++ if (msw->mode == F_UPDATE) { + if (cur_mode != F_UPDATE) { +- update_indpanel(0); /* first remove ind buttons */ +- XtUnmanageChild(ind_panel); ++ /* map the set/clr/toggle button for update */ + XtManageChild(upd_ctrl); +- /* get the width of the update control panel */ +- /* now put the ind_panel to our right */ +- FirstArg(XtNfromHoriz, upd_ctrl); +- NextArg(XtNwidth, INDPANEL_WD-UPD_CTRL_WD-2*INTERNAL_BW); /* resize it */ +- SetValues(ind_panel); +- XtManageChild(ind_panel); +- update_indpanel(msw->indmask); /* now manage the relevant buttons */ + } +- } else { /* turn off the update boxes if not in update mode */ +- if (cur_mode == F_UPDATE) { /* if previous mode is update and current */ +- update_indpanel(0); /* is not, first remove ind buttons */ ++ /* set the adjacent widget and width */ ++ FirstArg(XtNfromHoriz, upd_ctrl); ++ NextArg(XtNwidth, INDPANEL_WD-UPD_CTRL_WD-2*INTERNAL_BW); ++ } else { ++ if (cur_mode == F_UPDATE) { ++ /* unmap the set/clr/toggle button for update */ + unmanage_update_buts(); +- XtUnmanageChild(ind_panel); +- XtUnmanageChild(upd_ctrl); +- /* now put the ind_panel to the right of the canvas */ +- FirstArg(XtNfromHoriz, NULL); +- NextArg(XtNwidth, INDPANEL_WD); /* resize it */ +- SetValues(ind_panel); +- XtManageChild(ind_panel); +- update_indpanel(msw->indmask); /* now manage the relevant buttons */ +- } else { +- update_indpanel(msw->indmask); /* just update indicator buttons */ + } ++ /* clear the adjacent widget and set width */ ++ FirstArg(XtNfromHoriz, NULL); ++ NextArg(XtNwidth, INDPANEL_WD); + } ++ SetValues(ind_panel); ++ XtManageChild(ind_panel); ++ update_indpanel(msw->indmask); /* now manage the relevant buttons */ ++ + put_msg(msw->modemsg); + if ((cur_mode == F_GLUE || cur_mode == F_BREAK) && + msw->mode != F_GLUE && msw->mode != F_BREAK) { diff --git a/graphics/xfig-devel/files/patch-w_mousefun.c b/graphics/xfig-devel/files/patch-w_mousefun.c new file mode 100644 index 000000000000..b619fd08d062 --- /dev/null +++ b/graphics/xfig-devel/files/patch-w_mousefun.c @@ -0,0 +1,56 @@ +--- w_mousefun.c.orig Wed Mar 27 01:22:48 2002 ++++ w_mousefun.c Wed Aug 31 09:49:42 2005 +@@ -54,9 +54,11 @@ + static Pixmap mousefun_pm; + static Pixmap keybd_pm; + ++#ifndef XAW3D + /* popup message over button when mouse enters it */ + static void mouse_balloon_trigger(); + static void mouse_unballoon(); ++#endif + + void + init_mousefun(tool) +@@ -81,11 +83,15 @@ + + mousefun = XtCreateManagedWidget("mouse_panel", labelWidgetClass, + tool, Args, ArgCount); ++#ifdef XAW3D ++ update_mousepanel(); ++#else + /* popup when mouse passes over button */ + XtAddEventHandler(mousefun, EnterWindowMask, False, + mouse_balloon_trigger, (XtPointer) mousefun); + XtAddEventHandler(mousefun, LeaveWindowMask, False, + mouse_unballoon, (XtPointer) mousefun); ++#endif + } + + /* widgets are realized and windows exist at this point */ +@@ -105,6 +111,17 @@ + set_mousefun("", "", "", "", "", ""); + } + ++#ifdef XAW3D ++update_mousepanel() ++{ ++ if (mousefun) ++ if (appres.showballoons) ++ XawTipEnable(mousefun, ++ "Shows which mouse buttons\nare active in each mode"); ++ else ++ XawTipDisable(mousefun); ++} ++#else + /* come here when the mouse passes over a button in the mouse indicator panel */ + + static Widget mouse_balloon_popup = (Widget) 0; +@@ -184,6 +201,7 @@ + mouse_balloon_popup = (Widget) 0; + } + } ++#endif + + static void + reset_mousefun() diff --git a/graphics/xfig-devel/files/patch-w_rulers.c b/graphics/xfig-devel/files/patch-w_rulers.c new file mode 100644 index 000000000000..00259d857e04 --- /dev/null +++ b/graphics/xfig-devel/files/patch-w_rulers.c @@ -0,0 +1,69 @@ +--- w_rulers.c.orig Sat Oct 12 01:13:53 2002 ++++ w_rulers.c Wed Aug 31 09:49:42 2005 +@@ -117,9 +117,11 @@ + static void sideruler_selected(); + static void sideruler_exposed(); + ++#ifndef XAW3D + /* popup message over button when mouse enters it */ + static void unit_balloon_trigger(); + static void unit_unballoon(); ++#endif + + /* turn these into macros so we can use them in + struct initialization */ +@@ -356,17 +358,46 @@ + unitbox_sw = XtCreateWidget("unitbox", labelWidgetClass, tool, + Args, ArgCount); + XtAppAddActions(tool_app, unitbox_actions, XtNumber(unitbox_actions)); ++#ifndef XAW3D + /* popup when mouse passes over button */ + XtAddEventHandler(unitbox_sw, EnterWindowMask, False, + unit_balloon_trigger, (XtPointer) unitbox_sw); + XtAddEventHandler(unitbox_sw, LeaveWindowMask, False, + unit_unballoon, (XtPointer) unitbox_sw); ++#endif + XtOverrideTranslations(unitbox_sw, + XtParseTranslationTable(unitbox_translations)); ++ ++#ifdef XAW3D ++ update_rulerpanel(); ++#endif + } + + static Widget unit_popup, unit_panel, cancel, set, beside, below, label; + ++#ifdef XAW3D ++update_rulerpanel() ++{ ++ char msg[80]; ++ ++ strcpy(msg, "Pan to 0,0 "); ++ if (appres.flipvisualhints) ++ sprintf(msg + strlen(msg), "(right button)"); ++ else ++ sprintf(msg + strlen(msg), "(left button)"); ++ sprintf(msg + strlen(msg), "\nSet Units/Scale "); ++ if (appres.flipvisualhints) ++ sprintf(msg + strlen(msg), "(left button)"); ++ else ++ sprintf(msg + strlen(msg), "(right button)"); ++ ++ if (unitbox_sw) ++ if (appres.showballoons) ++ XawTipEnable(unitbox_sw, msg); ++ else ++ XawTipDisable(unitbox_sw); ++} ++#else + /* come here when the mouse passes over the unit box */ + + static Widget unit_balloon_popup = (Widget) 0; +@@ -474,6 +505,7 @@ + unit_balloon_popup = (Widget) 0; + } + } ++#endif + + /* handle unit/scale settings */ + diff --git a/graphics/xfig-devel/files/patch-w_util.c b/graphics/xfig-devel/files/patch-w_util.c new file mode 100644 index 000000000000..a55f09126539 --- /dev/null +++ b/graphics/xfig-devel/files/patch-w_util.c @@ -0,0 +1,19 @@ +--- w_util.c.orig Wed Dec 11 23:04:04 2002 ++++ w_util.c Wed Aug 31 09:49:42 2005 +@@ -352,16 +352,6 @@ + * (use -1 if no line desired) + */ + +-#include "SmeCascade.h" +- +-void +-test_callback(w, value, garbage) +- Widget w; +- XtPointer value, garbage; +-{ +- fprintf(stderr,"%d chosen\n",(int) value); +-} +- + Widget + make_pulldown_menu(entries, nent, divide_line, divide_message, parent, callback) + char *entries[]; diff --git a/graphics/xfig/Makefile b/graphics/xfig/Makefile index ce3fb590caa0..68146ae332eb 100644 --- a/graphics/xfig/Makefile +++ b/graphics/xfig/Makefile @@ -7,7 +7,7 @@ PORTNAME= xfig PORTVERSION= 3.2.4 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= graphics MASTER_SITES= http://www.xfig.org/xfigdist/ \ ftp://www-epb.lbl.gov/xfig/%SUBDIR%/ diff --git a/graphics/xfig/files/patch-aa b/graphics/xfig/files/patch-Imakefile index 1109ba739b18..a35284a2fa8f 100644 --- a/graphics/xfig/files/patch-aa +++ b/graphics/xfig/files/patch-Imakefile @@ -1,5 +1,5 @@ --- Imakefile.orig Thu Dec 19 18:57:11 2002 -+++ Imakefile Wed Jul 23 16:27:24 2003 ++++ Imakefile Wed Aug 31 09:58:41 2005 @@ -48,8 +48,8 @@ XCOMM Redefine the following if your PNG library and/or include file XCOMM are in different places @@ -38,7 +38,7 @@ #endif XCOMM Uncomment the following definiton if you want to use the small icons -@@ -105,17 +105,17 @@ +@@ -105,17 +105,20 @@ XCOMM Then be sure to change the XAW3DINC to point to the directory where your XCOMM 3D Athena widget headers are located @@ -50,6 +50,9 @@ +XAW3DINC = -I$(INCDIR)/X11/Xaw3d DUSEXAW3D = -DXAW3D XAWLIB = -lXaw3d ++#else ++XAW_SRC = w_menuentry.c SmeCascade.c SmeBSB.c SimpleMenu.c ++XAW_OBJ = w_menuentry.o SmeCascade.o SmeBSB.o SimpleMenu.o #endif XCOMM Uncomment the following if you have a wheel mouse. See docs for description. @@ -59,7 +62,7 @@ #ifdef WHEELMOUSE DUSEWHEELMOUSE = -DWHEELMOUSE -@@ -154,7 +154,7 @@ +@@ -154,7 +157,7 @@ XCOMM inline functions. With the "INLINE" keyword, you should notice that XCOMM the display will be a bit faster in complex figures @@ -68,7 +71,7 @@ XCOMM use (and change) the following if you want the multi-key data base file XCOMM somewhere other than the standard X11 library directory -@@ -166,7 +166,7 @@ +@@ -166,7 +169,7 @@ XCOMM XFIGDOCDIR tells where the html and pdf documentation should go XCOMM XFIGDOCDIR = $(DOCDIR)/xfig @@ -77,7 +80,7 @@ XCOMM MANDIR tells where the standard man pages should go (no need to change it XCOMM if you want the man pages installed in the standard place on your system -@@ -234,7 +234,7 @@ +@@ -234,7 +237,7 @@ #endif /* USEJPEG */ #ifdef I18N @@ -86,7 +89,7 @@ I18N_SRC = w_i18n.c I18N_OBJ = w_i18n.o #endif -@@ -251,11 +251,13 @@ +@@ -251,11 +254,13 @@ $(HAVE_NO_STRCASECMP) \ $(NEED_STRERROR) @@ -100,3 +103,48 @@ #ifdef USESMALLICONS DUSESMALLICONS = -DUSE_SMALL_ICONS +@@ -299,12 +304,12 @@ + u_elastic.c u_error.c u_fonts.c u_free.c u_geom.c \ + u_list.c u_markers.c u_pan.c u_print.c u_redraw.c u_scale.c u_search.c \ + u_smartsearch.c u_translate.c u_undo.c w_digitize.c w_listwidget.c \ +- w_browse.c w_capture.c w_srchrepl.c w_help.c w_layers.c w_menuentry.c \ ++ w_browse.c w_capture.c w_srchrepl.c w_help.c w_layers.c \ + w_canvas.c w_cmdpanel.c w_color.c w_cursor.c w_dir.c w_drawprim.c \ + w_export.c w_file.c w_fontbits.c w_fontpanel.c w_grid.c w_icons.c \ + w_indpanel.c w_library.c w_modepanel.c w_mousefun.c w_msgpanel.c \ + w_print.c w_rottext.c w_rulers.c w_setup.c w_style.c w_util.c w_zoom.c \ +- $(I18N_SRC) SmeCascade.c SmeBSB.c SimpleMenu.c ++ $(I18N_SRC) $(XAW_SRC) + + XFIGOBJ = d_arc.o d_arcbox.o d_box.o d_ellipse.o d_picobj.o \ + d_subspline.o d_line.o d_regpoly.o d_spline.o d_text.o \ +@@ -321,12 +326,12 @@ + u_elastic.o u_error.o u_fonts.o u_free.o u_geom.o \ + u_list.o u_markers.o u_pan.o u_print.o u_redraw.o u_scale.o u_search.o \ + u_smartsearch.o u_translate.o u_undo.o w_digitize.o w_listwidget.o \ +- w_browse.o w_capture.o w_srchrepl.o w_help.o w_layers.o w_menuentry.o \ ++ w_browse.o w_capture.o w_srchrepl.o w_help.o w_layers.o \ + w_canvas.o w_cmdpanel.o w_color.o w_cursor.o w_dir.o w_drawprim.o \ + w_export.o w_file.o w_fontbits.o w_fontpanel.o w_grid.o w_icons.o \ + w_indpanel.o w_library.o w_modepanel.o w_mousefun.o w_msgpanel.o \ + w_print.o w_rottext.o w_rulers.o w_setup.o w_style.o w_util.o w_zoom.o \ +- $(I18N_OBJ) SmeCascade.o SmeBSB.o SimpleMenu.o ++ $(I18N_OBJ) $(XAW_OBJ) + + XCOMM Other dependencies should be handled by "make depend" + +@@ -541,11 +546,13 @@ + SpecialObjectRule(w_grid.o, w_grid.c mode.h, ) + SpecialObjectRule(w_indpanel.o, w_indpanel.c mode.h w_indpanel.h object.h, ) + SpecialObjectRule(w_library.o, w_library.c mode.h, ) +-SpecialObjectRule(w_menuentry.o, w_menuentry.c w_menuentry.h w_menuentryP.h, ) + SpecialObjectRule(w_modepanel.o, w_modepanel.c mode.h w_indpanel.h w_icons.h object.h, $(DUSESMALLICONS)) + SpecialObjectRule(w_msgpanel.o, w_msgpanel.c mode.h, ) + SpecialObjectRule(w_rulers.o, w_rulers.c mode.h, ) + SpecialObjectRule(w_zoom.o, w_zoom.c mode.h, ) ++#ifndef XAW3D ++SpecialObjectRule(w_menuentry.o, w_menuentry.c w_menuentry.h w_menuentryP.h, ) ++#endif + + #ifdef USEJPEG + #ifndef USEINSTALLEDJPEG diff --git a/graphics/xfig/files/patch-figx.h b/graphics/xfig/files/patch-figx.h new file mode 100644 index 000000000000..5591d2ae6afc --- /dev/null +++ b/graphics/xfig/files/patch-figx.h @@ -0,0 +1,10 @@ +--- figx.h.orig Fri Sep 20 23:00:53 2002 ++++ figx.h Wed Aug 31 09:49:42 2005 +@@ -36,6 +36,7 @@ + #include <X11/Xaw3d/SmeBSB.h> + #include <X11/Xaw3d/Sme.h> + #include <X11/Xaw3d/SmeLine.h> ++#include <X11/Xaw3d/Tip.h> + #include <X11/Xaw3d/Toggle.h> + #include <X11/Xaw3d/Paned.h> + #include <X11/Xaw3d/Viewport.h> diff --git a/graphics/xfig/files/patch-w_cmdpanel.c b/graphics/xfig/files/patch-w_cmdpanel.c new file mode 100644 index 000000000000..bc6cadc8a7fe --- /dev/null +++ b/graphics/xfig/files/patch-w_cmdpanel.c @@ -0,0 +1,283 @@ +--- w_cmdpanel.c.orig Thu Dec 19 18:51:19 2002 ++++ w_cmdpanel.c Wed Aug 31 09:49:42 2005 +@@ -37,7 +37,6 @@ + #include "w_icons.h" + #include "w_indpanel.h" + #include "w_layers.h" +-#include "w_menuentry.h" + #include "w_msgpanel.h" + #include "w_mousefun.h" + #include "w_print.h" +@@ -46,6 +45,9 @@ + #include "w_setup.h" + #include "w_style.h" + #include "w_zoom.h" ++#ifndef XAW3D ++#include "w_menuentry.h" ++#endif + #ifdef I18N + #include "d_text.h" + #endif /* I18N */ +@@ -59,6 +61,15 @@ + Widget global_popup = 0; + Widget global_panel; + ++#define menu_item_bitmap_width 9 ++#define menu_item_bitmap_height 8 ++static unsigned char menu_item_bitmap_bits[] = { ++ 0x00, 0x01, 0x80, 0x01, 0xc0, 0x00, 0x60, 0x00, ++ 0x31, 0x00, 0x1b, 0x00, 0x0e, 0x00, 0x04, 0x00 ++}; ++ ++static Pixmap menu_item_bitmap = None; ++ + /* Widgets holding the ascii values for the string-based settings */ + + Widget bal_delay; +@@ -90,6 +101,13 @@ + static int off_paste_x,off_paste_y; + static int orig_paste_x,orig_paste_y; + ++#ifdef XAW3D ++extern update_indpanel(); ++extern update_modepanel(); ++extern update_layerpanel(); ++extern update_mousepanel(); ++extern update_rulerpanel(); ++#else + /* popup message over command button when mouse enters it */ + static void cmd_balloon_trigger(); + static void cmd_unballoon(); +@@ -97,6 +115,7 @@ + /* popup message over filename window when mouse enters it */ + static void filename_balloon_trigger(); + static void filename_unballoon(); ++#endif + + String global_translations = + "<Message>WM_PROTOCOLS: DismissGlobal()\n"; +@@ -143,29 +162,28 @@ + {NULL, 0, NULL}, + }; + +-#define PAGE_BRD_MSG "page borders (Meta-B)" ++#define PAGE_BRD_MSG "page borders (Meta-B)" + #define DPTH_MGR_MSG "depth manager" +-#define INFO_BAL_MSG "info balloons (Meta-Y)" +-#define LINE_LEN_MSG "line lengths (Meta-L)" +-#define VRTX_NUM_MSG "vertex numbers " ++#define INFO_BAL_MSG "info balloons (Meta-Y)" ++#define LINE_LEN_MSG "line lengths (Meta-L)" ++#define VRTX_NUM_MSG "vertex numbers" + + menu_def view_menu_items[] = { +- {"Manage Styles... (Ctrl-Y)", 7, popup_manage_style_panel}, +- {"Redraw (Ctrl-L)", 0, redisplay_canvas}, +- {"Portrait/Landscape (Meta-C)", 3, change_orient}, +- {"Zoom In (Shift-Z)", 5, inc_zoom}, +- {"Zoom Out (z)", 5, dec_zoom}, +- {"Zoom to Fit canvas (Ctrl-Z)", 8, fit_zoom}, +- {"Unzoom", 0, unzoom}, +- {"Pan to origin", 0, pan_origin}, +- {"-", 0, NULL}, /* make a dividing line */ ++ {"Manage Styles... (Ctrl-Y)", 7, popup_manage_style_panel}, ++ {"Redraw (Ctrl-L)", 0, redisplay_canvas}, ++ {"Portrait/Landscape (Meta-C)", 3, change_orient}, ++ {"Zoom In (Shift-Z)", 5, inc_zoom}, ++ {"Zoom Out (z)", 5, dec_zoom}, ++ {"Zoom to Fit canvas (Ctrl-Z)", 8, fit_zoom}, ++ {"Unzoom", 0, unzoom}, ++ {"Pan to origin", 0, pan_origin}, ++ {"-", 0, NULL}, /* make a dividing line */ + /* the following menu labels will be refreshed in refresh_view_menu() */ +- /* 2 must be added to the underline value because of the "* " preceding the text */ +- {PAGE_BRD_MSG, 12, toggle_show_borders}, +- {DPTH_MGR_MSG, 7, toggle_show_depths}, +- {INFO_BAL_MSG, 8, toggle_show_balloons}, +- {LINE_LEN_MSG, 12, toggle_show_lengths}, +- {VRTX_NUM_MSG, 7, toggle_show_vertexnums}, ++ {PAGE_BRD_MSG, 10, toggle_show_borders}, ++ {DPTH_MGR_MSG, 5, toggle_show_depths}, ++ {INFO_BAL_MSG, 6, toggle_show_balloons}, ++ {LINE_LEN_MSG, 5, toggle_show_lengths}, ++ {VRTX_NUM_MSG, 5, toggle_show_vertexnums}, + {NULL, 0, NULL}, + }; + +@@ -241,11 +259,13 @@ + NextArg(XtNborderWidth, INTERNAL_BW); + name_panel = XtCreateManagedWidget("file_name", labelWidgetClass, tool, + Args, ArgCount); ++#ifndef XAW3D + /* popup balloon when mouse passes over filename */ + XtAddEventHandler(name_panel, EnterWindowMask, False, + filename_balloon_trigger, (XtPointer) name_panel); + XtAddEventHandler(name_panel, LeaveWindowMask, False, + filename_unballoon, (XtPointer) name_panel); ++#endif + /* add actions to position the menus if the user uses an accelerator */ + XtAppAddActions(tool_app, menu_actions, XtNumber(menu_actions)); + refresh_view_menu(); +@@ -276,12 +296,14 @@ + + /* now the menu itself */ + menu->menuwidget = create_menu_item(menu); +- ++ ++#ifndef XAW3D + /* popup when mouse passes over button */ + XtAddEventHandler(menu->widget, EnterWindowMask, False, + cmd_balloon_trigger, (XtPointer) menu); + XtAddEventHandler(menu->widget, LeaveWindowMask, False, + cmd_unballoon, (XtPointer) menu); ++#endif + + return menu->widget; + } +@@ -304,7 +326,11 @@ + sprintf(id, "%1d", j + 1); + FirstArg(XtNvertSpace, 10); + NextArg(XtNunderline, 0); /* underline # digit */ ++#ifndef XAW3D + entry = XtCreateWidget(id, figSmeBSBObjectClass, menu, Args, ArgCount); ++#else ++ entry = XtCreateWidget(id, smeBSBObjectClass, menu, Args, ArgCount); ++#endif + XtAddCallback(entry, XtNcallback, load_recent_file, (XtPointer) my_strdup(id)); + if (j < max_recent_files) + XtManageChild(entry); +@@ -354,8 +380,13 @@ + /* normal menu entry */ + FirstArg(XtNvertSpace, 10); + NextArg(XtNunderline, menup->menu[i].u_line); /* any underline */ ++#ifndef XAW3D + entry = XtCreateManagedWidget(menup->menu[i].name, figSmeBSBObjectClass, + menu, Args, ArgCount); ++#else ++ entry = XtCreateManagedWidget(menup->menu[i].name, smeBSBObjectClass, ++ menu, Args, ArgCount); ++#endif + XtAddCallback(entry, XtNcallback, menup->menu[i].func, + (XtPointer) menup->widget); + } +@@ -381,6 +412,7 @@ + } + } + ++#ifndef XAW3D + /* come here when the mouse passes over a button in the command panel */ + + static Widget cmd_balloon_popup = (Widget) 0; +@@ -466,6 +498,7 @@ + cmd_balloon_popup = (Widget) 0; + } + } ++#endif + + static void + enter_cmd_but(widget, closure, event, continue_to_dispatch) +@@ -1229,7 +1262,7 @@ + strcpy(cur_pdfviewer, panel_get_value(pdfview)); + + XtPopdown(global_popup); +- ++ + refresh_view_menu(); + } + +@@ -1242,6 +1275,7 @@ + global_popup = (Widget) 0; + } + ++#ifndef XAW3D + /* come here when the mouse passes over the filename window */ + + static Widget filename_balloon_popup = (Widget) 0; +@@ -1313,6 +1347,7 @@ + filename_balloon_popup = (Widget) 0; + } + } ++#endif + + /* + * Update the current filename in the name_panel widget, and the xfig icon. +@@ -1459,6 +1494,7 @@ + Boolean state; + { + Widget menu, w; ++ Pixmap bitmap; + char name[60]; + DeclareStaticArgs(10); + +@@ -1471,25 +1507,36 @@ + if (w == NULL) { + fprintf(stderr, "xfig: can't find \"viewmenu%s\"\n", name); + } else { +- if (state) +- sprintf(name, "Don't show %s", label); +- else +- sprintf(name, "Show %s", label); +- if (state) +- sprintf(name, "* Show %s", label); +- else +- sprintf(name, " Show %s", label); ++ sprintf(name, "Show %s", label); + FirstArg(XtNlabel, name); ++ if (state) { ++ if (menu_item_bitmap == None) ++ menu_item_bitmap = XCreateBitmapFromData(XtDisplay(menu), ++ RootWindowOfScreen(XtScreen(menu)), ++ (char *)menu_item_bitmap_bits, ++ menu_item_bitmap_width, ++ menu_item_bitmap_height); ++ bitmap = menu_item_bitmap; ++ } else ++ bitmap = None; ++ NextArg(XtNleftBitmap, bitmap); ++ NextArg(XtNleftMargin, menu_item_bitmap_width + 4); + SetValues(w); + } + } + } + +-/* update the menu entries with or without an asterisk */ ++/* update the menu entries with or without a checkmark, ++ and set or clear all Tip widgets */ + + void + refresh_view_menu() + { ++#ifdef XAW3D ++ int i; ++ register main_menu_info *menu; ++#endif ++ + /* turn off Compose key LED */ + setCompLED(0); + +@@ -1498,4 +1545,25 @@ + refresh_view_menu_item(INFO_BAL_MSG, appres.showballoons); + refresh_view_menu_item(LINE_LEN_MSG, appres.showlengths); + refresh_view_menu_item(VRTX_NUM_MSG, appres.shownums); ++ ++#ifdef XAW3D ++ if (appres.showballoons) { ++ XawTipEnable(name_panel, "Current filename"); ++ for (i = 0; i < NUM_CMD_MENUS; ++i) { ++ menu = &main_menus[i]; ++ XawTipEnable(menu->widget, menu->hint); ++ } ++ } else { ++ XawTipDisable(name_panel); ++ for (i = 0; i < NUM_CMD_MENUS; ++i) { ++ menu = &main_menus[i]; ++ XawTipDisable(menu->widget); ++ } ++ } ++ update_indpanel(cur_indmask); ++ update_modepanel(); ++ update_layerpanel(); ++ update_mousepanel(); ++ update_rulerpanel(); ++#endif + } diff --git a/graphics/xfig/files/patch-w_indpanel.c b/graphics/xfig/files/patch-w_indpanel.c new file mode 100644 index 000000000000..4be94f44b745 --- /dev/null +++ b/graphics/xfig/files/patch-w_indpanel.c @@ -0,0 +1,194 @@ +--- w_indpanel.c.orig Sat Oct 19 01:05:41 2002 ++++ w_indpanel.c Wed Aug 31 09:49:42 2005 +@@ -60,9 +60,11 @@ + + #define MAX_ARROWSIZE 3 /* maximum value for cur_arrowsizeshown */ + ++#ifndef XAW3D + /* popup message over button when mouse enters it */ + static void ind_balloon_trigger(); + static void ind_unballoon(); ++#endif + + /***** value panel set translations *****/ + static String set_translations = +@@ -471,7 +473,7 @@ + 0x3f, 0x02, 0x7f, 0x02, 0xff, 0x02, 0xff, 0x03}; + + /* create a ind_sw_info struct for the update widget +- so we can use the balloon routines */ ++ so we can use the balloon routines or the Tip widget */ + + static ind_sw_info upd_sw_info, upd_set_sw_info, upd_clr_sw_info, upd_tog_sw_info; + +@@ -506,10 +508,12 @@ + strcpy(upd_sw_info.line1,"Selects which settings are updated"); + upd_sw_info.line2[0] = '\0'; + upd_sw_info.sw_width = 70; /* rough guess */ ++#ifndef XAW3D + XtAddEventHandler(upd_ctrl, EnterWindowMask, False, + ind_balloon_trigger, (XtPointer) &upd_sw_info); + XtAddEventHandler(upd_ctrl, LeaveWindowMask, False, + ind_unballoon, (XtPointer) &upd_sw_info); ++#endif + + FirstArg(XtNborderWidth, 0); + NextArg(XtNjustify, XtJustifyCenter); +@@ -518,11 +522,12 @@ + NextArg(XtNinternalHeight, 0); + upd_ctrl_lab = XtCreateManagedWidget("upd_ctrl_label", labelWidgetClass, + upd_ctrl, Args, ArgCount); +- ++#ifndef XAW3D + XtAddEventHandler(upd_ctrl_lab, EnterWindowMask, False, + ind_balloon_trigger, (XtPointer) &upd_sw_info); + XtAddEventHandler(upd_ctrl_lab, LeaveWindowMask, False, + ind_unballoon, (XtPointer) &upd_sw_info); ++#endif + + FirstArg(XtNdefaultDistance, 0); + NextArg(XtNborderWidth, 0); +@@ -545,10 +550,12 @@ + strcpy(upd_set_sw_info.line1,"Sets all update flags"); + upd_set_sw_info.line2[0] = '\0'; + upd_set_sw_info.sw_width = UPD_BITS+6; ++#ifndef XAW3D + XtAddEventHandler(set_upd, EnterWindowMask, False, + ind_balloon_trigger, (XtPointer) &upd_set_sw_info); + XtAddEventHandler(set_upd, LeaveWindowMask, False, + ind_unballoon, (XtPointer) &upd_set_sw_info); ++#endif + + clr_upd = XtCreateManagedWidget("clr_upd", commandWidgetClass, + upd_ctrl_btns, Args, ArgCount); +@@ -558,10 +565,12 @@ + strcpy(upd_clr_sw_info.line1,"Clears all update flags"); + upd_clr_sw_info.line2[0] = '\0'; + upd_clr_sw_info.sw_width = UPD_BITS+6; ++#ifndef XAW3D + XtAddEventHandler(clr_upd, EnterWindowMask, False, + ind_balloon_trigger, (XtPointer) &upd_clr_sw_info); + XtAddEventHandler(clr_upd, LeaveWindowMask, False, + ind_unballoon, (XtPointer) &upd_clr_sw_info); ++#endif + + tog_upd = XtCreateManagedWidget("tog_upd", commandWidgetClass, + upd_ctrl_btns, Args, ArgCount); +@@ -571,10 +580,12 @@ + strcpy(upd_tog_sw_info.line1,"Toggles all update flags"); + upd_tog_sw_info.line2[0] = '\0'; + upd_tog_sw_info.sw_width = UPD_BITS+6; ++#ifndef XAW3D + XtAddEventHandler(tog_upd, EnterWindowMask, False, + ind_balloon_trigger, (XtPointer) &upd_tog_sw_info); + XtAddEventHandler(tog_upd, LeaveWindowMask, False, + ind_unballoon, (XtPointer) &upd_tog_sw_info); ++#endif + + /* start with all components affected by update */ + cur_updatemask = I_UPDATEMASK; +@@ -669,11 +680,13 @@ + /* (callbacks pass same data for ANY button) */ + XtAddEventHandler(sw->button, ButtonReleaseMask, False, + sel_ind_but, (XtPointer) sw); ++#ifndef XAW3D + /* popup when mouse passes over button */ + XtAddEventHandler(sw->button, EnterWindowMask, False, + ind_balloon_trigger, (XtPointer) sw); + XtAddEventHandler(sw->button, LeaveWindowMask, False, + ind_unballoon, (XtPointer) sw); ++#endif + XtOverrideTranslations(sw->button, + XtParseTranslationTable(ind_translations)); + } +@@ -898,6 +911,7 @@ + + } + ++#ifndef XAW3D + /* come here when the mouse passes over a button in the indicator panel */ + + static Widget ind_balloon_popup = (Widget) 0; +@@ -980,6 +994,7 @@ + ind_balloon_popup = (Widget) 0; + } + } ++#endif + + generate_choice_pixmaps(isw) + ind_sw_info *isw; +@@ -1002,13 +1017,62 @@ + update_indpanel(mask) + unsigned long mask; + { ++#ifdef XAW3D ++ char msg[60]; ++#endif + register int i; + register ind_sw_info *isw; + ++ /* ++ * We must test for the widgets, as this is called by ++ * w_cmdpanel.c:refresh_view_menu(). ++ */ ++ ++#ifdef XAW3D ++ if (upd_ctrl) ++ if (appres.showballoons) ++ XawTipEnable(upd_ctrl, upd_sw_info.line1); ++ else ++ XawTipDisable(upd_ctrl); ++ if (upd_ctrl_lab) ++ if (appres.showballoons) ++ XawTipEnable(upd_ctrl_lab, upd_sw_info.line1); ++ else ++ XawTipDisable(upd_ctrl_lab); ++ if (set_upd) ++ if (appres.showballoons) ++ XawTipEnable(set_upd, upd_set_sw_info.line1); ++ else ++ XawTipDisable(set_upd); ++ if (clr_upd) ++ if (appres.showballoons) ++ XawTipEnable(clr_upd, upd_clr_sw_info.line1); ++ else ++ XawTipDisable(clr_upd); ++ if (tog_upd) ++ if (appres.showballoons) ++ XawTipEnable(tog_upd, upd_tog_sw_info.line1); ++ else ++ XawTipDisable(tog_upd); ++ for (isw = ind_switches, i = 0; i < NUM_IND_SW; isw++, i++) { ++ if (!isw->button) ++ continue; ++ if (appres.showballoons) { ++ sprintf(msg, "%s", isw->line1); ++ if (strlen(isw->line2)) ++ sprintf(msg + strlen(msg), " %s", isw->line2); ++ XawTipEnable(isw->button, msg); ++ } else ++ XawTipDisable(isw->button); ++ } ++#endif ++ + /* only update current mask if user wants to see relevant ind buttons */ + if (appres.ShowAllButtons) + return; + ++ if (!ind_box) ++ return; + cur_indmask = mask; + XtUnmanageChild(ind_box); + for (isw = ind_switches, i = 0; i < NUM_IND_SW; isw++, i++) { +@@ -1034,9 +1098,11 @@ + XButtonEvent xbutton; + ind_sw_info *isw = (ind_sw_info *) closure; + ++#ifndef XAW3D + /* since this command popups a window, destroy the balloon popup now. */ + ind_unballoon((Widget) 0, (XtPointer) 0, (XEvent*) 0, (Boolean*) 0); + app_flush(); ++#endif + + xbutton = event->xbutton; + #ifdef WHEELMOUSE diff --git a/graphics/xfig/files/patch-w_layers.c b/graphics/xfig/files/patch-w_layers.c new file mode 100644 index 000000000000..fa086e928150 --- /dev/null +++ b/graphics/xfig/files/patch-w_layers.c @@ -0,0 +1,126 @@ +--- w_layers.c.orig Tue Nov 5 20:38:18 2002 ++++ w_layers.c Wed Aug 31 09:49:42 2005 +@@ -63,9 +63,11 @@ + static XtCallbackProc switch_layer_mode(); + static XtActionProc layer_exposed(); + ++#ifndef XAW3D + /* popup message over command button when mouse enters it */ + static void layer_balloon_trigger(); + static void layer_unballoon(); ++#endif + + static void draw_layer_button(); + static void draw_layer_buttons(); +@@ -144,11 +146,13 @@ + below = all_active_but = XtCreateManagedWidget("all_active", commandWidgetClass, + layer_form, Args, ArgCount); + XtAddCallback(below, XtNcallback, (XtCallbackProc)all_active, (XtPointer) NULL); ++#ifndef XAW3D + /* popup when mouse passes over button */ + XtAddEventHandler(below, EnterWindowMask, False, + layer_balloon_trigger, (XtPointer) "Display all depths"); + XtAddEventHandler(below, LeaveWindowMask, False, + layer_unballoon, (XtPointer) NULL); ++#endif + + FirstArg(XtNlabel, "All Off"); + NextArg(XtNfromVert, below); +@@ -159,11 +163,13 @@ + below = all_inactive_but = XtCreateManagedWidget("all_inactive", commandWidgetClass, + layer_form, Args, ArgCount); + XtAddCallback(below, XtNcallback, (XtCallbackProc)all_inactive, (XtPointer) NULL); ++#ifndef XAW3D + /* popup when mouse passes over button */ + XtAddEventHandler(below, EnterWindowMask, False, + layer_balloon_trigger, (XtPointer) "Hide all depths"); + XtAddEventHandler(below, LeaveWindowMask, False, + layer_unballoon, (XtPointer) NULL); ++#endif + + FirstArg(XtNlabel, "Toggle "); + NextArg(XtNfromVert, below); +@@ -174,11 +180,13 @@ + below = toggle_all_but = XtCreateManagedWidget("toggle_all", commandWidgetClass, + layer_form, Args, ArgCount); + XtAddCallback(below, XtNcallback, (XtCallbackProc)toggle_all, (XtPointer) NULL); ++#ifndef XAW3D + /* popup when mouse passes over button */ + XtAddEventHandler(below, EnterWindowMask, False, + layer_balloon_trigger, (XtPointer) "Toggle displayed/hidden depths"); + XtAddEventHandler(below, LeaveWindowMask, False, + layer_unballoon, (XtPointer) NULL); ++#endif + + /* radio buttons to switch between graying out inactive layers or blanking altogether */ + +@@ -286,12 +294,13 @@ + NextArg(XtNright, XtChainRight); + layer_viewp = XtCreateManagedWidget("layer_viewp", viewportWidgetClass, + layer_viewform, Args, ArgCount); ++#ifndef XAW3D + /* popup when mouse passes over button */ +- + XtAddEventHandler(layer_viewp, EnterWindowMask, False, + layer_balloon_trigger, (XtPointer) "Display or hide any depth"); + XtAddEventHandler(layer_viewp, LeaveWindowMask, False, + layer_unballoon, (XtPointer) NULL); ++#endif + XtAddEventHandler(layer_viewp, StructureNotifyMask, False, + update_layers, (XtPointer) NULL); + +@@ -321,6 +330,9 @@ + XtOverrideTranslations(layer_canvas, + XtParseTranslationTable(layer_translations)); + ++#ifdef XAW3D ++ update_layerpanel(); ++#endif + } + + /* now that the mouse function and indicator panels have been sized +@@ -728,6 +740,36 @@ + return False; + } + ++#ifdef XAW3D ++update_layerpanel() ++{ ++ /* ++ * We must test for the widgets, as this is called by ++ * w_cmdpanel.c:refresh_view_menu(). ++ */ ++ ++ if (all_active_but) ++ if (appres.showballoons) ++ XawTipEnable(all_active_but, "Display all depths"); ++ else ++ XawTipDisable(all_active_but); ++ if (all_inactive_but) ++ if (appres.showballoons) ++ XawTipEnable(all_inactive_but, "Hide all depths"); ++ else ++ XawTipDisable(all_inactive_but); ++ if (toggle_all_but) ++ if (appres.showballoons) ++ XawTipEnable(toggle_all_but, "Toggle displayed/hidden depths"); ++ else ++ XawTipDisable(toggle_all_but); ++ if (layer_viewp) ++ if (appres.showballoons) ++ XawTipEnable(layer_viewp, "Display or hide any depth"); ++ else ++ XawTipDisable(layer_viewp); ++} ++#else + static Widget layer_balloon_popup = (Widget) 0; + static XtIntervalId balloon_id = (XtIntervalId) 0; + static Widget balloon_w; +@@ -831,6 +873,7 @@ + layer_balloon_popup = (Widget) 0; + } + } ++#endif + + /* map/unmap the depth manager on the right side */ + diff --git a/graphics/xfig/files/patch-w_library.c b/graphics/xfig/files/patch-w_library.c new file mode 100644 index 000000000000..25f44a85b2ef --- /dev/null +++ b/graphics/xfig/files/patch-w_library.c @@ -0,0 +1,151 @@ +--- w_library.c.orig Mon Nov 11 18:58:48 2002 ++++ w_library.c Wed Aug 31 09:49:42 2005 +@@ -40,7 +40,9 @@ + #include "w_setup.h" + #include "w_icons.h" + #include "w_zoom.h" ++#ifndef XAW3D + #include "SmeCascade.h" ++#endif + + #ifdef HAVE_NO_DIRENT + #include <sys/dir.h> +@@ -73,7 +75,10 @@ + static Widget library_popup=0; + static Widget put_cur_obj; + static Widget library_form, title; +-static Widget lib_obj_label, library_label, library_menu, library_menu_button; ++static Widget lib_obj_label, library_label, library_menu_button; ++#ifndef XAW3D ++static Widget library_menu; ++#endif + static Widget sel_view_button; + static Widget object_form; + static Widget icon_form, icon_viewport, icon_box; +@@ -272,8 +277,10 @@ + Dimension lwidth, lheight; + Dimension lawidth, laheight; + ++#ifndef XAW3D + /* pop down the menu */ + XtPopdown(library_menu); ++#endif + + /* if already in the middle of loading a library, return */ + if (loading_library) { +@@ -629,8 +636,8 @@ + menuButtonWidgetClass, + library_form, Args, ArgCount); + /* make the menu and attach it to the button */ +- (void) make_library_menu(library_menu_button, +- library_rec, num_library_names); ++ (void) make_library_menu(library_menu_button, "menu", ++ library_rec, num_library_names); + + if (!actions_added) { + XtAppAddActions(tool_app, library_actions, XtNumber(library_actions)); +@@ -1000,20 +1007,27 @@ + XtInstallAccelerators(library_form, cancel); + } + ++#ifndef XAW3D + extern void popdown_subs(); ++#endif + + static Widget +-make_library_menu(parent, librec, num) ++make_library_menu(parent, name, librec, num) + Widget parent; ++ char *name; + struct lib_rec *librec[]; + int num; + { +- Widget menu, entry, submenu; +- char name[200]; ++ Widget menu, entry; ++#ifndef XAW3D ++ Widget submenu; ++#endif ++ char menu_name[200]; + int i; + +- menu = XtCreatePopupShell("menu", simpleMenuWidgetClass, +- parent, NULL, ZERO); ++ menu = XtCreatePopupShell(name, simpleMenuWidgetClass, ++ parent, NULL, ZERO); ++#ifndef XAW3D + /* if this is the toplevel menu, add a callback to popdown any submenus if + the user releases the pointer button outside a submenu */ + if (XtIsSubclass(parent, menuButtonWidgetClass)) { +@@ -1021,29 +1035,54 @@ + library_menu = menu; + XtAddCallback(menu, XtNpopdownCallback, popdown_subs, (XtPointer) NULL); + } +- ++#endif ++ + for (i = 0; i < num; i++) { +- /* add one blank in front and after name to allow space for diamond and/or arrow */ +- sprintf(name," %s ",librec[i]->name); ++#ifndef XAW3D ++ sprintf(menu_name, " %s ", librec[i]->name); ++#else ++ sprintf(menu_name, "%sMenu", librec[i]->name); ++#endif + if (librec[i]->nsubs) { +- submenu = make_library_menu(menu, librec[i]->subdirs, +- librec[i]->nsubs); ++#ifndef XAW3D ++ submenu = make_library_menu(menu, menu_name, librec[i]->subdirs, ++ librec[i]->nsubs); + FirstArg(XtNsubMenu, submenu); +- NextArg(XtNrightBitmap, menu_cascade_arrow); /* use arrow to indicate cascade */ +- NextArg(XtNrightMargin, 9); /* room to the right of the arrow */ ++ NextArg(XtNrightMargin, 9); ++#else ++ FirstArg(XtNmenuName, XtNewString(menu_name)); ++#endif ++ NextArg(XtNrightBitmap, menu_cascade_arrow); + if (librec[i]->figs_at_top) { +- NextArg(XtNselectCascade, True); /* if there are fig files, make the */ +- NextArg(XtNleftBitmap, diamond_pixmap); /* cascade selectable and add a bitmap */ +- } /* in the left bitmap of the BSB */ +- entry = XtCreateManagedWidget(name, smeCascadeObjectClass, menu, +- Args, ArgCount); +- /* if there are fig files at this level, make the dir name selectable */ ++#ifndef XAW3D ++ NextArg(XtNselectCascade, True); ++#endif ++ NextArg(XtNleftBitmap, diamond_pixmap); ++ } ++#ifndef XAW3D ++ entry = XtCreateManagedWidget(menu_name, smeCascadeObjectClass, ++ menu, Args, ArgCount); ++#else ++ entry = XtCreateManagedWidget(librec[i]->name, smeBSBObjectClass, ++ menu, Args, ArgCount); ++#endif + if (librec[i]->figs_at_top) +- XtAddCallback(entry, XtNcallback, load_library, (XtPointer) librec[i]); ++ XtAddCallback(entry, XtNcallback, load_library, ++ (XtPointer) librec[i]); ++#ifdef XAW3D ++ (void) make_library_menu(menu, menu_name, librec[i]->subdirs, ++ librec[i]->nsubs); ++#endif + } else { +- entry = XtCreateManagedWidget(name, smeCascadeObjectClass, menu, +- NULL, ZERO); +- XtAddCallback(entry, XtNcallback, load_library, (XtPointer) librec[i]); ++#ifndef XAW3D ++ entry = XtCreateManagedWidget(menu_name, smeCascadeObjectClass, ++ menu, NULL, ZERO); ++#else ++ entry = XtCreateManagedWidget(librec[i]->name, smeBSBObjectClass, ++ menu, NULL, ZERO); ++#endif ++ XtAddCallback(entry, XtNcallback, load_library, ++ (XtPointer) librec[i]); + } + } + return menu; diff --git a/graphics/xfig/files/patch-w_modepanel.c b/graphics/xfig/files/patch-w_modepanel.c new file mode 100644 index 000000000000..43415e45fd9c --- /dev/null +++ b/graphics/xfig/files/patch-w_modepanel.c @@ -0,0 +1,143 @@ +--- w_modepanel.c.orig Mon Sep 16 23:11:35 2002 ++++ w_modepanel.c Wed Aug 31 09:49:42 2005 +@@ -132,9 +132,11 @@ + /* button selection event handler */ + static void sel_mode_but(); + ++#ifndef XAW3D + /* popup message over button when mouse enters it */ + static void mode_balloon_trigger(); + static void mode_unballoon(); ++#endif + + /* popdown message */ + static void turn_on(); +@@ -414,14 +416,21 @@ + /* left button changes mode */ + XtAddEventHandler(sw->widget, ButtonPressMask, False, + sel_mode_but, (XtPointer) sw); ++#ifndef XAW3D + /* popup when mouse passes over button */ + XtAddEventHandler(sw->widget, EnterWindowMask, False, + mode_balloon_trigger, (XtPointer) sw); + XtAddEventHandler(sw->widget, LeaveWindowMask, False, + mode_unballoon, (XtPointer) sw); ++#endif + XtOverrideTranslations(sw->widget, + XtParseTranslationTable(mode_translations)); + } ++ ++#ifdef XAW3D ++ update_modepanel(); ++#endif ++ + return; + } + +@@ -467,6 +476,28 @@ + SetValues(mode_panel); + } + ++#ifdef XAW3D ++update_modepanel() ++{ ++ register int i; ++ register mode_sw_info *sw; ++ ++ /* ++ * We must test for the widgets, as this is called by ++ * w_cmdpanel.c:refresh_view_menu(). ++ */ ++ ++ for (i = 0; i < NUM_MODE_SW; ++i) { ++ sw = &mode_switches[i]; ++ if (!sw->widget) ++ continue; ++ if (appres.showballoons) { ++ XawTipEnable(sw->widget, sw->modemsg); ++ } else ++ XawTipDisable(sw->widget); ++ } ++} ++#else + /* come here when the mouse passes over a button in the mode panel */ + + static Widget mode_balloon_popup = (Widget) 0; +@@ -557,6 +588,7 @@ + mode_balloon_popup = (Widget) 0; + } + } ++#endif + + /* come here when a button is pressed in the mode panel */ + +@@ -585,45 +617,46 @@ + else if (highlighting) + erase_objecthighlight(); + ++#ifndef XAW3D + /* if this command popups a window, destroy the balloon popup now. See the + note above about this above the command panel definition. */ + if (msw->popup) { + mode_unballoon((Widget) 0, (XtPointer) 0, (XEvent*) 0, (Boolean*) 0); + } + app_flush(); ++#endif + + if (xbutton.button == Button1) { /* left button */ + turn_off_current(); + turn_on(msw); +- if (msw->mode == F_UPDATE) { /* map the set/clr/toggle button for update */ ++ ++ update_indpanel(0); /* first remove ind buttons */ ++ XtUnmanageChild(ind_panel); ++ if (msw->mode != F_UPDATE) ++ XtUnmanageChild(upd_ctrl); ++ FirstArg(XtNwidth, 1); /* force a resize to update scrollbar */ ++ SetValues(ind_panel); ++ if (msw->mode == F_UPDATE) { + if (cur_mode != F_UPDATE) { +- update_indpanel(0); /* first remove ind buttons */ +- XtUnmanageChild(ind_panel); ++ /* map the set/clr/toggle button for update */ + XtManageChild(upd_ctrl); +- /* get the width of the update control panel */ +- /* now put the ind_panel to our right */ +- FirstArg(XtNfromHoriz, upd_ctrl); +- NextArg(XtNwidth, INDPANEL_WD-UPD_CTRL_WD-2*INTERNAL_BW); /* resize it */ +- SetValues(ind_panel); +- XtManageChild(ind_panel); +- update_indpanel(msw->indmask); /* now manage the relevant buttons */ + } +- } else { /* turn off the update boxes if not in update mode */ +- if (cur_mode == F_UPDATE) { /* if previous mode is update and current */ +- update_indpanel(0); /* is not, first remove ind buttons */ ++ /* set the adjacent widget and width */ ++ FirstArg(XtNfromHoriz, upd_ctrl); ++ NextArg(XtNwidth, INDPANEL_WD-UPD_CTRL_WD-2*INTERNAL_BW); ++ } else { ++ if (cur_mode == F_UPDATE) { ++ /* unmap the set/clr/toggle button for update */ + unmanage_update_buts(); +- XtUnmanageChild(ind_panel); +- XtUnmanageChild(upd_ctrl); +- /* now put the ind_panel to the right of the canvas */ +- FirstArg(XtNfromHoriz, NULL); +- NextArg(XtNwidth, INDPANEL_WD); /* resize it */ +- SetValues(ind_panel); +- XtManageChild(ind_panel); +- update_indpanel(msw->indmask); /* now manage the relevant buttons */ +- } else { +- update_indpanel(msw->indmask); /* just update indicator buttons */ + } ++ /* clear the adjacent widget and set width */ ++ FirstArg(XtNfromHoriz, NULL); ++ NextArg(XtNwidth, INDPANEL_WD); + } ++ SetValues(ind_panel); ++ XtManageChild(ind_panel); ++ update_indpanel(msw->indmask); /* now manage the relevant buttons */ ++ + put_msg(msw->modemsg); + if ((cur_mode == F_GLUE || cur_mode == F_BREAK) && + msw->mode != F_GLUE && msw->mode != F_BREAK) { diff --git a/graphics/xfig/files/patch-w_mousefun.c b/graphics/xfig/files/patch-w_mousefun.c new file mode 100644 index 000000000000..b619fd08d062 --- /dev/null +++ b/graphics/xfig/files/patch-w_mousefun.c @@ -0,0 +1,56 @@ +--- w_mousefun.c.orig Wed Mar 27 01:22:48 2002 ++++ w_mousefun.c Wed Aug 31 09:49:42 2005 +@@ -54,9 +54,11 @@ + static Pixmap mousefun_pm; + static Pixmap keybd_pm; + ++#ifndef XAW3D + /* popup message over button when mouse enters it */ + static void mouse_balloon_trigger(); + static void mouse_unballoon(); ++#endif + + void + init_mousefun(tool) +@@ -81,11 +83,15 @@ + + mousefun = XtCreateManagedWidget("mouse_panel", labelWidgetClass, + tool, Args, ArgCount); ++#ifdef XAW3D ++ update_mousepanel(); ++#else + /* popup when mouse passes over button */ + XtAddEventHandler(mousefun, EnterWindowMask, False, + mouse_balloon_trigger, (XtPointer) mousefun); + XtAddEventHandler(mousefun, LeaveWindowMask, False, + mouse_unballoon, (XtPointer) mousefun); ++#endif + } + + /* widgets are realized and windows exist at this point */ +@@ -105,6 +111,17 @@ + set_mousefun("", "", "", "", "", ""); + } + ++#ifdef XAW3D ++update_mousepanel() ++{ ++ if (mousefun) ++ if (appres.showballoons) ++ XawTipEnable(mousefun, ++ "Shows which mouse buttons\nare active in each mode"); ++ else ++ XawTipDisable(mousefun); ++} ++#else + /* come here when the mouse passes over a button in the mouse indicator panel */ + + static Widget mouse_balloon_popup = (Widget) 0; +@@ -184,6 +201,7 @@ + mouse_balloon_popup = (Widget) 0; + } + } ++#endif + + static void + reset_mousefun() diff --git a/graphics/xfig/files/patch-w_rulers.c b/graphics/xfig/files/patch-w_rulers.c new file mode 100644 index 000000000000..00259d857e04 --- /dev/null +++ b/graphics/xfig/files/patch-w_rulers.c @@ -0,0 +1,69 @@ +--- w_rulers.c.orig Sat Oct 12 01:13:53 2002 ++++ w_rulers.c Wed Aug 31 09:49:42 2005 +@@ -117,9 +117,11 @@ + static void sideruler_selected(); + static void sideruler_exposed(); + ++#ifndef XAW3D + /* popup message over button when mouse enters it */ + static void unit_balloon_trigger(); + static void unit_unballoon(); ++#endif + + /* turn these into macros so we can use them in + struct initialization */ +@@ -356,17 +358,46 @@ + unitbox_sw = XtCreateWidget("unitbox", labelWidgetClass, tool, + Args, ArgCount); + XtAppAddActions(tool_app, unitbox_actions, XtNumber(unitbox_actions)); ++#ifndef XAW3D + /* popup when mouse passes over button */ + XtAddEventHandler(unitbox_sw, EnterWindowMask, False, + unit_balloon_trigger, (XtPointer) unitbox_sw); + XtAddEventHandler(unitbox_sw, LeaveWindowMask, False, + unit_unballoon, (XtPointer) unitbox_sw); ++#endif + XtOverrideTranslations(unitbox_sw, + XtParseTranslationTable(unitbox_translations)); ++ ++#ifdef XAW3D ++ update_rulerpanel(); ++#endif + } + + static Widget unit_popup, unit_panel, cancel, set, beside, below, label; + ++#ifdef XAW3D ++update_rulerpanel() ++{ ++ char msg[80]; ++ ++ strcpy(msg, "Pan to 0,0 "); ++ if (appres.flipvisualhints) ++ sprintf(msg + strlen(msg), "(right button)"); ++ else ++ sprintf(msg + strlen(msg), "(left button)"); ++ sprintf(msg + strlen(msg), "\nSet Units/Scale "); ++ if (appres.flipvisualhints) ++ sprintf(msg + strlen(msg), "(left button)"); ++ else ++ sprintf(msg + strlen(msg), "(right button)"); ++ ++ if (unitbox_sw) ++ if (appres.showballoons) ++ XawTipEnable(unitbox_sw, msg); ++ else ++ XawTipDisable(unitbox_sw); ++} ++#else + /* come here when the mouse passes over the unit box */ + + static Widget unit_balloon_popup = (Widget) 0; +@@ -474,6 +505,7 @@ + unit_balloon_popup = (Widget) 0; + } + } ++#endif + + /* handle unit/scale settings */ + diff --git a/graphics/xfig/files/patch-w_util.c b/graphics/xfig/files/patch-w_util.c new file mode 100644 index 000000000000..a55f09126539 --- /dev/null +++ b/graphics/xfig/files/patch-w_util.c @@ -0,0 +1,19 @@ +--- w_util.c.orig Wed Dec 11 23:04:04 2002 ++++ w_util.c Wed Aug 31 09:49:42 2005 +@@ -352,16 +352,6 @@ + * (use -1 if no line desired) + */ + +-#include "SmeCascade.h" +- +-void +-test_callback(w, value, garbage) +- Widget w; +- XtPointer value, garbage; +-{ +- fprintf(stderr,"%d chosen\n",(int) value); +-} +- + Widget + make_pulldown_menu(entries, nent, divide_line, divide_message, parent, callback) + char *entries[]; |