v02i002: A program for view 16 bit digital signals, Part01/02

Mike Wexler mikew at wyse.wyse.com
Sat Oct 15 04:41:56 AEST 1988


Submitted-by: gatech.edu!gt-eedsp!jensen
Posting-number: Volume 2, Issue 2
Archive-name: xscope/part01

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 2)."
# Contents:  README AUTHOR AddSignal.c CanvasExposed.c CanvasSelected.c
#   Draw.c FilePopup.c InitCanvas.c InitCmd.c InitEnd.c
#   InitFilePopup.c InitSignal.c InitStart.c InitStylePopup.c
#   InitWidgets.c InsertSignal.c Makefile NewSignal.c OpenSignal.c
#   ReadSig.c SaveMSignal.c SaveSignal.c Scrolled2.c StylePopup.c
#   xscope.c xscope.man xsignal.h
# Wrapped by mikew at wyse on Fri Oct 14 11:39:48 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(1350 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
XDisclaimer: This is my first X program.
X
XThis program is to be distributed freely.  Since it is a preliminary
Xversion of a project I intend to continue to improve, no restrictions
Xare being placed on the use of this software.  Anyone who tries to
Xsell this as a product should be shot.  It is intended more as an example
Xof the use of the X Toolkit and the Athena Widget set.
X
XPlease feel free to inform me of any problems you encounter with this program.
XI would also welcome suggestions as to new features and code to implement
Xnew features.  Anything submitted will be freely re-distributed with
Xfuture versions of the program.
X
XThe program was originally written on a Vax running BSD 4.2 but also
Xseems to run OK on a uVax under Ultrix and a Multiflow Trace under
XBSD4.3.  Some versions of some window managers cause problems with
Xwindow positioning and Dialog widget interaction.  The program has
Xbeen used under twm.  The awm manager causes some problems.
XBEFORE REPORTING A BUG, PLEASE CHECK THE PROBLEM WITHOUT A WINDOW
XMANAGER RUNNING !
X
XI will be developing a whole series of X based programs for use in
XDSP research that will be freely distributed to universities
Xand contributed to the X consortium.
X
XI will try to keep a current version on gatech.edu for anonymous ftp.
X
XP. Allen Jensen, Research Scientist II
Xjensen at gt-eedsp.gatech.edu
END_OF_FILE
if test 1350 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'AUTHOR' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'AUTHOR'\"
else
echo shar: Extracting \"'AUTHOR'\" \(1533 characters\)
sed "s/^X//" >'AUTHOR' <<'END_OF_FILE'
X(Message inbox:814)
XReturn-Path: gt-eedsp!jensen at gatech.edu
XReceived: from wyse  by x2.wyse.com (5.58/Wyse client/5-13-88)
X	id AA20593; Thu, 6 Oct 88 23:16:44 PDT
XReceived: from x2  by wyse.wyse.com (5.58/Wyse master/5-13-88)
X	id AA21293; Thu, 6 Oct 88 23:16:15 PDT
XReceived: from wyse  by x2.wyse.com (5.58/Wyse client/5-13-88)
X	id AA20584; Thu, 6 Oct 88 23:16:19 PDT
XReceived:  by wyse.wyse.com (5.58/Wyse master/5-13-88)
X	id AA21268; Thu, 6 Oct 88 23:15:41 PDT
XReceived: from gatech.edu by uunet.UU.NET (5.59/1.14) 
X	id AA03715; Thu, 6 Oct 88 22:01:45 EDT
XReceived: from gt-eedsp.UUCP by gatech.edu with UUCP (5.58/7.3.GT)
X	id AA28425; Thu, 6 Oct 88 15:13:28 EDT
XReceived: by gt-eedsp (4.30GT/7.4.GT)
X	id AA22954; Thu, 6 Oct 88 13:32:50 EDT
XTo: comp-sources-x at gatech.edu
XPath: gt-eedsp!jensen
XFrom: gt-eedsp!jensen at gatech.edu (P. Allen Jensen)
XNewsgroups: comp.sources.x
XSubject: xscope - A program for viewing 16 bit digital signals: part 1/4
XKeywords: X11R2,Xt,Xaw
XMessage-Id: <505 at gt-eedsp.UUCP>
XDate: 6 Oct 88 17:32:47 GMT
XOrganization: Georgia Institute of Technology
XLines: 1619
X
X
XThis is the program I mentioned in comp.windows.x for viewing signals.
XIt must be unpacked in order.  It also includes the MenuPane source which
Xhas been previously posted.  There are makefiles and man pages.  As this
Xis my first contribution to comp.sources.x, please let me know if this
Xposting format is OK.
X
XP. Allen Jensen, Research Scientist II
XSchool of Electrical Engineering
XGeorgia Institute of Technology
Xjensen at gt-eedsp.gatech.edu
END_OF_FILE
if test 1533 -ne `wc -c <'AUTHOR'`; then
    echo shar: \"'AUTHOR'\" unpacked with wrong size!
fi
# end of 'AUTHOR'
fi
if test -f 'AddSignal.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'AddSignal.c'\"
else
echo shar: Extracting \"'AddSignal.c'\" \(2353 characters\)
sed "s/^X//" >'AddSignal.c' <<'END_OF_FILE'
X#include "xsignal.h"
Xextern char *malloc();
X
X/* ARGSUSED */
Xvoid AddSignal(widget, pane, callData)
X    Widget widget;
X    sigbox *pane;
X    caddr_t callData;
X{
X    char *signalfile;
X    int fd,mask,nbytes,firstb,firsts, newsamp;
X    float top,shown;
X    char snsamp[30], *newdata;
X    Signal newsig;
X    Arg arg[4];
X
X    signalfile = XtDialogGetValueString( XtParent(widget));
X    mask = 0644;
X    if( (fd = open(signalfile,O_RDONLY,mask)) == -1) {
X	perror(signalfile);
X        fprintf(stderr,"Signal file '%s' cannot be opened\n",signalfile);
X	return;
X    }
X    newsig = read_signal(fd);
X    close(fd);
X    if(pane->s == NULL) {
X	pane->s = newsig;
X	newsamp = 0;
X    } else {
X        newdata = (char *) malloc(pane->s->sig_len + newsig->sig_len);
X	/* Copy first part of old data */
X	nbytes = (pane->lmark + 1) * sizeof(short);
X	firstb = 0;
X	bcopy(&pane->s->sig_data[0],&newdata[firstb],nbytes);
X	/* Add new data */
X	firstb = nbytes;
X	nbytes = newsig->sig_len;
X	newsamp = newsig->sig_nsamp;
X	bcopy(&newsig->sig_data[0],&newdata[firstb],nbytes);
X	/* Now get the rest of the old data */
X	firstb += newsig->sig_len;
X	nbytes = pane->s->sig_len - ((pane->lmark + 1) * sizeof(short));
X	firsts = (pane->lmark + 1) * sizeof(short);
X	bcopy(&pane->s->sig_data[firsts],&newdata[firstb],nbytes);
X	/* Set the new length, free the old data and replace with newdata */
X	pane->s->sig_len += newsig->sig_len;
X	pane->s->sig_nsamp = pane->s->sig_len / sizeof(short);
X	free(pane->s->sig_data);
X	pane->s->sig_data = newdata;
X	free(newsig->sig_data);
X	free(newsig);
X    }
X    XtDestroyWidget(pane->file);
X    pane->file = (Widget) NULL;
X    pane->lmark = pane->first;
X    pane->last +=  newsamp;
X    pane->rmark = pane->last;
X    sprintf(snsamp,"%d Samples", pane->s->sig_nsamp);
X    XtSetArg(arg[0], XtNlabel, snsamp );
X    XtSetValues( pane->text_nsamp, arg, ONE );
X    sprintf(snsamp,"%d", pane->s->sig_nsamp);
X    XtSetValues( pane->endval, arg, ONE );
X    XtSetSensitive(pane->draw, True);
X    XtSetSensitive(pane->dstart, True);
X    XtSetSensitive(pane->dlast, True);
X    XtSetSensitive(pane->sb_start, True);
X    XtSetSensitive(pane->sb_last, True);
X    XtSetSensitive(pane->canvas, True);
X    XtSetSensitive(pane->style_button, True);
X    XtSetSensitive(pane->zoomcmd, True);
X    XtSetSensitive(pane->delcmd, True);
X    XtCallCallbacks(pane->draw,XtNcallback,NULL);
X}
END_OF_FILE
if test 2353 -ne `wc -c <'AddSignal.c'`; then
    echo shar: \"'AddSignal.c'\" unpacked with wrong size!
fi
# end of 'AddSignal.c'
fi
if test -f 'CanvasExposed.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'CanvasExposed.c'\"
else
echo shar: Extracting \"'CanvasExposed.c'\" \(363 characters\)
sed "s/^X//" >'CanvasExposed.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
Xvoid canvas_exposed(canvas,event,params,nparams)
X	Widget		canvas;
X	XExposeEvent	*event;
X	String		*params;
X	Cardinal	*nparams;
X{
X	sigbox *pane;
X
X	/* Compress Events, only respond to count=0 event */
X	if( event->count != 0 ) return;
X	pane = panefromcanvas(canvas);
X	if(pane->s == NULL) return;
X	XtCallCallbacks(pane->draw,XtNcallback,NULL);
X}
END_OF_FILE
if test 363 -ne `wc -c <'CanvasExposed.c'`; then
    echo shar: \"'CanvasExposed.c'\" unpacked with wrong size!
