[ The following unofficial patch is what most people have been using while waiting for me to come up with the real thing. This patch depends on the X11 libraries being compiled with -DAW_BC. My current recommendation is to apply my official patch #1 instead -- bukys@cs.rochester.edu ] (Message rcs:22) Return-Path: stolcke%icsib12.Berkeley.EDU@jade.berkeley.edu Received: from cayuga.cs.rochester.edu by sol.cs.rochester.edu (4.0/q) id AA24365; Fri, 16 Feb 90 22:18:47 EST Received: from jade.Berkeley.EDU by cayuga.cs.rochester.edu (5.59/q) id AA09693; Fri, 16 Feb 90 22:18:32 EST Received: from icsib12.Berkeley.EDU by jade.berkeley.edu (5.61.1/1.16.23) id AA01827; Fri, 16 Feb 90 19:18:53 PST Received: by icsib12.berkeley.edu. (4.0/SMI-4.0) id AA19814; Fri, 16 Feb 90 19:18:05 PST From: stolcke%icsib12.Berkeley.EDU@jade.berkeley.edu (Andreas Stolcke) Message-Id: <9002170318.AA19814@icsib12.berkeley.edu.> To: bukys@cs.rochester.edu Cc: simulator-users@cs.rochester.edu, viola@ai.mit.edu, mmlai!jensen@uunet.uu.net Subject: Re: X11R4 In-Reply-To: Your message of Fri, 16 Feb 90 16:14:56 -0500. <9002162114.AA08816@alabaster.cs.rochester.edu> Date: Fri, 16 Feb 90 19:18:03 PST Status: RO In case you don't want to wait for the `offical' patch, here's one that got the X interface to work under X11R4, tested on Sun4/SunOS4.0.3 and Sun3/SunOS3.5. It assumes you have applied the first two MIT fixes to the X11R4 distribution (although this might not really be necessary) and you compiled and installed the Xaw library with the backwards compatibility option. The following stuff in XGI needed fixing: o Compile everything with -DXAW_BC. o Add -lXext for linkage of the final simulator. o Most popup shells have to be topLevelShells to allow window manager interaction. o Add a width arg to the "display_box" widget to stop it from complaining about `width/height zero'. o Remove an incompatible access to the guts of a Panel widget in display_panel.c. Eventually one wants to get rid of the XAW_BC stuff and make use of the new R4 features (such as the menus in Xaw), but for the time being these couple of changes should do the job. Apply the patch with `patch -p0' at the root of the simulator distribution and then remake makesim and src/xgi. You also might have to patch the top-level makefile to point to the X11R4 installation. Andreas *** bin/makesim-dist.R3 Fri Oct 20 08:44:36 1989 --- bin/makesim-dist Fri Feb 16 16:01:25 1990 *************** *** 231,236 **** --- 231,240 ---- # #_____________________________________________________________________________ + if test "$graphics" -a "$xwindows" + then + cflag="$cflag -I$xincroot -DXAW_BC" + fi if test $udeb then cflag="$cflag -g" *************** *** 505,511 **** simobj="$simobj $giobj" if test $xwindows then ! gflag=" -lm -L$xusrlibdir -lXaw -lXmu -lXt -lX11" echo "X11 graphics interface" else gflag=" -lm -lsuntool -lsunwindow -lpixrect" --- 509,515 ---- simobj="$simobj $giobj" if test $xwindows then ! gflag=" -lm -L$xusrlibdir -lXaw -lXmu -lXt -lXext -lX11" echo "X11 graphics interface" else gflag=" -lm -lsuntool -lsunwindow -lpixrect" *** src/xgi/Makefile.R3 Tue Sep 19 09:02:41 1989 --- src/xgi/Makefile Fri Feb 16 13:14:56 1990 *************** *** 16,22 **** # don't ask about the escape sequences!! # all I want is -DXX='"YY"' passed to cc # ! FLAGS = $(CFLAGS) -I$(IDIR) -I$(XINCROOT) # RFLAGS= $(FLAGS) -DXGIDIR='"'"'$(RELDIR)'"'"' -O # --- 16,22 ---- # don't ask about the escape sequences!! # all I want is -DXX='"YY"' passed to cc # ! FLAGS = $(CFLAGS) -I$(IDIR) -I$(XINCROOT) -DXAW_BC -Dindex=list_index # RFLAGS= $(FLAGS) -DXGIDIR='"'"'$(RELDIR)'"'"' -O # *** src/xgi/dist/control_panel.c Tue Sep 26 11:01:10 1989 --- src/xgi/./control_panel.c Mon Nov 6 16:57:01 1989 *************** *** 431,437 **** /* items only displayed during MAIN mode */ /* NHG this is a mess, should all be done elsewhere */ ! gi_layout_panel = XtCreatePopupShell("LAYOUT",transientShellWidgetClass, gi_tool, layout_loc, XtNumber(layout_loc)); gi_main_shell = XtCreateManagedWidget("MAIN_SHELL", boxWidgetClass, --- 431,437 ---- /* items only displayed during MAIN mode */ /* NHG this is a mess, should all be done elsewhere */ ! gi_layout_panel = XtCreatePopupShell("LAYOUT",topLevelShellWidgetClass, gi_tool, layout_loc, XtNumber(layout_loc)); gi_main_shell = XtCreateManagedWidget("MAIN_SHELL", boxWidgetClass, *************** *** 740,746 **** { XtNfont, (XtArgVal) &gi_default_font }, }; ! namepopup = XtCreatePopupShell("RCS HELP",transientShellWidgetClass, w, p, XtNumber(p)); temp = XtCreateManagedWidget("help_box", formWidgetClass, namepopup, q, XtNumber(q)); (void) sprintf(filenamebuf, "%s/xgi.help", XGIDIR); --- 740,746 ---- { XtNfont, (XtArgVal) &gi_default_font }, }; ! namepopup = XtCreatePopupShell("RCS HELP",topLevelShellWidgetClass, w, p, XtNumber(p)); temp = XtCreateManagedWidget("help_box", formWidgetClass, namepopup, q, XtNumber(q)); (void) sprintf(filenamebuf, "%s/xgi.help", XGIDIR); *** src/xgi/dist/display_panel.c Thu Oct 12 11:40:30 1989 --- src/xgi/./display_panel.c Fri Feb 16 15:49:09 1990 *************** *** 871,877 **** static Arg a[] = { ! {XtNheight, (XtArgVal) 0 }, {XtNsensitive, (XtArgVal) TRUE }, {XtNresizable, (XtArgVal) TRUE }, {XtNborderWidth, (XtArgVal) 0}, --- 871,878 ---- static Arg a[] = { ! {XtNheight, (XtArgVal) 100 }, ! {XtNwidth, (XtArgVal) 100 }, {XtNsensitive, (XtArgVal) TRUE }, {XtNresizable, (XtArgVal) TRUE }, {XtNborderWidth, (XtArgVal) 0}, *************** *** 929,935 **** c[1].value = (XtArgVal) yorig; c[2].value = (XtArgVal) width; c[3].value = (XtArgVal) height; ! ipanel->popup = XtCreatePopupShell("display_shell",transientShellWidgetClass, gi_tool, c, XtNumber(c)); vpane = XtCreateManagedWidget("vpane_box", vPanedWidgetClass, ipanel->popup, f, XtNumber(f)); --- 930,936 ---- c[1].value = (XtArgVal) yorig; c[2].value = (XtArgVal) width; c[3].value = (XtArgVal) height; ! ipanel->popup = XtCreatePopupShell("display_shell",topLevelShellWidgetClass, gi_tool, c, XtNumber(c)); vpane = XtCreateManagedWidget("vpane_box", vPanedWidgetClass, ipanel->popup, f, XtNumber(f)); *************** *** 951,957 **** /* make display panel, add callbacks */ fbox = XtCreateManagedWidget("display_form", formWidgetClass, vpane, e, XtNumber(e)); - a[0].value = (XtArgVal) 100; dbox = XtCreateManagedWidget("display_box", displayWidgetClass, fbox, a, XtNumber(a)); --- 952,957 ---- *************** *** 974,984 **** XSetFunction(XtDisplay(gi_tool),ipanel->globals.gc, GXcopy); XSetFont(XtDisplay(gi_tool), ipanel->globals.gc, gi_default_font.fid); ! /* the next two statements depend on the internals of VPaned.c */ XtSetMappedWhenManaged(((Pane)(box->core.constraints))->grip, False); XtSetMappedWhenManaged(((Pane)(fbox->core.constraints))->grip, False); ! /* change the cursor on the graphics panel to a crosshair */ ipanel->globals.last_cursor = gi_main_cursor; XDefineCursor(XtDisplay(gi_tool), ipanel->globals.gfx, gi_main_cursor); --- 974,985 ---- XSetFunction(XtDisplay(gi_tool),ipanel->globals.gc, GXcopy); XSetFont(XtDisplay(gi_tool), ipanel->globals.gc, gi_default_font.fid); ! /* the next two statements depend on the internals of VPaned.c XtSetMappedWhenManaged(((Pane)(box->core.constraints))->grip, False); XtSetMappedWhenManaged(((Pane)(fbox->core.constraints))->grip, False); + */ ! /* change the cursor on the graphics panel to a crosshair */ ipanel->globals.last_cursor = gi_main_cursor; XDefineCursor(XtDisplay(gi_tool), ipanel->globals.gfx, gi_main_cursor); *** src/xgi/dist/info_panel.c Thu Oct 12 09:13:10 1989 --- src/xgi/./info_panel.c Fri Feb 16 18:39:53 1990 *************** *** 188,194 **** ipanel = (info_panel_t)malloc(sizeof(*ipanel)); c[0].value = (XtArgVal) index*8; ! ipanel->popup = XtCreatePopupShell("info_shell",transientShellWidgetClass, gi_tool,c, XtNumber(c)); box = XtCreateManagedWidget("info_box", formWidgetClass, ipanel->popup, form_args, XtNumber(form_args)); --- 188,194 ---- ipanel = (info_panel_t)malloc(sizeof(*ipanel)); c[0].value = (XtArgVal) index*8; ! ipanel->popup = XtCreatePopupShell("info_shell",topLevelShellWidgetClass, gi_tool,c, XtNumber(c)); box = XtCreateManagedWidget("info_box", formWidgetClass, ipanel->popup, form_args, XtNumber(form_args)); *************** *** 312,318 **** text.format = FMT8BIT; XtTextReplace(ip->text, 0, strlen(ip->buf), &text); - ForceBuildLineTable(ip->text); /* grepped from X11/lib/Xaw/Text.c */ XtTextDisplay(ip->text); } --- 312,317 ---- (Message rcs:169) Return-Path: Nigel.Goddard@B.GP.CS.CMU.EDU Received: from cayuga.cs.rochester.edu by sol.cs.rochester.edu (5.61/s) id AA11856; Thu, 19 Apr 90 12:12:04 -0400 Received: from B.GP.CS.CMU.EDU by cayuga.cs.rochester.edu (5.61/r) id AA19210; Thu, 19 Apr 90 12:11:54 -0400 Received: from b.gp.cs.cmu.edu by B.GP.CS.CMU.EDU id aa28237; 19 Apr 90 12:10:54 EDT To: chymes@csmil.umich.edu, cooper@ils.nwu.edu, stolcke@icsi.berkeley.edu, cpd@aic.hrl.hac.com, olson@virginia.edu, marty%cogsci@ucsd.edu Cc: goddard@B.GP.CS.CMU.EDU, bukys@cs.rochester.edu Subject: Two patchs for XGI under R4 Date: Thu, 19 Apr 90 12:10:42 EDT Message-Id: <28234.640541442@B.GP.CS.CMU.EDU> From: Nigel.Goddard@B.GP.CS.CMU.EDU Fellow Users, I've been having problems with the Layout window under R4: 1. WHO field is garbage (actually a scroll bar). 2. WHERE x and y fields rapidly become garbage. These two problems make the layout window next to useless. Here are patches to fix the problems. They assume you have run Andreas's patches of February 16 1990 on the distribution. They are very simple; you could edit them in by hand easily. Nigel ----------------------------------------------------------------------- Patch for WHO field: ----------------------------------------------------------------------- *** control_panel.c.orig Fri Mar 30 16:58:29 1990 --- control_panel.c Thu Apr 19 11:18:57 1990 *************** *** 436,456 **** gi_main_shell = XtCreateManagedWidget("MAIN_SHELL", boxWidgetClass, gi_layout_panel, no_bdr, 1); temp = XtCreateManagedWidget("WHO_HOW_BOX", formWidgetClass, gi_main_shell, no_bdr, 1); temp3 = XtCreateManagedWidget("WHO_ITEM", formWidgetClass,temp, no_bdr, 1); temp2 = AddText(temp3,"WHO: ",XtJustifyRight, NULL); strcpy(gi_who_buf,"0"); gi_mitem[WHO_ITEM] = AddTextEdit(temp3,"WHO_TEXT",gi_who_buf, temp2, ! MAX_CMD_LENGTH, 40); vertical_args[0].value = (XtArgVal) temp3; temp3 = XtCreateManagedWidget("HOWMANY_ITEM",formWidgetClass,temp, vertical_args, XtNumber(vertical_args)); temp2 = AddText(temp3, "HOW MANY: ", XtJustifyRight, NULL); strcpy(gi_howmany_buf,"all"); gi_mitem[HOWMANY_ITEM] = AddTextEdit(temp3,"HOWMANY_TEXT", gi_howmany_buf, temp2, PAR_LEN, PAR_LEN); /* xgi: I know this isn't pretty, but I don't know another way */ /* xgi: should look like: --- 436,456 ---- gi_main_shell = XtCreateManagedWidget("MAIN_SHELL", boxWidgetClass, gi_layout_panel, no_bdr, 1); temp = XtCreateManagedWidget("WHO_HOW_BOX", formWidgetClass, gi_main_shell, no_bdr, 1); temp3 = XtCreateManagedWidget("WHO_ITEM", formWidgetClass,temp, no_bdr, 1); temp2 = AddText(temp3,"WHO: ",XtJustifyRight, NULL); strcpy(gi_who_buf,"0"); gi_mitem[WHO_ITEM] = AddTextEdit(temp3,"WHO_TEXT",gi_who_buf, temp2, ! 40, 40); vertical_args[0].value = (XtArgVal) temp3; temp3 = XtCreateManagedWidget("HOWMANY_ITEM",formWidgetClass,temp, vertical_args, XtNumber(vertical_args)); temp2 = AddText(temp3, "HOW MANY: ", XtJustifyRight, NULL); strcpy(gi_howmany_buf,"all"); gi_mitem[HOWMANY_ITEM] = AddTextEdit(temp3,"HOWMANY_TEXT", gi_howmany_buf, temp2, PAR_LEN, PAR_LEN); /* xgi: I know this isn't pretty, but I don't know another way */ /* xgi: should look like: ----------------------------------------------------------------------- Patch for WHERE fields: ----------------------------------------------------------------------- *** misc.c.orig Thu Apr 19 11:41:23 1990 --- misc.c Thu Apr 19 11:49:59 1990 *************** *** 1223,1249 **** static char markx[MAX_NUM_LENGTH+1], marky[MAX_NUM_LENGTH+1]; (void) sprintf(markx,"%1d",gi_marker.x_pos); (void) sprintf(marky,"%1d",gi_marker.y_pos); text.firstPos = 0; text.format = FMT8BIT; text.length = strlen(markx); text.ptr = markx; ! inpos = XtTextGetInsertionPoint(gi_mitem[WHEREX_ITEM]); XtTextReplace(gi_mitem[WHEREX_ITEM], 0, inpos, &text); text.length = strlen(marky); text.ptr = marky; ! inpos = XtTextGetInsertionPoint(gi_mitem[WHEREY_ITEM]); XtTextReplace(gi_mitem[WHEREY_ITEM], 0, inpos, &text); } /*************************************************************************/ gi_move_marker(x,y) int x, y; { /* move marker from its current position to * the requested display space coordinates */ --- 1223,1251 ---- static char markx[MAX_NUM_LENGTH+1], marky[MAX_NUM_LENGTH+1]; (void) sprintf(markx,"%1d",gi_marker.x_pos); (void) sprintf(marky,"%1d",gi_marker.y_pos); text.firstPos = 0; text.format = FMT8BIT; text.length = strlen(markx); text.ptr = markx; ! inpos = strlen(gi_wherex_buf); XtTextReplace(gi_mitem[WHEREX_ITEM], 0, inpos, &text); + XtTextSetInsertionPoint(gi_mitem[WHEREX_ITEM], text.length); text.length = strlen(marky); text.ptr = marky; ! inpos = strlen(gi_wherey_buf); XtTextReplace(gi_mitem[WHEREY_ITEM], 0, inpos, &text); + XtTextSetInsertionPoint(gi_mitem[WHEREY_ITEM], text.length); } /*************************************************************************/ gi_move_marker(x,y) int x, y; { /* move marker from its current position to * the requested display space coordinates */