/* UNISRC_ID: %W%	%E%  */

/*********************************************************************
 *  file:	h/scrn/wcm.h
 *  part #:
 *  internal sequence #:
 *
 *	************************************************************
 *	*     "(c) Copyright Hewlett-Packard Company, 1984.   All  *
 *	*     rights are reserved.  Copying or other reproduction  *
 *	*     of this program except for archival purposes is      *
 *	*     prohibited without the prior written consent of      *
 *	*     Hewlett-Packard Company."				   *
 *	************************************************************
 *
 *
 *	This file contains the window manager definitions.  The file
 *	wmcom.h must be included in front of this file.
 *
 *		Pisces Q-DOS project
 *		Jon Brewster PCD
 *		----------------------------------------------------
 *		initial				4/4/83
 *		menu stuff added		9/2/83	jb
 *
 *	$Log:	/usr/src/uts.p/h/scrn/wcm.h,v $
 * Revision 2.7  84/09/24  18:23:20  jon
 * roll back to pebbles for Release 13
 * 
 * Revision 2.6  84/09/13  17:14:12  jon
 * Release 12
 * 
 * Revision 2.5  84/07/30  21:42:02  jon
 * *** empty log message ***
 * 
 * Revision 2.4  84/05/30  15:26:14  jon
 * added user_string and system_string
 * 
 * Revision 2.3  84/04/12  09:21:54  jon
 * *** empty log message ***
 * 
 * Revision 2.2  84/04/06  15:16:34  jon
 * This checkin just garentees that everything is in sync
 * 
 * Revision 2.1  84/03/12  19:47:18  jon
 * Release 8
 * 
 * Revision 1.6  84/03/06  10:15:46  jon
 * bring up to date with 2/14/84 ers
 * 
 * Revision 1.5  84/02/29  17:27:53  jon
 * added cork routine to routines table
 * 
 * Revision 1.4  84/02/02  20:50:34  jon
 * Start using RCS log
 * 
 *
 ************************************************************************/

#define WMVERSION	1000	/* 01.0.00 -> release 1, rev 0, patch 0 */

extern int dirtyw;		/* there is a window that needs unlinking */
extern int wmlock;		/* window manager locked to this p_pid */
extern int banner_width;	/* banner width chars only (in dots) */
extern struct windio *udata;	/* pointer to user data */
extern struct windio tempd;	/* holding place for window data */
extern struct stat_data dstat;	/* display status */

/*****************************************
 * usefull indices into the window table *
 *****************************************/

extern int newin;		/* a cheater to simplify communications */
extern int active;		/* current keyboard connection */
extern int lastactive;		/* last valid keyboard connection */
extern int top;		 	/* top most window */
extern int bottom;		/* bottom most window */
extern int topoff;		/* top index for off windows */
extern int statwin;		/* window for which display status is correct */
extern int mswin;		/* window being moved or stretched */

/**********************
 * usefull rectangles *
 **********************/

extern int clipx;		/* current clipping area */
extern int clipy;
extern int clipmaxx;
extern int clipmaxy;
extern int minx;		/* largest affected area */
extern int miny;
extern int maxx;
extern int maxy;

/*********************
 * main window table *
 *********************/

struct winst 
	{
	short type;			/* window status bits */
	char * wd;                      /* pointer to window data */
	struct shared * sd;             /* pointer to shared data */
	short up;			/* link to the window above */
	short down;			/* link to the window below */
	short dirtyw;			/* window needs unlinking */
	};
extern struct winst wintab[WINUM+1]; /* window instance table */

/**************************
 * mouse and sprite stuff *
 **************************/

extern int smode;			/* sprite mode */
extern unsigned short buttons;		/* current mouse button status */
extern struct sprt_stat *image;		/* current sprite image */
extern struct sprt_stat *lastimage;	/* last sprite image output */
extern struct xy_coord wmsprite;	/* current sprite position */
extern struct xy_coord tsprite;		/* temporary sprite position */
extern struct msrel_stat msrel;		/* mouse sprite multipliers */
extern struct sprt_stat mspriteo;	/* sprite for moving (odd)*/
extern struct sprt_stat mspritee;	/* sprite for moving (even)*/
extern struct sprt_stat sspriteo;	/* sprite for stretching (odd)*/
extern struct sprt_stat sspritee;	/* sprite for stretching (even)*/
extern struct sprt_stat winsprite;	/* menu and default win sprite */
extern struct sprt_stat nullspriteo;	/* sprite for gray space (odd)*/
extern struct sprt_stat nullspritee;	/* sprite for gray space (even)*/
extern long spritefracx;		/* save fractions for next move */
extern long spritefracy;		/* save fractions for next move */

/**************
 * menu stuff *
 **************/

extern int menuon;		/* menu on flag */
extern int sysmenu;		/* application or system menu identifier */
extern unsigned int asterisks;
extern int item_width;		/* menu item width (with spacing) */
extern int item_onex;		/* menu item one x position */
extern int smaxy;		/* current bottom of screen */
extern char user_string[];
extern char system_string[];
extern struct menu syslabels;	/* system defined labels */

/**********************************************************
 * function definitions needed for control module linkage *
 **********************************************************/

extern struct shared *goodwin(); /* window validity checker */
extern struct shared *namewin(); /* window name checker */

/*********************************
 * linkage into window type code *
 *********************************/

extern struct routines routines[];   /* window type routine dispatch table */
struct routines
	{
	int (*sizer)();
	int (*initr)();
	int (*tshowr)();
	int (*unshowr)();
	int (*keyr)();
	int (*destr)();
	int (*corkr)();
	int (*uncorkr)();
	int (*bfwir)();
	int (*wibfr)();
	int (*bibfr)();
	int (*wibir)();
	char *wident;
	long winmajor;
	};