fi
# end of 'CanvasExposed.c'
fi
if test -f 'CanvasSelected.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'CanvasSelected.c'\"
else
echo shar: Extracting \"'CanvasSelected.c'\" \(1571 characters\)
sed "s/^X//" >'CanvasSelected.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
X/* Set up callback proc for canvas label so that the sigpane structure
X   can be determined.  How to get the event data back ?  Lets try a
X   global variable - this code is not re-enterable or recursive ! */
X
Xvoid canvas_selected(canvas, event, params, nparams)
X	Widget		canvas;
X	XButtonEvent	*event;
X	String		*params;
X	Cardinal	*nparams;
X{
X	register int	x, y, t;
X	int nsamp, value;
X	char		buf[1], labval[40];
X	XButtonPressedEvent	*be = (XButtonPressedEvent *)event;
X	XKeyPressedEvent	*ke = (XKeyPressedEvent *)event;
X	Arg arg[10];
X	sigbox *pane;
X
X	pane = panefromcanvas(canvas);
X        if( pane->s == NULL ) return;
X	x = event->x;
X	y = event->y;
X	switch (event->type)
X	{
X	case MotionNotify:
X		/* Canvas moved */
X		/* fprintf(stderr,"Mouse moved, x=%d y=%d\n",x,y); */
X		break;
X	case ButtonPress:
X		if (be->button == Button1) {
X			MapSample(pane,x,y,&nsamp, &value);
X			if( nsamp > pane->rmark ) return;
X			UnMark(pane,pane->lmark);
X			pane->lmark=nsamp;
X			Mark(pane,pane->lmark);
X		} else if (be->button == Button2) {
X			MapSample(pane,x,y,&nsamp, &value);
X			sprintf(&labval[0],"Sample %d Value %d",nsamp,value);
X	    		XtSetArg( arg[0], XtNlabel, &labval[0]);
X			XtSetValues(pane->picksamp, arg, ONE);
X		} else if (be->button == Button3) {
X			MapSample(pane,x,y,&nsamp, &value);
X			if( nsamp < pane->lmark ) return;
X			UnMark(pane,pane->rmark);
X			pane->rmark=nsamp;
X			Mark(pane,pane->rmark);
X		}
X		break;
X	case KeyPress:
X		if (XLookupString(ke, buf, sizeof(buf), NULL, NULL) > 0)
X			fprintf(stderr,"Key '%c' pressed\n",buf[0]);
X		break;
X	}
X}
END_OF_FILE
if test 1571 -ne `wc -c <'CanvasSelected.c'`; then
    echo shar: \"'CanvasSelected.c'\" unpacked with wrong size!
fi
# end of 'CanvasSelected.c'
fi
if test -f 'Draw.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Draw.c'\"
else
echo shar: Extracting \"'Draw.c'\" \(2189 characters\)
sed "s/^X//" >'Draw.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
X/* ARGSUSED */
Xvoid Draw(widget,pane,callData)
X    Widget widget;
X    sigbox *pane;
X    caddr_t callData;
X{
X    int x1,y1,x2,y2,i, oldx1, hincr, nscan;
X    int height,width, nsamp, halfheight, maxsamp;
X    int start_samp, end_samp;
X    float xincr, x;
X    short *data;
X    char sstart[30], slast[30];
X    XPoint *vlist;
X    Arg args[3];
X
X#define Sig pane->s
X#define Start pane->sb_start
X#define Last pane->sb_last
X#define Canvas pane->canvas
X#define GCCache pane->gccache
X
X    XClearArea(XtDisplay(Canvas), XtWindow(Canvas), 0,0,0,0,False);
X
X    if(Sig == NULL) return;
X
X    XtSetArg(args[0], XtNwidth, &width);
X    XtSetArg(args[1], XtNheight, &height);
X    XtGetValues(Canvas, args, TWO);
X    width += 1;
X    height += 1;
X    start_samp = pane->first;
X    end_samp = pane->last;
X    nsamp = end_samp - start_samp + 1;
X
X    xincr = ((float) width) / ((float) nsamp);
X    data = ((short *) Sig->sig_data)+start_samp;
X    vlist = (XPoint *) malloc(sizeof(XPoint) * Sig->sig_nsamp);
X
X#define MAXVAL (32768L)
X
X    for(i=start_samp, x=0; i <= end_samp; ++i, x = x+xincr, ++data) {
X	vlist[i].x = x+.5;
X        y1 = ((((int) *data)+MAXVAL) * height) >> 16L;
X        vlist[i].y = height-y1;
X    }
X    if(pane->style == CONTINUOUS) {
X	XDrawLines(XtDisplay(Canvas), XtWindow(Canvas), GCCache[PAINT],
X		&vlist[start_samp], nsamp, CoordModeOrigin);
X    } else if (pane->style == DISCRETE) {
X	y1 = height/2;
X	for( i = start_samp; i<end_samp; ++i ) {
X	    XDrawLine(XtDisplay(Canvas), XtWindow(Canvas), GCCache[PAINT],
X			vlist[i].x,y1,vlist[i].x,vlist[i].y);
X	}
X    }
X
X    x1=1 ; y1=height/2; x2=width; y2=y1;
X    XDrawLine(XtDisplay(Canvas), XtWindow(Canvas), GCCache[PAINT], x1,y1,x2,y2);
X    x1=1 ; y1=1; x2=1; y2=height;
X    XDrawLine(XtDisplay(Canvas), XtWindow(Canvas), GCCache[PAINT], x1,y1,x2,y2);
X    hincr = height/20;
X    x1=1; x2=5;
X    for(y1=y2=height/2; y1>0; y1=y2=y1-hincr){
X      XDrawLine(XtDisplay(Canvas),XtWindow(Canvas),GCCache[PAINT], x1,y1,x2,y2);
X    }
X    for(y1=y2=height/2; y1<=height; y1=y2=y1+hincr){
X      XDrawLine(XtDisplay(Canvas),XtWindow(Canvas),GCCache[PAINT], x1,y1,x2,y2);
X    }
X    Mark(pane, pane->lmark);
X    Mark(pane, pane->rmark);
X}
END_OF_FILE
if test 2189 -ne `wc -c <'Draw.c'`; then
    echo shar: \"'Draw.c'\" unpacked with wrong size!
fi
# end of 'Draw.c'
fi
if test -f 'FilePopup.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'FilePopup.c'\"
else
echo shar: Extracting \"'FilePopup.c'\" \(1108 characters\)
sed "s/^X//" >'FilePopup.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
Xextern sigbox *panefromfb();
X/* ARGSUSED */
Xvoid
Xfile_popup(w, event, params, num_params)
XWidget w;
XXEvent *event; /* unused */
XString *params;
XCardinal *num_params;
X{
X	/* position the menu, whose name was passed as the first and only
X	 * parameter at position (20,5) relative to the Widget w.
X	 */
X	sigbox *pane;
X	Widget a_shell,wt;
X	Window child;
X	int x, y, wide;
X	Arg args[2];
X
X	if (*num_params != 1)
X		XtError("Wrong parameter count passed to file_popup()");
X
X	/* get the internal Widget id of the named shell */
X	pane = panefromfb(w);
X	a_shell = pane->file_popup;
X
X	if (a_shell == NULL)
X		XtError("Wrong shell name passed to file_popup()");
X
X	XtSetArg(args[0], XtNheight, &y);
X	XtGetValues(w, (ArgList)args, 1);
X	XTranslateCoordinates(XtDisplay(w), XtWindow(w),
X		XDefaultRootWindow(XtDisplay(w)),
X		0,y,&x,&y,&child);
X
X	/* currently this is the only way to move created shells */
X	XtMoveWidget(a_shell, x, y);
X	/* R3 needs just the next section, not the preceeding line */
X/*
X	XtSetArg(args[0], XtNx, x);
X	XtSetArg(args[1], XtNy, y);
X	XtSetValues(a_shell, (ArgList)args, 2);
X*/
X}
END_OF_FILE
if test 1108 -ne `wc -c <'FilePopup.c'`; then
    echo shar: \"'FilePopup.c'\" unpacked with wrong size!
