/**************************************************************************
 *                                                                        *
 * Copyright (c) 1996 Michael Richmond and Richard Treffers               *
 *                                                                        *
 *                    This software may be copied and distributed for     *
 *                    educational, research and not for profit services   *
 *                    provided that this copyright and statement are      *
 *                    included in all such copies.                        *
 *                                                                        *
 **************************************************************************/



	/* this file contains information needed by programs which use
	   X-Windows features of PC Vista 

	   9/23/92 - added interactive circles and number -rrt
	   */

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/cursorfont.h>
#include <X11/Xatom.h>		/* need this for colormap names */
#include <X11/keysym.h>

#define PCVISTAX

#define ATOM_STATE   "image_state"	/* name of atom for communicating with */
                                  	/*  between windows and other processes */

	/* the following are the states an image process may be in */
#define STATE_NORMAL		0	/* as cursor moves, display x, y, val */
#define STATE_FROZEN		1	/* don't update x, y, val */
#define STATE_CURSOR		2	/* wait for button, send x, y, val */
#define STATE_BOX_CENTER	3	/* define a box center interactively */
#define STATE_BOX_SIZE		4	/* define a box size interactively */
#define STATE_BOX_SHOW      5	/* show a box */
#define STATE_CROSSHAIR     6	/* show a crosshair */
#define STATE_CIRCLE_CENTER	7	/* define a circle center interactively */
#define STATE_CIRCLE_SIZE	8	/* define a circle radius interactively */
#define STATE_CIRCLE_SHOW   9	/* show a circle */
#define STATE_NUMBER	    10	/* show a number */
#define STATE_COMMUNICATE	99	/* communicating to some other process */

	/* while in the NORMAL (or FROZEN) state, an image process may have
	   colormap-sliding enabled or disabled */
#define SLIDING             1	/* sliding is enabled */
#define NOT_SLIDING         2	/* sliding is disabled */

	/* these values tell the 'cursor' program whether or not it should
	   continue after reading an (x,y,val) triplet */
#define CURSOR_STOP         1	/* stop immediately */
#define CURSOR_CONTINUE     2	/* keep reading values */


	/* this is the structure which holds the property values for the 
	   "image_state" atom of the DefaultRootWindow.  We use the data
	   of the property to determine the state of image windows.  

	   The first int in the data[] array holds the number of currently-open
	   image windows. the second int holds the new (or current) state
	   the window should be in.  Other values in the array hold such
	   things as x and y values, data values, box coords, etc. */

#define PROP_NITEMS    6		/* max number of ints used in the data array */
#define PROP_FORMAT   32		/* bits per item for this atom */

struct s_prop {
	int format;
	unsigned long nitems;		/* number of items returned in prop_data */
	unsigned long bytes;
	int *data;
};

    /* some routines that all PC-Vista/X functions should use */
#ifdef PROTO
void read_property(  int *data  );
void set_property(  int *data );
void invert_cmap(void);
int open_window(char *name, int x, int y, int nr, int nc ,int zoom, int bin);
void image_save(void);
void image_wait(void);
#else
void read_property( /* int data[] */ );
void set_property( /* int data[] */ );
#endif
