#ifndef _LinePlotP_h
#define _LinePlotP_h

#ifdef _AtDevelopment_
#include "LinePlot.h"
#include "PlotP.h"
#else
#include <At/PlotP.h>
#include <At/LinePlot.h>
#endif

typedef struct {
    int empty;
} LinePlotClassPart;

typedef struct _LinePlotClassRec {
     ObjectClassPart	object_class;
     AtPlotClassPart	plot_class; 
     LinePlotClassPart	lineplot_class;
} LinePlotClassRec;

extern LinePlotClassRec linePlotClassRec;

typedef struct {
     /* Private State */
     XtPointer	data;
     AtType	type;
     Cardinal	stride;
     Cardinal	start;
     Cardinal	num_points;
     XPoint    *pixpts;

     /* These are for the fast-draw refresh */
     XPoint    *old_pixpts;
     Cardinal	old_num_points; 
} LinePlotPart;

typedef struct _LinePlotRec {
     ObjectPart		object;
     AtPlotPart		plot;
     LinePlotPart	lineplot;
} LinePlotRec;

/*
 * A macro to return a data item by casting the pointer to the
 * appropriate type and indexing off it.
 */

#define _ptr(p, i) ((XtPointer)((char *)p->lineplot.data + \
				p->lineplot.stride * (i)))

#undef VAL_MACRO

#ifdef VAL_MACRO
#define val(p, i) \
     ((p)->lineplot.type == AtDouble ? *((double *)_ptr(p, (i))) : \
      (p)->lineplot.type == AtFloat ? (double)*((float *)_ptr(p, (i))) : \
      (p)->lineplot.type == AtInt ? (double)*((int *)_ptr(p, (i))) : 0.0)
#endif

#endif /* _LinePlotP_h */