fi
# end of 'FilePopup.c'
fi
if test -f 'InitCanvas.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'InitCanvas.c'\"
else
echo shar: Extracting \"'InitCanvas.c'\" \(1200 characters\)
sed "s/^X//" >'InitCanvas.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
XXtActionsRec canvas_actions[] =
X{
X	{ "Event", (XtActionProc)canvas_selected },
X	{ "Expose", (XtActionProc)canvas_exposed },
X};
X
X/*
Xstatic String canvas_translations =
X	"<Motion>:Event()\n\
X	<Btn1Down>:Event()\n\
X	<Btn2Down>:Event()\n\
X	<Btn3Down>:Event()\n\
X	<Key>:Event()\n\
X	<Expose>:Expose()\n";
X*/
Xstatic String canvas_translations =
X	"<Btn1Down>:Event()\n\
X	<Btn2Down>:Event()\n\
X	<Btn3Down>:Event()\n\
X	<Key>:Event()\n\
X	<Expose>:Expose()\n";
X
Xvoid init_canvas(pane)
X    sigbox *pane;
X{
X    static XtCallbackRec callback[2]; /* K&R: initialized to NULL */
X    static XtCallbackRec thumbcall[2]; /* K&R: initialized to NULL */
X    float shown,top;
X    Widget box;
X    int narg;
X    Arg arg[10];
X
X    narg = 0;
X    XtSetArg( arg[narg], XtNwidth, WIDTH ); narg++;
X    XtSetArg( arg[narg], XtNheight, CHEIGHT ); narg++;
X    XtSetArg( arg[narg], XtNlabel, ""); narg++;
X    XtSetArg( arg[narg], XtNsensitive, False ); narg++;
X    pane->canvas = XtCreateManagedWidget( "label", labelWidgetClass,
X					pane->outer, arg, narg );
X    XtAddActions(canvas_actions, XtNumber(canvas_actions));
X    XtOverrideTranslations(pane->canvas,
X		XtParseTranslationTable(canvas_translations));
X}
END_OF_FILE
if test 1200 -ne `wc -c <'InitCanvas.c'`; then
    echo shar: \"'InitCanvas.c'\" unpacked with wrong size!
fi
# end of 'InitCanvas.c'
fi
if test -f 'InitCmd.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'InitCmd.c'\"
else
echo shar: Extracting \"'InitCmd.c'\" \(2270 characters\)
sed "s/^X//" >'InitCmd.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
Xvoid init_cmd(pane)
X    sigbox *pane;
X{
X    static XtCallbackRec callback[2]; /* K&R: initialized to NULL */
X    static XtCallbackRec thumbcall[2]; /* K&R: initialized to NULL */
X    Widget cmds,pb1;
X    int narg;
X    Arg arg[10];
X
X    narg = 0;
X    XtSetArg( arg[narg], XtNvertPane, FALSE); narg++;
X    XtSetArg( arg[narg], XtNwidth, WIDTH ); narg++;
X    XtSetArg( arg[narg], XtNheight, MENUHIGH); narg++;
X    cmds = XtCreateManagedWidget("cmds", menuPaneWidgetClass,
X			pane->box, arg, narg);
X
X    callback[0].callback = QuitPane;
X    callback[0].closure = (caddr_t) pane;
X    narg = 0;
X    XtSetArg( arg[narg], XtNcallback, callback ); narg++;
X    XtSetArg( arg[narg], XtNlabel, "quit" ); narg++;
X    XtCreateManagedWidget( "file", commandWidgetClass,
X						cmds, arg, narg );
X    narg = 0;
X    XtSetArg( arg[narg], XtNlabel, "file" ); narg++;
X    pane->file_button = XtCreateManagedWidget( "file", commandWidgetClass,
X						cmds, arg, narg );
X    InitFilePopup(pane);
X
X    callback[0].callback = Draw;
X    callback[0].closure = (caddr_t) pane;
X    narg = 0;
X    XtSetArg( arg[narg], XtNcallback, callback ); narg++;
X    XtSetArg( arg[narg], XtNlabel, "redraw" ); narg++;
X    XtSetArg( arg[narg], XtNsensitive, False ); narg++;
X    pane->draw = XtCreateManagedWidget( "draw", commandWidgetClass,
X				cmds, arg, narg );
X
X    narg = 0;
X    XtSetArg( arg[narg], XtNlabel, "style" ); narg++;
X    pane->style_button = XtCreateManagedWidget( "style", commandWidgetClass,
X				cmds, arg, narg );
X    InitStylePopup(pane);
X
X    callback[0].callback = Zoom;
X    callback[0].closure = (caddr_t) pane;
X    narg = 0;
X    XtSetArg( arg[narg], XtNcallback, callback ); narg++;
X    XtSetArg( arg[narg], XtNlabel, "zoom in" ); narg++;
X    XtSetArg( arg[narg], XtNsensitive, False ); narg++;
X    pane->zoomcmd = XtCreateManagedWidget( "zoom", commandWidgetClass,
X				cmds, arg, narg );
X
X    callback[0].callback = DeleteSignal;
X    callback[0].closure = (caddr_t) pane;
X    narg = 0;
X    XtSetArg( arg[narg], XtNcallback, callback ); narg++;
X    XtSetArg( arg[narg], XtNlabel, "delete"); narg++;
X    XtSetArg( arg[narg], XtNsensitive, False ); narg++;
X    pane->delcmd = XtCreateManagedWidget("delete_marked", commandWidgetClass,
X				cmds, (ArgList)arg, narg);
X}
END_OF_FILE
if test 2270 -ne `wc -c <'InitCmd.c'`; then
    echo shar: \"'InitCmd.c'\" unpacked with wrong size!
fi
# end of 'InitCmd.c'
fi
if test -f 'InitEnd.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'InitEnd.c'\"
else
echo shar: Extracting \"'InitEnd.c'\" \(1596 characters\)
sed "s/^X//" >'InitEnd.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
Xvoid init_end(pane)
X    sigbox *pane;
X{
X    static XtCallbackRec callback[2]; /* K&R: initialized to NULL */
X    static XtCallbackRec thumbcall[2]; /* K&R: initialized to NULL */
X    float shown,top;
X    Widget box;
X    int narg;
X    Arg arg[10];
X
X    narg = 0;
X    box = XtCreateManagedWidget("bend", boxWidgetClass, pane->box,
X					arg, narg);
X    narg = 0;
X    XtSetArg( arg[narg], XtNlabel, "Ending Sample:" ); narg++;
X    XtSetArg( arg[narg], XtNvalue, "" ); narg++;
X    pane->dlast = XtCreateManagedWidget("last", dialogWidgetClass,
X					box, arg, narg);
X	callback[0].callback = NewEnd;
X	callback[0].closure = (caddr_t) pane;
X	narg = 0;
X	XtSetArg( arg[narg], XtNcallback, callback ); narg++;
X	XtSetArg( arg[narg], XtNlabel, "ok" ); narg++;
X	XtCreateManagedWidget("ok", commandWidgetClass,
X					pane->dlast, arg, narg);
X
X	narg = 0;
X	XtSetArg( arg[narg], XtNlabel, "0"); narg++;
X	pane->endval = XtCreateManagedWidget( "label", labelWidgetClass,
X					box, arg, narg );
X        callback[0].callback = Scrolled2;
X        callback[0].closure = (caddr_t) pane;
X        thumbcall[0].callback = Thumbed2;
X        thumbcall[0].closure = (caddr_t) pane;
X	narg = 0;
X        XtSetArg( arg[narg], XtNlength, 200 ); narg++;
X        XtSetArg( arg[narg], XtNscrollProc, callback ); narg++;
X        XtSetArg( arg[narg], XtNthumbProc, thumbcall ); narg++;
X        XtSetArg( arg[narg], XtNorientation, XtorientHorizontal ); narg++;
X	XtSetArg( arg[narg], XtNsensitive, False ); narg++;
X        pane->sb_last = XtCreateManagedWidget("sb_last", scrollbarWidgetClass,
X					box, arg,narg);
X
X}
END_OF_FILE
if test 1596 -ne `wc -c <'InitEnd.c'`; then
    echo shar: \"'InitEnd.c'\" unpacked with wrong size!
