*** Arc.c.orig Fri Sep 11 20:53:11 1992 --- Arc.c Fri Nov 6 00:16:33 1992 *************** *** 121,132 **** static XtResource resources[] = { { ! XmNto, XmCTo, XmRPointer, sizeof(caddr_t), XtOffset(XmArcWidget, arc.to), XmRPointer, NULL }, { ! XmNfrom, XmCFrom, XmRPointer, sizeof(caddr_t), XtOffset(XmArcWidget, arc.from), XmRPointer, NULL }, --- 121,132 ---- static XtResource resources[] = { { ! XmNto, XmCTo, XmRWidget, sizeof(caddr_t), XtOffset(XmArcWidget, arc.to), XmRPointer, NULL }, { ! XmNfrom, XmCFrom, XmRWidget, sizeof(caddr_t), XtOffset(XmArcWidget, arc.from), XmRPointer, NULL }, *************** *** 267,273 **** /* extension */ NULL, }, { ! #ifdef _R4_ /* input_dispatch */ (XmWidgetDispatchProc) DispatchInput, #else /* input_dispatch */ (XtWidgetProc) DispatchInput, --- 267,273 ---- /* extension */ NULL, }, { ! #if defined(_R4_) && !defined(ultrix) /* input_dispatch */ (XmWidgetDispatchProc) DispatchInput, #else /* input_dispatch */ (XtWidgetProc) DispatchInput, *** ArcP.h.orig Fri Oct 30 17:43:21 1992 --- ArcP.h Fri Oct 30 17:43:53 1992 *************** *** 16,22 **** } ArcList; typedef struct _XmArcClassPart{ ! #ifdef _R4_ XmWidgetDispatchProc input_dispatch; #else XtWidgetProc input_dispatch; --- 16,22 ---- } ArcList; typedef struct _XmArcClassPart{ ! #if defined(_R4_) && !defined(ultrix) XmWidgetDispatchProc input_dispatch; #else XtWidgetProc input_dispatch; *** Graph.c.orig Fri Sep 11 20:53:12 1992 --- Graph.c Fri Nov 6 00:11:48 1992 *************** *** 431,442 **** static void StartAddNode(); static void toAllLowerCase(); ! extern char *strdup(); ! ! #endif --- 431,466 ---- static void StartAddNode(); static void toAllLowerCase(); ! #ifndef ultrix extern char *strdup(); ! #else ! /* strdup, hacked by gustaf neumann, Oct 90 */ + #include + #include + extern char * malloc(); + + char * + strdup ( string ) + char * string; + { + char *newstring; + unsigned size; + + if (string == (char *)NULL) /* If the original is NULL */ + return (char *)NULL; /* so is the result. */ + + size = (unsigned)strlen(string)+1; + if ( (newstring = malloc((strlen(string)+1) * sizeof(char))) ) + strcpy(newstring,string); + + return newstring; + } + #endif /* of strdup */ + #endif + + *************** *** 1006,1014 **** for (i = 0; i < graph->composite.num_children; i++) { ! Widget child = graph->composite.children[i]; ! if(child == graph->graph.root->widget) continue; if(RX(child) < neg_x) --- 1030,1039 ---- for (i = 0; i < graph->composite.num_children; i++) { ! Widget child = graph->composite.children[i]; ! if(child == graph->graph.root->widget ! || (XtClass(child) == xmArcWidgetClass)) continue; if(RX(child) < neg_x) *************** *** 1029,1035 **** { Widget child = graph->composite.children[i]; ! if(child == graph->graph.root->widget) continue; if (XtIsManaged (child)) --- 1054,1061 ---- { Widget child = graph->composite.children[i]; ! if(child == graph->graph.root->widget ! || (XtClass(child) == xmArcWidgetClass)) continue; if (XtIsManaged (child)) *************** *** 1106,1111 **** --- 1132,1140 ---- for (i = 0; i < graph->composite.num_children; i++) { Widget child = graph->composite.children[i]; + if (XtClass(child) == xmArcWidgetClass) + continue; + _XmMoveObject((RectObj)child, RX(child) + delta_x, RY(child) + delta_y); UpdateArcs(child, FALSE); } *************** *** 1165,1170 **** --- 1194,1201 ---- for (i = 0; i < graph->composite.num_children; i++) { Widget child = graph->composite.children[i]; + if (XtClass(child) == xmArcWidgetClass) + continue; if (XtIsManaged (child)) { min_width = MAX (min_width, RX(child) + RWidth(child) + RBorder(child) * 2); *************** *** 1234,1244 **** if (graph->graph.edit_mode ) for (i = 0 ; i < graph->composite.num_children; i++) ! MakeEditable(graph->composite.children[i]); else for (i = 0 ; i < graph->composite.num_children; i++) ! MakeReadOnly(graph->composite.children[i]); ! if (XtIsRealized (graph)) { --- 1265,1282 ---- if (graph->graph.edit_mode ) for (i = 0 ; i < graph->composite.num_children; i++) ! { ! Widget child = graph->composite.children[i]; ! if (XtClass(child) != xmArcWidgetClass) ! MakeEditable(child); ! } else for (i = 0 ; i < graph->composite.num_children; i++) ! { ! Widget child = graph->composite.children[i]; ! if (XtClass(child) != xmArcWidgetClass) ! MakeReadOnly(child); ! } if (XtIsRealized (graph)) { *************** *** 1609,1616 **** { for (i = 0; i< new->composite.num_children; i++) ! UpdateArcs(new->composite.children[i], FALSE); ! redraw = TRUE; } --- 1647,1657 ---- { for (i = 0; i< new->composite.num_children; i++) ! { ! Widget child = new->composite.children[i]; ! if (XtClass(child) != xmArcWidgetClass) ! UpdateArcs(child, FALSE); ! } redraw = TRUE; } *************** *** 1707,1720 **** if ( new->graph.edit_mode && !current->graph.edit_mode ) for (i = 0 ; i < new->composite.num_children; i++) ! MakeEditable(new->composite.children[i]); ! /* restore node widget's event mask */ if (!new->graph.edit_mode && current->graph.edit_mode) for (i = 0 ; i < current->composite.num_children; i++) ! MakeReadOnly(new->composite.children[i]); if(needs_relayout) { XmGraphLayout(new_w); --- 1748,1768 ---- if ( new->graph.edit_mode && !current->graph.edit_mode ) for (i = 0 ; i < new->composite.num_children; i++) ! { ! Widget child = new->composite.children[i]; ! if (XtClass(child) != xmArcWidgetClass) ! MakeEditable(child); ! } /* restore node widget's event mask */ if (!new->graph.edit_mode && current->graph.edit_mode) for (i = 0 ; i < current->composite.num_children; i++) ! { ! Widget child = new->composite.children[i]; ! if (XtClass(child) != xmArcWidgetClass) ! MakeReadOnly(child); ! } if(needs_relayout) { XmGraphLayout(new_w); *************** *** 2030,2035 **** --- 2078,2084 ---- /* All geometry is handled directly by graph widget */ XtSetMappedWhenManaged (w, FALSE); + } else { *************** *** 2050,2055 **** --- 2099,2105 ---- else MakeReadOnly(w); + } children = graph->composite.children; if (graph->composite.insert_position != NULL) *************** *** 2078,2084 **** /* make a new node, with this node widget */ ! } } #ifndef _NO_PROTO --- 2128,2134 ---- /* make a new node, with this node widget */ ! } #ifndef _NO_PROTO *************** *** 6647,6652 **** --- 6697,6704 ---- NodePtr next; w = graph->composite.children[i]; + if (XtClass(w) == xmArcWidgetClass) + continue; if(!XmBeingDestroyed(w)) { next = NODEPTR (w); *************** *** 6678,6683 **** --- 6730,6737 ---- for (i = 0; i < graph->composite.num_children; i++) { Widget child = graph->composite.children[i]; + if (XtClass(child) == xmArcWidgetClass) + continue; if(!XmBeingDestroyed(child)) { next = NODEPTR (child); *************** *** 6696,6701 **** --- 6750,6757 ---- for (i = 0; i < graph->composite.num_children; i++) { Widget child = graph->composite.children[i]; + if (XtClass(child) == xmArcWidgetClass) + continue; if(!XmBeingDestroyed(child)) { next = NODEPTR(child); *************** *** 7278,7284 **** for (position = 0; position < graph->composite.num_children; position++) { ! if (graph->composite.children[position] == w) { break; } } --- 7334,7345 ---- for (position = 0; position < graph->composite.num_children; position++) { ! Widget child = graph->composite.children[position]; ! /* ! if (XtClass(child) == xmArcWidgetClass) ! continue; ! */ ! if (child == w) { break; } } *************** *** 7823,7828 **** --- 7884,7893 ---- for (i = 1; i < graph->composite.num_children; i++) { Widget child = graph->composite.children[i]; + + if (XtClass(child) == xmArcWidgetClass) + continue; + if (XmIsGadget(child) && XtIsManaged(child)) { if(rect.x < RX(child) + RWidth(child) && *************** *** 7850,7855 **** --- 7915,7923 ---- for (i = 1; i < graph->composite.num_children; i++) { Widget child = graph->composite.children[i]; + if (XtClass(child) == xmArcWidgetClass) + continue; + if (XmIsGadget(child) && XtIsManaged(child)) { if (XRectInRegion (region, RX(child), RY(child), *************** *** 8001,8007 **** } for (i = 0 ; i < graph->composite.num_children ; i++) ! { childW = graph->composite.children[i]; if (RectangleIn == XRectInRegion (region, RX(childW), RY(childW), --- 8069,8078 ---- } for (i = 0 ; i < graph->composite.num_children ; i++) ! { ! childW = graph->composite.children[i]; ! if (XtClass(childW) == xmArcWidgetClass) ! continue; if (RectangleIn == XRectInRegion (region, RX(childW), RY(childW), *************** *** 8467,8474 **** for (i = 0; i < n_nodes; i++) { ! if(graph->composite.children[i] != graph->graph.root->widget) ! XtDestroyWidget(nodes[i]); } XtFree( (char *)nodes); --- 8538,8548 ---- for (i = 0; i < n_nodes; i++) { ! Widget child = graph->composite.children[i]; ! if (XtClass(child) == xmArcWidgetClass) ! continue; ! if(child != graph->graph.root->widget) ! XtDestroyWidget(child); } XtFree( (char *)nodes); *** Makefile.orig Fri Oct 30 17:35:58 1992 --- Makefile Sun Nov 1 02:54:41 1992 *************** *** 1,12 **** ! INCLUDES = -I/usr/include/Motif1.1 -I/usr/include/X11R4 -I/usr/local/include ! XLIBS = -L /usr/local/lib -lXm -lXt -lX11 ! CCROOT=/ ! CC=$(CCROOT)/bin/cc ! AS=$(CCROOT)/bin/as ! AR=$(CCROOT)/bin/ar ! LD=$(CCROOT)/bin/ld ! CFLAGS = -A -g -Wc,-Nd4000 -Wc,-Ns6000 -Wc,-Nt80000 -DSYSV -D_NO_PROTO -D_HPUX_SOURCE LIBNAME = libgraph.a --- 1,14 ---- ! MOTIF_HOME = /gnu/motif ! INCLUDES = -I${MOTIF_HOME}/includes/X11 -I${MOTIF_HOME}/includes -I/usr/includes ! XLIBS = -L/usr/local/lib -L${MOTIF_HOME} -lXm -lXt-R4 -lX11-R4 ! # CCROOT=/ ! # CC=$(CCROOT)/bin/cc ! # AS=$(CCROOT)/bin/as ! # AR=$(CCROOT)/bin/ar ! # LD=$(CCROOT)/bin/ld ! # CFLAGS = -A -g -Wc,-Nd4000 -Wc,-Ns6000 -Wc,-Nt80000 -DSYSV -D_NO_PROTO -D_HPUX_SOURCE ! CFLAGS = -g -D_NO_PROTO LIBNAME = libgraph.a *************** *** 22,27 **** --- 24,30 ---- $(LIBNAME): $(FILES) rm -f $(LIBNAME) $(AR) clq $(LIBNAME) $(FILES) + $(AR) ts $(LIBNAME) .s.a: $(AS) -o $*.o $< *************** *** 35,45 **** clobber: clean -rm -f $(LIBNAME) $(PROGS) ! gtest: gtest.o ! $(CC) $(CFLAGS) $(INCLUDES) -o gtest gtest.o $(LIBNAME) $(XLIBS) -lm ! sort: sort.o ! $(CC) $(CFLAGS) $(INCLUDES) -o sort sort.o $(LIBNAME) $(XLIBS) -lm Arc.o: Arc.h ArcP.h --- 38,48 ---- clobber: clean -rm -f $(LIBNAME) $(PROGS) ! gtest: gtest.o ! $(CC) $(CFLAGS) $(INCLUDES) -o gtest gtest.o $(LIBNAME) $(XLIBS) -lm ! sort: sort.o ! $(CC) $(CFLAGS) $(INCLUDES) -o sort sort.o $(LIBNAME) $(XLIBS) -lm Arc.o: Arc.h ArcP.h