/***********************************************************************
 *
 * TITLE:
 *	rectlist.h
 *
 * AUTHOR:
 *	Kevin J. Miller
 *
 * DESCRIPTION:
 *	Header file for rectangle lists.
 *
 *				CHANGE HISTORY
 *
 * $Log: rectlist.h,v $
 * Revision 1.5  1994/04/30  02:44:04  kevin
 * port to ANSI
 *
 * Revision 1.4  1991/12/05  23:20:29  chester
 * added getSenseRect function.
 *
 * Revision 1.3  1991/09/04  22:36:08  kevin
 * added new functions from Chester
 *
 * Revision 1.2  1991/08/12  23:28:06  kevin
 * added background sense
 *
 * Revision 1.1  1991/08/12  21:41:08  kevin
 * Initial revision
 *
 ***********************************************************************
 *
 * WARNINGS:
 *
 * EXTERNAL CALLABLE COMPONENTS (PUBLIC):
 *
 * GLOBALS:
 *
 * WAIVERS:
 *
 * NOTES:
 *
 * MANPAGE:
 *
 ***********************************************************************/

#ifndef rectlist_h
#define rectlist_h

#ifndef lint
static char rcsid_rectlist[] =
    "$Id: rectlist.h,v 1.5 1994/04/30 02:44:04 kevin OEL $";
#endif

#include <X11/Intrinsic.h>

/*
 * types of rectangles
 *
 * four bits are defined:
 *
 *	RL_MOVER	- identifies a moving rectangle (center mouse
 *			  button)
 *	RL_BG_SENSE	- identifies an area that is senitive only
 *			  when the background variable is TRUE
 *	RL_SENSE	- identifies an area that is always senitive
 *	RL_EXPOSE	- identifies an area that is to be exposed
 *
 * users should generally use the following when setting rectangles:
 *
 *	RL_PRIMARY	- a standard rectangle
 *	RL_SECONDARY	- an aux rectangle that is senitive and will
 *			  generate expose events, but cannot be moved
 *	RL_EXPOSE	- an exposed only rectangle
 *	
 * users may also define background rectangles which are not always
 * senitive:
 *
 *	RL_BACKGROUND	- a standard background rectangle
 *	RL_FIXED	- an aux background rectangle that cannot be moved
 *			  even when senitive
 */

#define RL_MOVER 8
#define RL_BG_SENSE 4
#define RL_SENSE 2
#define RL_EXPOSE 1

#define RL_PRIMARY (RL_MOVER | RL_SENSE | RL_EXPOSE)
#define RL_SECONDARY (RL_SENSE | RL_EXPOSE)
#define RL_BACKGROUND (RL_MOVER | RL_BG_SENSE | RL_EXPOSE)
#define RL_FIXED (RL_BG_SENSE | RL_EXPOSE)

/*
 * structure definitions
 */

typedef struct {
    XRectangle rvals;
    int type;
} RectElem;

typedef struct {
    int count;
    int avail;
    RectElem (*rects)[];
} RectList;

/*
 * global function prototypes
 */
extern RectList *newRectList(int, ...);
extern void setRectList(RectList *, ...);
extern void freeRectList(RectList *);
extern RectList *copyRectList(RectList *);
extern XRectangle *(*getMoveRect(RectList *))[];
extern XRectangle *(*getSenseRect(RectList *))[];
extern XRectangle *(*getSecondaryRect(RectList *))[];
extern XRectangle *(*getExposeRect(RectList *))[];
extern void exposeRectList(int, RectList *);
extern int cliptestRectList(Region, RectList *);
extern int pointinRectList(int, int, RectList *);
extern void setBackgroundSense(int);

#endif