fi
# end of 'InitEnd.c'
fi
if test -f 'InitFilePopup.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'InitFilePopup.c'\"
else
echo shar: Extracting \"'InitFilePopup.c'\" \(3396 characters\)
sed "s/^X//" >'InitFilePopup.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
Xvoid OpenSignal();
Xvoid InsertSignal();
Xvoid SaveSignal();
Xvoid SaveMarkedSignal();
Xvoid file_popup();
X
X/* translations for the button to popup the menu
X * file_popup positions the shell.
X * MenuPopup realizes the shell.
X */
Xstatic String pb_Trans =
X	"<EnterWindow>:	highlight() \n\
X	 <LeaveWindow>: unhighlight() \n\
X	 <Btn1Down>:	file_popup(%s) MenuPopup(%s)";
X
X/* translations for the command buttons of the popup menu
X * the command callback is invoked when the button is released with
X * the pointer in the command widget.
X */
Xstatic String cb_Trans =
X	"<EnterWindow>:	set() \n\
X	 <LeaveWindow>: unset() \n\
X	 <Btn1Up>:	notify()";
X
X/* translations for the shell of the popup menu.
X * when the button is released the shell catches it and pops itself down.
X */
Xstatic String pm_Trans =
X	"<LeaveWindow>:	MenuPopdown()";
X
X/* new actions added by this program */
Xstatic XtActionsRec menu_actions[] = {
X	{ "file_popup",	file_popup },
X};
Xstatic char *popup_menu_name = "file_popup";
Xvoid
XInitFilePopup(pane)
Xsigbox *pane;
X{
X	static XtCallbackRec b_callbacks[2];
X	Arg args[6];
X	Cardinal i = 0;
X	char ptrans[250];
X	Widget pop_layout;
X
X	XtAddActions((XtActionList)menu_actions, XtNumber(menu_actions));
X
X	/* create the translations for the button which pops up the menu */
X	/* we pass the name of the popup menu to both file_popup and MenuPopup*/
X	(void)sprintf(ptrans, pb_Trans, popup_menu_name, popup_menu_name);
X	i = 0;
X	XtSetArg(args[i],XtNtranslations, XtParseTranslationTable(ptrans)); i++;
X	XtSetValues(pane->file_button, args, i);
X
X	/* create the popup menu ... its shell, its layout widget and the menu
X	 * buttons it holds.
X	 */
X	i = 0;
X	XtSetArg(args[i],XtNtranslations,XtParseTranslationTable(pm_Trans));i++;
X	pane->file_popup = XtCreatePopupShell("file_popup",
X				overrideShellWidgetClass, pane->file_button,
X				(ArgList)args,i);
X
X	i = 0;
X	XtSetArg(args[i], XtNheight, 4*MENUHIGH); i++;
X	XtSetArg(args[i], XtNwidth, 70); i++;
X	XtSetArg(args[i], XtNvertPane, TRUE); i++;
X	pop_layout = XtCreateManagedWidget("layout", menuPaneWidgetClass,
X					pane->file_popup, (ArgList)args, i);
X
X	i = 0;
X	XtSetArg(args[i], XtNwidth, 70); i++;
X	XtSetArg(args[i], XtNheight, MENUHIGH); i++;
X
X	/* set the translations for the buttons of the menu.
X	 * Set on window entry. Unset on window leave.
X	 * Call the callback when button 1 is released.
X	 */
X	XtSetArg(args[i],XtNtranslations,XtParseTranslationTable(cb_Trans));i++;
X	XtSetArg(args[i], XtNcallback, b_callbacks); i++;
X	XtSetArg(args[i], XtNlabel, "open"); i++;
X	b_callbacks[0].callback = OpenSignal;
X	b_callbacks[0].closure = (caddr_t) pane;
X	XtCreateManagedWidget("new_signal", commandWidgetClass,
X						pop_layout, (ArgList)args, i);
X
X	i = 5;
X	XtSetArg(args[4], XtNlabel, "insert");
X	b_callbacks[0].callback = InsertSignal;
X	b_callbacks[0].closure = (caddr_t) pane;
X	XtCreateManagedWidget("insert_signal", commandWidgetClass,
X						pop_layout, (ArgList)args, i);
X
X	i = 5;
X	XtSetArg(args[4], XtNlabel, "save");
X	b_callbacks[0].callback = SaveSignal;
X	b_callbacks[0].closure = (caddr_t) pane;
X	XtCreateManagedWidget("save_signal", commandWidgetClass,
X						pop_layout, (ArgList)args, i);
X
X	i = 5;
X	XtSetArg(args[4], XtNlabel, "save marked");
X	b_callbacks[0].callback = SaveMarkedSignal;
X	b_callbacks[0].closure = (caddr_t) pane;
X	XtCreateManagedWidget("save_marked", commandWidgetClass,
X						pop_layout, (ArgList)args, i);
X
X}
END_OF_FILE
if test 3396 -ne `wc -c <'InitFilePopup.c'`; then
    echo shar: \"'InitFilePopup.c'\" unpacked with wrong size!
fi
# end of 'InitFilePopup.c'
fi
if test -f 'InitSignal.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'InitSignal.c'\"
else
echo shar: Extracting \"'InitSignal.c'\" \(1133 characters\)
sed "s/^X//" >'InitSignal.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
Xstatic sigbox *lastpane = NULL;
X
Xsigbox *panefromsb(style_button)
X   Widget style_button;
X{
X    sigbox *pane;
X
X    pane = lastpane;
X    while(pane != NULL) {
X	if( pane->style_button == style_button ) return pane;
X	pane = pane->nextpane;
X    }
X    return NULL;
X}
X
Xsigbox *panefromfb(file_button)
X   Widget file_button;
X{
X    sigbox *pane;
X
X    pane = lastpane;
X    while(pane != NULL) {
X	if( pane->file_button == file_button ) return pane;
X	pane = pane->nextpane;
X    }
X    return NULL;
X}
X
Xsigbox *panefromcanvas(canvas)
X   Widget canvas;
X{
X    sigbox *pane;
X
X    pane = lastpane;
X    while(pane != NULL) {
X	if( pane->canvas == canvas ) return pane;
X	pane = pane->nextpane;
X    }
X    return NULL;
X}
X
Xvoid init_signal(pane)
X    sigbox *pane;
X{
X    static XtCallbackRec callback[2]; /* K&R: initialized to NULL */
X    static XtCallbackRec thumbcall[2]; /* K&R: initialized to NULL */
X    float shown,top;
X    Widget box;
X    int narg;
X    Arg arg[10];
X
X    pane->nextpane = lastpane;
X    lastpane = pane;
X
X    init_cmd(pane);
X    init_data(pane);
X    init_start(pane);
X    init_end(pane);
X    init_canvas(pane);
X}
END_OF_FILE
if test 1133 -ne `wc -c <'InitSignal.c'`; then
    echo shar: \"'InitSignal.c'\" unpacked with wrong size!
fi
# end of 'InitSignal.c'
fi
if test -f 'InitStart.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'InitStart.c'\"
else
echo shar: Extracting \"'InitStart.c'\" \(1548 characters\)
sed "s/^X//" >'InitStart.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
Xvoid init_start(pane)
X    sigbox *pane;
X{
X    static XtCallbackRec callback[2]; /* K&R: initialized to NULL */
X    static XtCallbackRec thumbcall[2]; /* K&R: initialized to NULL */
X    float shown,top;
X    Widget box;
X    int narg;
X    Arg arg[10];
X
X    narg = 0;
X    box = XtCreateManagedWidget("bstart", boxWidgetClass, pane->box,
X					arg, narg);
X
X    narg = 0;
X    XtSetArg( arg[narg], XtNlabel, "Starting Sample:" ); narg++;
X    XtSetArg( arg[narg], XtNvalue, "0" ); narg++;
X    pane->dstart = XtCreateManagedWidget("start", dialogWidgetClass, box,
X					arg, narg);
X	callback[0].callback = NewStart;
X	callback[0].closure = (caddr_t) pane;
X	narg = 0;
X	XtSetArg( arg[narg], XtNcallback, callback ); narg++;
X	XtSetArg( arg[narg], XtNlabel, "ok" ); narg++;
X	XtCreateManagedWidget("ok", commandWidgetClass,
X					pane->dstart, arg, narg);
X
X	narg = 0;
X	XtSetArg( arg[narg], XtNlabel, "0"); narg++;
X	pane->startval = XtCreateManagedWidget( "label", labelWidgetClass,
X					box, arg, narg );
X	callback[0].callback = Scrolled;
X	callback[0].closure = (caddr_t) pane;
X	thumbcall[0].callback = Thumbed;
X	thumbcall[0].closure = (caddr_t) pane;
X	narg = 0;
X	XtSetArg( arg[narg], XtNlength, 200 ); narg++;
X	XtSetArg( arg[narg], XtNscrollProc, callback ); narg++;
X	XtSetArg( arg[narg], XtNthumbProc, thumbcall ); narg++;
X	XtSetArg( arg[narg], XtNorientation, XtorientHorizontal ); narg++;
X	XtSetArg( arg[narg], XtNsensitive, False ); narg++;
X	pane->sb_start = XtCreateManagedWidget("sb_start", scrollbarWidgetClass,
X					box, arg,narg);
X
X}
END_OF_FILE
if test 1548 -ne `wc -c <'InitStart.c'`; then
    echo shar: \"'InitStart.c'\" unpacked with wrong size!
