/* @(#)dispX11.h	1.4 (mg@ukc.ac.uk) 5/24/90 */
/*
 *	Definitions and declarations for dispX11.c, including the type
 *	DWID, included in the structures used by csound for function tables
 *	and displays, for which a pointer is passed to dsplXgraph().
 *
 *	Included by sysdep.h, which is included by everyone.
 */

#include <X11/Xlib.h>

/* Information needed for each graph display window */
typedef struct xdwid {
	Window	window;
	struct xdwid * link;	/* dwids are kept in a linked list. */
	int	width, height;	/* of window in pixels */
	float	*points;	/* the points we're displaying (for resize) */
	int	npoints;	/* number of input points */
	char	*label;		/* textual label for graph */

	float	min, max;	/* sample high- and low-water marks ever */

	/* All the rest of this array are derived from the above */
	XPoint	*xpoints;	/* ... converted to physical coordinates */
	int	nxpoints;	/* number of points in xpoints */
	int	xp_up_to_date;	/* does xpoints truly reflect points */

	/* factors used to map points to xpoints */
	int	xzero, yzero;	/* window coords of (0,0) */
	float	xscale, yscale;	/* xpoint = zero + (value * scale) */

	int	xmin, ymin;	/* coordinates of bottom left of drawing area */
	int	grwidth, grheight;	/* size of drawing area */
	int	configured;	/* Is this window drawable-on yet? */
	int	clicked_on;	/* for single-step mode, number of times
				   the mouse has clicked in the window */
} XDWID;

typedef XDWID *DWID;
