#ifndef lint
#endif
/***********************************************************
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Digital or MIT not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
#include <stdio.h>
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <./Xaw3_1XawInit.h>
#include <./Xaw3_1StripCharP.h>
#ifdef SYSV
#ifndef bcopy
#endif /*bcopy*/
#else
extern void bcopy();
#endif /*SYSV*/
/* Private Data */
};
static int repaint_window();
{ /* core fields */
/* class_name */ "StripChart",
/* size */ sizeof(StripChartRec),
/* class_initialize */ XawInitializeWidgetSet,
/* class_part_initialize */ NULL,
/* class_inited */ FALSE,
/* initialize */ Initialize,
/* initialize_hook */ NULL,
/* realize */ XtInheritRealize,
/* actions */ NULL,
/* num_actions */ 0,
/* resources */ resources,
/* xrm_class */ NULL,
/* compress_motion */ TRUE,
/* compress_exposure */ XtExposeCompressMultiple |
/* compress_enterleave */ TRUE,
/* visible_interest */ FALSE,
/* destroy */ Destroy,
/* resize */ SetPoints,
/* expose */ Redisplay,
/* set_values */ SetValues,
/* set_values_hook */ NULL,
/* set_values_almost */ NULL,
/* get_values_hook */ NULL,
/* accept_focus */ NULL,
/* version */ XtVersion,
/* callback_private */ NULL,
/* tm_table */ NULL,
/* query_geometry */ XtInheritQueryGeometry,
/* display_accelerator */ XtInheritDisplayAccelerator,
/* extension */ NULL
},
{ /* Simple class fields */
/* change_sensitive */ XtInheritChangeSensitive
}
};
/****************************************************************
*
* Private Procedures
*
****************************************************************/
static void draw_it();
/* Function Name: CreateGC
* Description: Creates the GC's
* Arguments: w - the strip chart widget.
* which - which GC's to create.
* Returns: none
*/
static void
unsigned int which;
{
if (which & FOREGROUND) {
}
}
}
/* Function Name: DestroyGC
* Description: Destroys the GC's
* Arguments: w - the strip chart widget.
* which - which GC's to destroy.
* Returns: none
*/
static void
unsigned int which;
{
if (which & FOREGROUND)
}
/* ARGSUSED */
{
if (w->strip_chart.update > 0)
else
w->strip_chart.interval = 0;
SetPoints(w);
}
{
}
/*
* NOTE: This function really needs to recieve graphics exposure
* events, but since this is not easily supported until R4 I am
* going to hold off until then.
*/
/* ARGSUSED */
Widget w;
{
else
}
/* ARGSUSED */
static void
{
double value;
if (w->strip_chart.update > 0)
w->strip_chart.interval_id =
/* Get the value, stash the point and draw corresponding line. */
return;
/*
* Keep w->strip_chart.max_value up to date, and if this data
* point is off the graph, change the scale to make it fit.
*/
}
}
if (XtIsRealized((Widget)w)) {
w->strip_chart.scale);
w->strip_chart.interval, y,
/*
* Fill in the graph lines we just painted over.
*/
}
}
} /* draw_it */
/* Blts data according to current size, then redraws the stripChart window.
* Next represents the number of valid points in data. Returns the (possibly)
* adjusted value of next. If next is 0, this routine draws an empty window
* (scale - 1 lines for graph). If next is less than the current window width,
* the returned value is identical to the initial value of next and data is
* unchanged. Otherwise keeps half a window's worth of data. If data is
* changed, then w->strip_chart.max_value is updated to reflect the
* largest data point.
*/
static int
{
register int i, j;
int scalewidth = 0;
/* Compute the minimum scale required to graph the data, but don't go
lower than min_scale. */
left = 0;
SetPoints(w);
if (XtIsRealized ((Widget) w))
}
if (XtIsRealized((Widget)w)) {
/* Draw data point lines. */
}
/* Draw graph reference lines */
}
}
return(next);
}
/* Function Name: MoveChart
* Description: moves the chart over when it would run off the end.
* Arguments: w - the load widget.
* Returns: none.
*/
static void
{
double old_max;
int left, i, j;
if (!XtIsRealized((Widget) w)) return;
else {
if (j < 0) j = 0;
}
(char *)(w->strip_chart.valuedata), j * sizeof(double));
/*
* Since we just lost some data, recompute the
* w->strip_chart.max_value.
*/
for (i = 0; i < next; i++) {
}
if (!blit) return; /* we are done... */
return;
}
0, 0);
(int) j, 0,
FALSE);
/* Draw graph reference lines */
left = j;
}
return;
}
/* ARGSUSED */
{
w->strip_chart.interval_id =
}
new_gc |= FOREGROUND;
return( ret_val );
}
/* Function Name: SetPoints
* Description: Sets up the polypoint that will be used to draw in
* the graph lines.
* Arguments: w - the StripChart widget.
* Returns: none.
*/
static void
SetPoints(w)
{
int i;
return;
}
/* Draw graph reference lines into clip mask */
points[i - 1].x = 0;
}
}