fi
# end of 'InitStart.c'
fi
if test -f 'InitStylePopup.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'InitStylePopup.c'\"
else
echo shar: Extracting \"'InitStylePopup.c'\" \(3189 characters\)
sed "s/^X//" >'InitStylePopup.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
Xvoid OpenSignal();
Xvoid InsertSignal();
Xvoid SaveSignal();
Xvoid SaveMarkedSignal();
X
X/* translations for the button to popup the menu
X * style_popup positions the shell.
X * MenuPopup realizes the shell.
X */
Xstatic String pb_Trans =
X	"<EnterWindow>:	highlight() \n\
X	 <LeaveWindow>: unhighlight() \n\
X	 <Btn1Down>:	style_popup(%s) MenuPopup(%s)";
X
X/* translations for the command buttons of the popup menu
X * the command callback is invoked when the button is released with
X * the pointer in the command widget.
X */
Xstatic String cb_Trans =
X	"<EnterWindow>:	set() \n\
X	 <LeaveWindow>: unset() \n\
X	 <Btn1Up>:	notify()";
X
X/* translations for the shell of the popup menu.
X * when the button is released the shell catches it and pops itself down.
X */
Xstatic String pm_Trans =
X	"<LeaveWindow>:	MenuPopdown()";
X
X/* new actions added by this program */
Xstatic XtActionsRec menu_actions[] = {
X	{ "style_popup",	style_popup },
X};
Xstatic char *popup_menu_name = "style_popup";
Xvoid
XInitStylePopup(pane)
Xsigbox *pane;
X{
X	static XtCallbackRec b_callbacks[2];
X	Arg args[6];
X	Cardinal i = 0;
X	char ptrans[250];
X	Widget pop_layout;
X
X	pane->style = CONTINUOUS;
X	XtAddActions((XtActionList)menu_actions, XtNumber(menu_actions));
X
X	/* create the translations for the button which pops up the menu */
X	/*we pass the name of the popup menu to both style_popup and MenuPopup*/
X	(void)sprintf(ptrans, pb_Trans, popup_menu_name, popup_menu_name);
X	i = 0;
X	XtSetArg(args[i],XtNtranslations, XtParseTranslationTable(ptrans)); i++;
X	XtSetValues(pane->style_button, args, i);
X
X	/* create the popup menu ... its shell, its layout widget and the menu
X	 * buttons it holds.
X	 */
X	i = 0;
X	XtSetArg(args[i],XtNtranslations,XtParseTranslationTable(pm_Trans));i++;
X	pane->style_popup = XtCreatePopupShell("style_popup",
X				overrideShellWidgetClass, pane->style_button,
X				(ArgList)args,i);
X
X	i = 0;
X	XtSetArg(args[i], XtNheight, 2*MENUHIGH); i++;
X	XtSetArg(args[i], XtNwidth, 70); i++;
X	XtSetArg(args[i], XtNvertPane, TRUE); i++;
X	pop_layout = XtCreateManagedWidget("layout", menuPaneWidgetClass,
X					pane->style_popup, (ArgList)args, i);
X
X	i = 0;
X	XtSetArg(args[i], XtNwidth, 70); i++;
X	XtSetArg(args[i], XtNheight, MENUHIGH); i++;
X
X	/* set the translations for the buttons of the menu.
X	 * Set on window entry. Unset on window leave.
X	 * Call the callback when button 1 is released.
X	 */
X	XtSetArg(args[i],XtNtranslations,XtParseTranslationTable(cb_Trans));i++;
X	XtSetArg(args[i], XtNcallback, b_callbacks); i++;
X	XtSetArg(args[i], XtNlabel, "continuous"); i++;
X	b_callbacks[0].callback = StyleCont;
X	b_callbacks[0].closure = (caddr_t) pane;
X	XtCreateManagedWidget("stylec", commandWidgetClass,
X						pop_layout, (ArgList)args, i);
X
X	i = 5;
X	XtSetArg(args[4], XtNlabel, "discrete");
X	b_callbacks[0].callback = StyleDisc;
X	b_callbacks[0].closure = (caddr_t) pane;
X	XtCreateManagedWidget("styled", commandWidgetClass,
X						pop_layout, (ArgList)args, i);
X
X}
X
Xvoid StyleDisc(button,pane,call_data)
XWidget button;
Xsigbox *pane;
Xcaddr_t call_data;
X{
X    pane->style = DISCRETE;
X}
X
Xvoid StyleCont(button,pane,call_data)
XWidget button;
Xsigbox *pane;
Xcaddr_t call_data;
X{
X    pane->style = CONTINUOUS;
X}
END_OF_FILE
if test 3189 -ne `wc -c <'InitStylePopup.c'`; then
    echo shar: \"'InitStylePopup.c'\" unpacked with wrong size!
fi
# end of 'InitStylePopup.c'
fi
if test -f 'InitWidgets.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'InitWidgets.c'\"
else
echo shar: Extracting \"'InitWidgets.c'\" \(1248 characters\)
sed "s/^X//" >'InitWidgets.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
Xvoid init_widgets(toplevel)
X    Widget toplevel;
X{
X    Widget outer;
X    Widget box0;
X    static XtCallbackRec callback[2]; /* K&R: initialized to NULL */
X    Arg arg[10];
X
X    outer = XtCreateManagedWidget( "vpaned", vPanedWidgetClass, toplevel,
X				   arg, NULL );
X
X    XtSetArg( arg[0], XtNlabel, "DSP Signal Display Program" );
X    XtCreateManagedWidget( "label", labelWidgetClass, outer, arg, ONE );
X
X    box0 = XtCreateManagedWidget( NULL, boxWidgetClass, outer, NULL, ZERO );
X
X    callback[0].callback = Quit;
X    callback[0].closure = (caddr_t)toplevel;
X    XtSetArg( arg[0], XtNcallback, callback );
X    XtSetArg( arg[1], XtNlabel, "quit" );
X    XtCreateManagedWidget( "quit", commandWidgetClass, box0, arg, TWO );
X
X    callback[0].callback = Scope;
X    callback[0].closure = (caddr_t)toplevel;
X    XtSetArg( arg[0], XtNcallback, callback );
X    XtSetArg( arg[1], XtNlabel, "scope" );
X    XtCreateManagedWidget( "scope", commandWidgetClass, box0, arg, TWO );
X
X    XtSetArg( arg[0], XtNlabel, "pole plot" );
X    XtCreateManagedWidget( "pole plot", commandWidgetClass, box0, arg, ONE );
X
X    XtSetArg( arg[0], XtNlabel, "spectragram" );
X    XtCreateManagedWidget( "spectragram", commandWidgetClass, box0, arg, ONE );
X}
END_OF_FILE
if test 1248 -ne `wc -c <'InitWidgets.c'`; then
    echo shar: \"'InitWidgets.c'\" unpacked with wrong size!
fi
# end of 'InitWidgets.c'
fi
if test -f 'InsertSignal.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'InsertSignal.c'\"
else
echo shar: Extracting \"'InsertSignal.c'\" \(1048 characters\)
sed "s/^X//" >'InsertSignal.c' <<'END_OF_FILE'
X#include "xsignal.h"
X/* ARGSUSED */
Xvoid InsertSignal(button, pane, data2)
X    Widget button;
X    sigbox *pane;
X    caddr_t data2; /* Unused */
X{
X    int i,x,y;
X    Arg arg[5];
X    static XtCallbackRec callback[2];
X    Widget dialog,child;
X
X    XTranslateCoordinates(XtDisplay(button), XtWindow(button),
X		XDefaultRootWindow(XtDisplay(button)),
X		5,5,&x,&y,&child);
X    i=0;
X    XtSetArg( arg[i], XtNx, x); i++;
X    XtSetArg( arg[i], XtNy, y); i++;
X    pane->file = XtCreateApplicationShell( "xfile", topLevelShellWidgetClass, arg, i );
X    i=0;
X    XtSetArg(arg[i], XtNlabel, "Signal File Name:                      "); i++;
X    XtSetArg(arg[i], XtNvalue, ""); i++;
X    dialog = XtCreateManagedWidget( "file", dialogWidgetClass, pane->file, arg, i );
X    callback[0].callback = AddSignal;
X    callback[0].closure = (caddr_t) pane;
X    i=0;
X    XtSetArg(arg[i], XtNlabel, "ok"); i++;
X    XtSetArg(arg[i], XtNcallback, callback); i++;
X    XtCreateManagedWidget( "file_ok",
X			commandWidgetClass, dialog, arg, i );
X    XtRealizeWidget(pane->file);
X}
END_OF_FILE
if test 1048 -ne `wc -c <'InsertSignal.c'`; then
    echo shar: \"'InsertSignal.c'\" unpacked with wrong size!
