/* $Id: Plotter.h,v 1.1 91/05/20 15:15:07 gnb Exp $ */
/* $Source: /export/sources/x/At/Plotter/tmp/RCS/Plotter.h,v $ */

/*

Copyright 1990,1991 by the Massachusetts Institute of Technology

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 name of the Massachusetts
Institute of Technology (M.I.T.) not be used in advertising or publicity
pertaining to distribution of the software without specific, written
prior permission.

M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
M.I.T. 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.

*/

/*
 * $Log:	Plotter.h,v $
 * Revision 1.1  91/05/20  15:15:07  gnb
 * Initial revision
 * 
 * 
 */

#ifndef _AtPlotter_h
#define _AtPlotter_h

#ifdef _AtDevelopment_
#include "Plot.h"
#include "Axis.h"    
#else
#include <At/Plot.h>
#include <At/Axis.h>    
#endif   
/* resource names and classes */
    
#define XtNtitle "title"
#define XtNlegendTitle "legendTitle"   
#define XtNfontFamily "fontFamily"
#define XtNtitleSize "titleSize"
#define XtNlegendTitleSize "legendTitleSize"    
#define XtNlegendSize "legendSize"
#define XtNtitleColor "titleColor"
#define XtNlegendColor "legendColor"
#define XtNautoScale "autoScale"
#define XtNforceSquare "forceSquare"
#define XtNforceAspect "forceAspecte"
#define XtNfloatingX "floatingX"
#define XtNfloatingY "floatingY"    
#define XtNframedAxes "framedAxes"
#define XtNshowLegend "showLegend"    
#define XtNlegendWidth "legendWidth"
#define XtNlegendSpacing "legendSpacing"
#define XtNmarginWidth "marginWidth"
#define XtNmarginHeight "marginHeight"
#define XtNrankChildren "rankChildren"
#define XtNdoubleClickInterval "doubleClickInterval"    
#define XtNmotionCallback "motionCallback"
#define XtNclickCallback "clickCallback"
#define XtNdragCallback "dragCallback"
#define XtNselectCallback "selectCallback"
#define XtNdoubleSelectCallback "doubleSelectCallback"    
#define XtNerrorCallback "errorCallback"
    
#define XtCTitle "Title"
#define XtCLegendTitle "LegendTitle"    
#define XtCFontFamily "FontFamily"
#define XtCFontSize "FontSize"    
#define XtCAutoScale "AutoScale"
#define XtCForceSquare "ForceSquare"
#define XtCForceAspect "ForceAspect"
#define XtCFloatingAxes "FloatingAxes"
#define XtCFramedAxes "FramedAxes"
#define XtCShowLegend "ShowLegend"    
#define XtCLegendWidth "LegendWidth"
#define XtCMargin "Margin"
#define XtCRankChildren "RankChildren"
#define XtCDoubleClickInterval "DoubleClickInterval"    

/* constraint resource names and classes */
#define XtNdisplayed "displayed"
#define XtNlegendName "legendName"
#define XtNuseY2Axis "useY2Axis"
#define XtNrankOrder "rankOrder"

#define XtCDisplayed "Displayed"
#define XtCLegendName "LegendName"
#define XtCUseY2Axis "UseY2Axis"
#define XtCRankOrder "RankOrder"

/* Class record constants */

extern WidgetClass atPlotterWidgetClass;

typedef struct _AtPlotterClassRec * AtPlotterWidgetClass;
typedef struct _AtPlotterRec      * AtPlotterWidget;


/************************/
/*  Callback structures */
/************************/

/* The PointStruct is used for the call data on motion and point select
   callbacks. The RectangleStruct is used for the call data on the
   rectangle callback. */

typedef struct _PointStruct {
  short pixelx, pixely;
  double x,y,y2;
} PointStruct;

typedef PointStruct RectangleStruct[2];

/* Special Macros */
#define XtStrlen(s)  ((s)? strlen(s) : 0)

#ifndef P
# ifdef __STDC__
#  define P(args) args
# else
#  define P(args) ()
# endif 
#endif 

/* Public functions */
extern AtPlotWidget AtPlotterGetSelectedPlot P((AtPlotterWidget));
extern AtPlotWidget AtPlotterGetLastPlot P((AtPlotterWidget));
extern void AtPlotterRemoveAllPlots P((AtPlotterWidget));

extern AtAxisObject AtPlotterGetXAxis P((AtPlotterWidget));
extern AtAxisObject AtPlotterGetYAxis P((AtPlotterWidget));
extern AtAxisObject AtPlotterGetY2Axis P((AtPlotterWidget));
extern AtAxisObject AtPlotterGetXFrameAxis P((AtPlotterWidget));
extern AtAxisObject AtPlotterGetYFrameAxis P((AtPlotterWidget));
extern AtAxisObject AtPlotterGetY2FrameAxis P((AtPlotterWidget));

extern AtPlotWidget AtPlotterCheckHit P((AtPlotterWidget, int, int));

void AtPlotterGeneratePostscript P((char *, AtPlotterWidget, char *,
				    int, int, int, int, int landscape));
extern void AtPlotterDrawPS P((FILE *, AtPlotterWidget, int, int, int, int));

/*
 * These functions are for the plot children to communicate with the parent
 */
typedef struct {
    double xmin, xmax, ymin, ymax;
} BoundingBox;

extern void AtPlotterPlotExtended P((AtPlotWidget, BoundingBox *, 
				     int from, int to));
extern void AtPlotterPlotDataChanged P((AtPlotWidget, BoundingBox *, int));
extern void AtPlotterRefreshRequired P((AtPlotWidget));
extern void AtPlotterRedrawRequired P((AtPlotWidget));
extern void AtPlotterLayoutRequired P((AtPlotWidget));
extern void AtPlotterRescaleRequired P((AtPlotWidget));

#endif /* _AtPlotter_h */
/* DON'T ADD ANYTHING AFTER THIS #endif */