fi
# end of 'InsertSignal.c'
fi
if test -f 'Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(2320 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
XINSTDIR = /usr/new/usr/bin/X11
XMANSEC = n
XCC = cc
XCFLAGS = -O -I/usr/new/usr/include
XLIBS = -L/usr/new/usr/lib -lXaw -lXt -lX
XRM = /bin/rm
X# Where to find the MenuPane.o file(Previously posted to comp.sources.x)
XMENUPANE = ../menupane/MenuPane.o
X#
X# Routines dealing with Initialization
X#
XINITSRC = InitWidgets.c InitSignal.c GCInit.c InitCmd.c InitData.c \
X	InitStart.c InitEnd.c InitCanvas.c InitFilePopup.c InitStylePopup.c
XINITOBJ = InitWidgets.o InitSignal.o GCInit.o InitCmd.o InitData.o \
X	InitStart.o InitEnd.o InitCanvas.o InitFilePopup.o InitStylePopup.o
X#
X# Toplevel Command Widget routines
X#
XCMDSRC = Scope.c Quit.c Draw.c Zoom.c DeleteSignal.c
XCMDOBJ = Scope.o Quit.o Draw.o Zoom.o DeleteSignal.o
X#
X# Signal Starting Sample Selection
X#
XSTARTSRC = NewStart.c Scrolled.c Thumbed.c
XSTARTOBJ = NewStart.o Scrolled.o Thumbed.o
X#
X# Signal Ending Sample Selection
X#
XENDSRC = NewEnd.c Scrolled2.c Thumbed2.c
XENDOBJ = NewEnd.o Scrolled2.o Thumbed2.o
X#
X# Canvas Interaction
X#
XCANVASSRC = Mark.c UnMark.c CanvasSelected.c CanvasExposed.c
XCANVASOBJ = Mark.o UnMark.o CanvasSelected.o CanvasExposed.o
X#
X# Popup File Operations and Program Termination
X#
XFILESRC = NewSignal.c ReadSig.c OpenSignal.c SaveMSignal.c WriteMSignal.c \
X	SaveSignal.c WriteSignal.c QuitPane.c FilePopup.c \
X	InsertSignal.c AddSignal.c
XFILEOBJ = NewSignal.o ReadSig.o OpenSignal.o SaveMSignal.o WriteMSignal.o \
X	SaveSignal.o WriteSignal.o QuitPane.o FilePopup.o \
X	InsertSignal.o AddSignal.o
X#
X# Style Popup Sources
X#
XSTYLESRC = StylePopup.c
XSTYLEOBJ = StylePopup.o
X#
X# Misc. Routines used in various places
X#
XMISCSRC = MapSample.c SetThumbTop.c SetThumbShown.c Syntax.c
XMISCOBJ = MapSample.o SetThumbTop.o SetThumbShown.o Syntax.o
X#
X# Sources for xscope
X#
XSRCS = ${INITSRC} \
X	${CMDSRC} \
X	${STARTSRC} \
X	${ENDSRC} \
X	${CANVASSRC} \
X	${FILESRC} \
X	${STYLESRC} \
X	${MISCSRC}
X#
X# Object for xscope
X#
XOBJS = ${INITOBJ} \
X	${CMDOBJ} \
X	${STARTOBJ} \
X	${ENDOBJ} \
X	${CANVASOBJ} \
X	${FILEOBJ} \
X	${STYLEOBJ} \
X	${MISCOBJ}
X#
X# Include Files
X#
XINCS = xsignal.h
X#
X#
X#
Xall: xscope
Xxscope: xscope.o ${OBJS} ${MENUPANE} ${INCS}
X	$(CC) ${CFLAGS} -o $@ xscope.o $(OBJS) ${MENUPANE} ${LIBS}
X
X#
X# Clean up the directory
X#
Xclean:
X	${RM} ${OBJS} xscope.o
Xinstall: xscope
X	install -c xscope ${INSTDIR}/xscope
X	cp xscope.man /usr/man/man${MANSEC}/xscope.${MANSEC}
END_OF_FILE
if test 2320 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'NewSignal.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'NewSignal.c'\"
else
echo shar: Extracting \"'NewSignal.c'\" \(1477 characters\)
sed "s/^X//" >'NewSignal.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
X/* ARGSUSED */
Xvoid NewSignal(widget, pane, callData)
X    Widget widget;
X    sigbox *pane;
X    caddr_t callData;
X{
X    char *signalfile;
X    int fd,mask;
X    float top,shown;
X    char snsamp[30];
X    Arg arg[4];
X
X    signalfile = XtDialogGetValueString( XtParent(widget));
X    mask = 0644;
X    if( (fd = open(signalfile,O_RDONLY,mask)) == -1) {
X	perror(signalfile);
X        fprintf(stderr,"Signal file '%s' cannot be opened\n",signalfile);
X	return;
X    }
X    if(pane->s != NULL) {
X	if( pane->s->sig_data != NULL ) {
X	    free(pane->s->sig_data);
X	}
X	free(pane->s);
X    }
X    pane->s = read_signal(fd);
X    close(fd);
X    XtDestroyWidget(pane->file);
X    pane->file = (Widget) NULL;
X    pane->first = 0;
X    pane->lmark = pane->first;
X    pane->last = pane->s->sig_nsamp - 1;
X    pane->rmark = pane->last;
X    sprintf(snsamp,"%d Samples", pane->s->sig_nsamp);
X    XtSetArg(arg[0], XtNlabel, snsamp );
X    XtSetValues( pane->text_nsamp, arg, ONE );
X    sprintf(snsamp,"%d", pane->s->sig_nsamp);
X    XtSetValues( pane->endval, arg, ONE );
X    XtSetSensitive(pane->draw, True);
X    XtSetSensitive(pane->dstart, True);
X    XtSetSensitive(pane->dlast, True);
X    XtSetSensitive(pane->sb_start, True);
X    XtSetSensitive(pane->sb_last, True);
X    XtSetSensitive(pane->canvas, True);
X    XtSetSensitive(pane->style_button, True);
X    XtSetSensitive(pane->zoomcmd, True);
X    XtSetSensitive(pane->delcmd, True);
X    XtCallCallbacks(pane->draw,XtNcallback,NULL);
X}
END_OF_FILE
if test 1477 -ne `wc -c <'NewSignal.c'`; then
    echo shar: \"'NewSignal.c'\" unpacked with wrong size!
fi
# end of 'NewSignal.c'
fi
if test -f 'OpenSignal.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'OpenSignal.c'\"
else
echo shar: Extracting \"'OpenSignal.c'\" \(1183 characters\)
sed "s/^X//" >'OpenSignal.c' <<'END_OF_FILE'
X#include "xsignal.h"
X/* ARGSUSED */
Xvoid OpenSignal(button, pane, data2)
X    Widget button;
X    sigbox *pane;
X    caddr_t data2; /* Unused */
X{
X    int i,x,y;
X    Arg arg[5];
X    static XtCallbackRec callback[2];
X    Widget dialog,child,box;
X
X    XTranslateCoordinates(XtDisplay(button), XtWindow(button),
X		XDefaultRootWindow(XtDisplay(button)),
X		5,5,&x,&y,&child);
X    i=0;
X    XtSetArg( arg[i], XtNx, x); i++;
X    XtSetArg( arg[i], XtNy, y); i++;
X    pane->file=XtCreateApplicationShell( "xfile", topLevelShellWidgetClass,
X					arg, i );
X    i=0;
X    XtSetArg( arg[i], XtNwidth, WIDTH-10); i++;
X    box = XtCreateManagedWidget( "file", boxWidgetClass, pane->file, arg, i );
X
X    i=0;
X    XtSetArg(arg[i], XtNlabel, "Signal File Name:                      "); i++;
X    XtSetArg(arg[i], XtNvalue, ""); i++;
X    dialog = XtCreateManagedWidget( "file", dialogWidgetClass, box, arg, i );
X    callback[0].callback = NewSignal;
X    callback[0].closure = (caddr_t) pane;
X    i=0;
X    XtSetArg(arg[i], XtNlabel, "ok"); i++;
X    XtSetArg(arg[i], XtNcallback, callback); i++;
X    XtCreateManagedWidget( "file_ok",
X			commandWidgetClass, dialog, arg, i );
X    XtRealizeWidget(pane->file);
X}
END_OF_FILE
if test 1183 -ne `wc -c <'OpenSignal.c'`; then
    echo shar: \"'OpenSignal.c'\" unpacked with wrong size!
fi
# end of 'OpenSignal.c'
fi
if test -f 'ReadSig.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ReadSig.c'\"
else
echo shar: Extracting \"'ReadSig.c'\" \(1937 characters\)
sed "s/^X//" >'ReadSig.c' <<'END_OF_FILE'
X#include <sys/types.h>
X#include <sys/stat.h>
X#include "xsignal.h"
X/* define _SIGHEADER */
X
Xextern char *malloc();
X
Xint read_sighead(s,fd)
XSignal s;
Xint fd;
X{
X    int nread;
X
X    nread = read(fd,&s->sig_bitpv,sizeof(s->sig_bitpv));
X    if( nread < 0 ) {
X	perror("read_sighead(-1)");
X	return( -1 );
X    }
X
X    nread = read(fd,&s->sig_bytepv,sizeof(s->sig_bytepv));
X    if( nread < 0 ) {
X	perror("read_sighead(-2)");
X	return( -2 );
X    }
X
X    nread = read(fd,&s->sig_freq,sizeof(s->sig_freq));
X    if( nread < 0 ) {
X	perror("read_sighead(-3)");
X	return( -3 );
X    }
X
X    nread = read(fd,&s->sig_nsamp,sizeof(s->sig_nsamp));
X    if( nread < 0 ) {
X	perror("read_sighead(-4)");
X	return( -4 );
X    }
X
X    nread = read(fd,&s->sig_len,sizeof(s->sig_len));
X    if( nread < 0 ) {
X	perror("read_sighead(-5)");
X	return( -5 );
X    }
X
X    nread = read(fd,&s->sig_hext,sizeof(s->sig_hext));
X    if( nread < 0 ) {
X	perror("read_sighead(-6)");
X	return( -6 );
X    }
X    return( 0 );
X}
X
XSignal read_signal(fd)
Xint fd;
X{
X    Signal s0;
X    int hstat,nread;
X    struct stat buf;
X
X    s0 = (Signal) malloc(sizeof(struct s_signal));
X#ifdef _SIGHEADER
X    hstat = read_sighead(s0,fd);
X    s0->sig_data = malloc(s0->sig_len);
X    if( s0->sig_data == NULL ) {
X	fprintf(stderr,"Out of memory for reading signal of length %d\n",
X		s0->sig_len);
X	return( NULL );
X    }
X    nread = read(fd,s0->sig_data,s0->sig_len);
X    if( nread != s0->sig_len ) {
X	perror("read_signal");
X	free( s0->sig_data );
X	return( NULL );
X    }
X#else
X    fstat(fd,&buf);
X    s0->sig_len = buf.st_size;
X    s0->sig_nsamp = s0->sig_len/2;
X    s0->sig_data = malloc(s0->sig_len);
X    if( s0->sig_data == NULL ) {
X	fprintf(stderr,"Out of memory for reading signal of length %d\n",
X		s0->sig_len);
X	return( NULL );
X    }
X    nread = read(fd,s0->sig_data,s0->sig_len);
X    if( nread != s0->sig_len ) {
X	perror("read_signal");
X	free( s0->sig_data );
X	return( NULL );
X    }
X#endif
X    return( s0 );
X}
END_OF_FILE
if test 1937 -ne `wc -c <'ReadSig.c'`; then
    echo shar: \"'ReadSig.c'\" unpacked with wrong size!
fi
# end of 'ReadSig.c'
fi
if test -f 'SaveMSignal.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'SaveMSignal.c'\"
else
echo shar: Extracting \"'SaveMSignal.c'\" \(1093 characters\)
sed "s/^X//" >'SaveMSignal.c' <<'END_OF_FILE'
X#include "xsignal.h"
Xextern void WriteMarkedSignal();
X/* ARGSUSED */
Xvoid SaveMarkedSignal(button, pane, data2)
X    Widget button;
X    sigbox *pane;
X    caddr_t data2; /* Unused */
X{
X    int i,x,y;
X    Arg arg[5];
X    static XtCallbackRec callback[2];
X    Widget dialog,child;
X
X    XTranslateCoordinates(XtDisplay(button), XtWindow(button),
X		XDefaultRootWindow(XtDisplay(button)),
X		5,5,&x,&y,&child);
X    i=0;
X    XtSetArg( arg[i], XtNx, x); i++;
X    XtSetArg( arg[i], XtNy, y); i++;
X    pane->file = XtCreateApplicationShell( "xsave", topLevelShellWidgetClass, arg, i );
X    i=0;
X    XtSetArg(arg[i], XtNlabel, "Save File Name:                        "); i++;
X    XtSetArg(arg[i], XtNvalue, ""); i++;
X    dialog = XtCreateManagedWidget( "file", dialogWidgetClass, pane->file, arg, i );
X    callback[0].callback = WriteMarkedSignal;
X    callback[0].closure = (caddr_t) pane;
X    i=0;
X    XtSetArg(arg[i], XtNlabel, "ok"); i++;
X    XtSetArg(arg[i], XtNcallback, callback); i++;
X    XtCreateManagedWidget( "file_ok",
X			commandWidgetClass, dialog, arg, i );
X    XtRealizeWidget(pane->file);
X}
END_OF_FILE
if test 1093 -ne `wc -c <'SaveMSignal.c'`; then
    echo shar: \"'SaveMSignal.c'\" unpacked with wrong size!
fi
# end of 'SaveMSignal.c'
fi
if test -f 'SaveSignal.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'SaveSignal.c'\"
else
echo shar: Extracting \"'SaveSignal.c'\" \(1075 characters\)
sed "s/^X//" >'SaveSignal.c' <<'END_OF_FILE'
X#include "xsignal.h"
Xextern void WriteSignal();
X/* ARGSUSED */
Xvoid SaveSignal(button, pane, data2)
X    Widget button;
X    sigbox *pane;
X    caddr_t data2; /* Unused */
X{
X    int i,x,y;
X    Arg arg[5];
X    static XtCallbackRec callback[2];
X    Widget dialog,child;
X
X    XTranslateCoordinates(XtDisplay(button), XtWindow(button),
X		XDefaultRootWindow(XtDisplay(button)),
X		5,5,&x,&y,&child);
X    i=0;
X    XtSetArg( arg[i], XtNx, x); i++;
X    XtSetArg( arg[i], XtNy, y); i++;
X    pane->file = XtCreateApplicationShell( "xsave", topLevelShellWidgetClass, arg, i );
X    i=0;
X    XtSetArg(arg[i], XtNlabel, "Save File Name:                        "); i++;
X    XtSetArg(arg[i], XtNvalue, ""); i++;
X    dialog = XtCreateManagedWidget( "file", dialogWidgetClass, pane->file, arg, i );
X    callback[0].callback = WriteSignal;
X    callback[0].closure = (caddr_t) pane;
X    i=0;
X    XtSetArg(arg[i], XtNlabel, "ok"); i++;
X    XtSetArg(arg[i], XtNcallback, callback); i++;
X    XtCreateManagedWidget( "file_ok",
X			commandWidgetClass, dialog, arg, i );
X    XtRealizeWidget(pane->file);
X}
END_OF_FILE
if test 1075 -ne `wc -c <'SaveSignal.c'`; then
    echo shar: \"'SaveSignal.c'\" unpacked with wrong size!
fi
# end of 'SaveSignal.c'
fi
if test -f 'Scrolled2.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Scrolled2.c'\"
else
echo shar: Extracting \"'Scrolled2.c'\" \(954 characters\)
sed "s/^X//" >'Scrolled2.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
X/* ARGSUSED */
Xvoid Scrolled2(scrollbar, pane, position)
X    Widget scrollbar;
X    sigbox *pane;
X    int position;
X{
X    float percent;
X    float thumbsize,top;
X    int length,nsamp;
X    char labelval[40];
X    Arg args[3];
X
X    XtSetArg(args[0], XtNlength, &length);
X    XtGetValues(scrollbar, args, ONE);
X    percent = ((float) abs(position)) / ((float) (length));
X    SetThumbTop( scrollbar, percent );
X    SetThumbShown( pane->sb_start, percent );
X
X    if(pane->s != NULL) {
X	nsamp = percent * (pane->s->sig_nsamp);
X	if( pane->first >= nsamp ) nsamp = pane->first + 1;
X	if( nsamp > pane->s->sig_nsamp) nsamp = pane->s->sig_nsamp;
X	percent = ((float) nsamp) / ((float) pane->s->sig_nsamp);
X	SetThumbShown( pane->sb_start, percent );
X	pane->last = nsamp;
X	sprintf(&labelval[0], "%d",nsamp);
X	XtSetArg( args[0], XtNlabel, &labelval[0]);
X	XtSetValues( pane->endval, args, ONE);
X	XtCallCallbacks(pane->draw,XtNcallback,NULL);
X    }
X}
END_OF_FILE
if test 954 -ne `wc -c <'Scrolled2.c'`; then
    echo shar: \"'Scrolled2.c'\" unpacked with wrong size!
fi
# end of 'Scrolled2.c'
fi
if test -f 'StylePopup.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'StylePopup.c'\"
else
echo shar: Extracting \"'StylePopup.c'\" \(1112 characters\)
sed "s/^X//" >'StylePopup.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
Xextern sigbox *panefromsb();
X/* ARGSUSED */
Xvoid
Xstyle_popup(w, event, params, num_params)
XWidget w;
XXEvent *event; /* unused */
XString *params;
XCardinal *num_params;
X{
X	/* position the menu, whose name was passed as the first and only
X	 * parameter at position (20,5) relative to the Widget w.
X	 */
X	sigbox *pane;
X	Widget a_shell,wt;
X	Window child;
X	int x, y, wide;
X	Arg args[2];
X
X	if (*num_params != 1)
X		XtError("Wrong parameter count passed to style_popup()");
X
X	/* get the internal Widget id of the named shell */
X	pane = panefromsb(w);
X	a_shell = pane->style_popup;
X
X	if (a_shell == NULL)
X		XtError("Wrong shell name passed to style_popup()");
X
X	XtSetArg(args[0], XtNheight, &y);
X	XtGetValues(w, (ArgList)args, 1);
X	XTranslateCoordinates(XtDisplay(w), XtWindow(w),
X		XDefaultRootWindow(XtDisplay(w)),
X		0,y,&x,&y,&child);
X
X	/* currently this is the only way to move created shells */
X	XtMoveWidget(a_shell, x, y);
X	/* R3 needs just the next section, not the preceeding line */
X/*
X	XtSetArg(args[0], XtNx, x);
X	XtSetArg(args[1], XtNy, y);
X	XtSetValues(a_shell, (ArgList)args, 2);
X*/
X}
END_OF_FILE
if test 1112 -ne `wc -c <'StylePopup.c'`; then
    echo shar: \"'StylePopup.c'\" unpacked with wrong size!
fi
# end of 'StylePopup.c'
fi
if test -f 'xscope.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xscope.c'\"
else
echo shar: Extracting \"'xscope.c'\" \(1263 characters\)
sed "s/^X//" >'xscope.c' <<'END_OF_FILE'
X#include "xsignal.h"
X
X/* Command line options table.  Only resources are entered here...there is a
X   pass over the remaining options after XtParseCommand is let loose. */
X
Xstatic XrmOptionDescRec options[] = {
X{"-label",	XtNlabel,	XrmoptionSepArg,	NULL}
X};
X
X/* Global Variables */
XWidget toplevel;
X
Xvoid main(argc, argv)
X    unsigned int argc;
X    char **argv;
X{
X    Arg arg[5];
X    sigbox *sigpane;
X    int i;
X
X    /* Initialize the X ToolKit */
X    toplevel = XtInitialize( NULL, "XScope", options, XtNumber(options),
X			     &argc, argv);
X
X    if (argc != 1) Syntax(argv[0]);
X
X    /* Initialize the scope widget */
X
X    sigpane = (sigbox *) calloc(1, sizeof(sigbox));
X    sigpane->toplevel = toplevel;
X    sigpane->outer = XtCreateManagedWidget( "vpaned",
X			vPanedWidgetClass, sigpane->toplevel, arg, NULL );
X
X    sigpane->box = XtCreateManagedWidget( "signal",
X			boxWidgetClass, sigpane->outer, arg, NULL );
X    init_signal( sigpane );
X
X    /* Draw the widgets on the screen */
X    XtRealizeWidget(sigpane->toplevel);
X    XtScrollBarSetThumb(sigpane->sb_start, 0.0, 1.00);
X    XtScrollBarSetThumb(sigpane->sb_last, 1.00, 0.02);
X
X    /* Initialize the Graphics Context */
X    gc_init(sigpane);
X
X    /* Loop for ever processing events */
X    XtMainLoop();
X}
END_OF_FILE
if test 1263 -ne `wc -c <'xscope.c'`; then
    echo shar: \"'xscope.c'\" unpacked with wrong size!
fi
# end of 'xscope.c'
fi
if test -f 'xscope.man' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xscope.man'\"
else
echo shar: Extracting \"'xscope.man'\" \(2948 characters\)
sed "s/^X//" >'xscope.man' <<'END_OF_FILE'
X.\"
X.\" Add simple keeps to MAN macros so .TS/.TE will work
X.\"
X.de KS	\"	Keep start
X.br
X.in 0
X.di KP
X..
X.de KE	\" 	Keep end
X.br
X.di
X.ne \\n(dnu
X.nr fI \\n(.u
X.nf
X.KP
X.if \\n(fI .fi
X.in
X..
X.TH "xscope" 1X
X.na
X.nh
X.SH NAME
Xxscope 1.0 \- An X client for viewing 16 bit signals using Athena Widgets
X.SH SYNOPSIS
X\fB
X.B xscope <options>
X\fR
X.SH DESCRIPTION
XThe
X.I xscope\^
Xprogram is intended to be used to view \fI16 bit\fP signals stored as \fIsigned
Xintegers\fP.  The files used by \fIxscope\fP are simply a sequence of 16 bit
Xfields, each of which constitutes one sample value.  The entire signal
Xis read into memory.  Very large signals may not fit in memory and may
Xhave to be split up into smaller parts.
X
X.br
X.P
XUsing \fIscrollbar\fP
Xwidgets, the section of the signal to be viewed may be selected and
Xscrolled.  More exact positioning may be done through a \fIdialog\fP widget
Xwhere the starting and ending sample values may be typed.
X
X.br
X.P
XThe program
Xalso uses the concept of a marked range or section of the signal which
Xvarious commands operate on.  The left and right marks are indicated by
Xa vertical line.  \fICommand buttons\fP are provided to \fIzoom\fP
Xin on the marked range, to \fIdelete\fP the marked range or to save the
Xmarked range to a file.  The range is marked by clicking mouse button
X1 for the left mark and mouse button 3 for the right mark while in
Xthe window in which the signal is displayed.
X
X.br
X.P
XFile operations include inserting a signal from a file into the current
Xsignal at the left-hand mark.
X
X.br
X.P
XThe various widgets the user will interact with are:
X.br
X.SH Command Widgets
X.TP 8
X.B quit
X	Exit Program
X.TP 8
X.B file
X	Popup File Operation Menu
X.TP 8
X.B open
X	Open a new signal file and draw it
X.TP 8
X.B insert
X	Insert from file at the current left mark
X.TP 8
X.B save marked
X	Save the marked region of the signal to a file
X.TP 8
X.B save
X	Save the entire signal to a file
X.TP 8
X.B redraw
X	Redraw the signal
X.TP 8
X.B style
X	Popup Line Style Menu
X.TP 8
X.B zoom
X	Zoom in on the marked region of the signal
X.TP 8
X.B delete
X	Delete the marked region of the signal
X.SH Dialog Widgets
X.TP 8
X Starting Sample for plot
X.TP 8
X Ending Sample for plot
X.SH Scrollbar Widgets
X Starting sample for plot
X.TP 8
X Ending sample for plot
X.SH Label Widgets
X Number of Samples
X.TP 8
X Sample Number and Value
X.SH Signal Window
X.TP 8
X.B Button 1
X	Mark left end of signal for command to operate
X.TP 8
X.B Button 2
X	Return sample number and value
X.TP 8
X.B Button 3
X	Mark right end of signal for command to operate
X.SH AUTHOR
XP. Allen Jensen
X.br
XSchool of Electrical Engineering (DSP Lab)
X.br
XGeorgia Institute of Technology
X.br
XAtlanta, Georgia
X.br
Xjensen at gt-eedsp.gatech.edu
X.SH BUGS
XThere are probably problems with the program.  Please send descriptions
Xof any problems to the author at the above e-mail address.  Suggestions
Xfor new features are also welcome as well as code for new features
Xthat have been added to version 1.0.
END_OF_FILE
if test 2948 -ne `wc -c <'xscope.man'`; then
    echo shar: \"'xscope.man'\" unpacked with wrong size!
fi
# end of 'xscope.man'
fi
if test -f 'xsignal.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xsignal.h'\"
else
echo shar: Extracting \"'xsignal.h'\" \(3239 characters\)
sed "s/^X//" >'xsignal.h' <<'END_OF_FILE'
X#ifndef _XSIGNAL_
X#define _XSIGNAL_
X#include <stdio.h>
X#include <sys/file.h>
X#include <X11/Xatom.h>
X#include <X11/Intrinsic.h>
X#include <X11/StringDefs.h>
X#include <X11/Box.h>
X#include <X11/Command.h>
X#include <X11/Dialog.h>
X#include <X11/Label.h>
X#include <X11/Scroll.h>
X#include <X11/AsciiText.h>
X#include <X11/VPaned.h>
X#include <X11/Viewport.h>
X#include <X11/Cardinals.h>
X#include <X11/Shell.h>
X#include <X11/MenuPane.h>
X
X/* Text Widget requires this - structure defined in TextP.h */
Xtypedef struct {
X    int  firstPos;
X    int  length;
X    char *ptr;
X    } XtTextBlock, *XtTextBlockPtr;
X
X/* Signal Structure */
Xstruct s_signal {
X	unsigned short	sig_bitpv;	/* Bits per value */
X	unsigned short	sig_bytepv;	/* Bytes per value */
X	unsigned long	sig_freq;	/* Sample Frequency in HZ */
X	unsigned long	sig_nsamp;	/* Number of samples */
X	unsigned long	sig_len;	/* Length of signal in bytes */
X	unsigned short	sig_hext;	/* Header Extension Type */
X	char		*sig_data;	/* Actual signal data must be */
X					/* sig_len bytes long */
X};
Xtypedef struct s_signal *Signal;
X
Xstruct s_sigbox {
X	Widget toplevel;
X	Widget   outer;
X	Widget     box;
X	Widget       draw;
X	Widget       file;
X	Widget         file_button;
X	Widget         file_popup;
X	Widget       text_nsamp;
X/*                   @                    */
X	Widget         dstart;
X	Widget         sb_start;
X	Widget         startval;
X/*                   @                    */
X        Widget         dlast;
X	Widget         sb_last;
X	Widget         endval;
X/*		     @			  */
X	Widget	       picksamp;
X/*		     @			  */
X	Widget     canvas;
X/*		     @			  */
X	Widget	say,sayf,sayr,sayc;
X	Widget	style_button;
X	Widget	style_popup;
X	GC gc, gccache[0x10];
X	long lmark,rmark;
X	Signal s;
X	long first,last;
X	struct s_sigbox *nextpane;
X	int style;
X	Widget delcmd;
X	Widget zoomcmd;
X	Widget saycmd;
X	Widget reservedWidgets[10];
X};
Xtypedef struct s_sigbox sigbox;
X
X/* Global Routines */
Xextern void AddSignal();
Xextern void canvas_selected();
Xextern void canvas_exposed();
Xextern void Draw();
Xextern void DeleteSignal();
Xextern void file_popup();
Xextern void MapSample();
Xextern void NewEnd();
Xextern void NewForm();
Xextern void NewSignal();
Xextern void NewStart();
Xextern sigbox *panefromcanvas();
Xextern void Quit();
Xextern void QuitPane();
Xextern Signal read_signal();
Xextern void Sayit();
Xextern void SaySignal();
Xextern void Scope();
Xextern void Scrolled();
Xextern void Scrolled2();
Xextern void StyleDisc();
Xextern void StyleCont();
Xextern void style_popup();
Xextern void Syntax();
Xextern void Thumbed();
Xextern void Thumbed2();
Xextern Signal write_signal();
Xextern void Zoom();
X
X/* Global Variables */
Xextern Widget canvas;
Xextern Display *canvas_d;
Xextern Window canvas_w;
Xextern Widget toplevel;
Xextern Display *toplevel_d;
Xextern Window toplevel_w;
Xextern int toplevel_sn;
Xextern Widget drawcmd;
Xextern GC gc;
Xextern Signal sigs[];
X
X/* Defines */
X#define		INV_PAINT	GXxor
X#define		MERGE		GXor
X#define		PAINT		GXcopy
X#define		ERASE		GXcopyInverted
X#define		DRAW		1
X#define		UNDRAW		0
X#define		SIG_NOEXT	0
X#define		MAXSIG		10
X#define		MAINSIG		0
X#define		OUTSIG		1
X#define		OVERSIG		2
X
X#define		WIDTH		800
X#define		CHEIGHT		100
X#define		MENUHIGH	20
X
X#define		CONTINUOUS	0
X#define		DISCRETE	1
X#endif
END_OF_FILE
if test 3239 -ne `wc -c <'xsignal.h'`; then
    echo shar: \"'xsignal.h'\" unpacked with wrong size!
fi
# end of 'xsignal.h'
fi
echo shar: End of archive 1 \(of 2\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked both archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
Moderator of comp.sources.x



More information about the Comp.sources.x mailing list