DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦10483e112⟧ TextFile

    Length: 3882 (0xf2a)
    Types: TextFile
    Notes: UNIX file
    Names: »desk.h«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦2d53db1df⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »hr/src/desk/desk.h« 

TextFile

#include	<rico.h>
#include	<driver.h>
#include	<smgr_defs.h>
#include	<structs.h>
#include	<cmds.h>
#include	<fmgr.h>


#define	DNW	(DESTMAX-WINDOW)	/* total number of windows */
#define	NSW	(8)			/* number of shell windows */
#define	NGW	(4)			/* number of graphics windows */
#define	SWBASE	(WINDOW)		/* devno of first shell window */
#define	CWBASE	(WINDOW+NSW)		/* devno of clock */
#define	GWBASE	(DESTMAX-NGW)		/* devno of 1st graphics window */

/*
 *	Some Machine Definitions
 */
#define	BPW	(16)		/* bits per word	*/
#define SBPW	(4)		/* #shift, pix -> words	*/


/*
 *	Heap Definitions
 */
#define	HEAP	(8*1024)	/* heap size (16K)	*/


/*
 *	Mouse Definitions and Mouse State Structure
 */
#define	MMASK	(0x03ff)	/* mouse position mask	*/
#define	MLEFT	(0x8000)	/* LEFT button mask	*/
#define MMID	(0x4000)	/* MIDDLE button mask	*/
#define	MRIGHT	(0x2000)	/* RIGHT button mask	*/
#define	MOUSEWIDTH  (16)	/* mouse cursor width	*/
#define MOUSEHEIGHT (16)	/* mouse cursor height	*/


struct mouse
{
	POINT	pt;		/* mouse position	*/
	uint	tog;		/* button toggle state	*/
	uint	but;		/* button state		*/
	char	*mpat;		/* current mouse pattern*/
};



/*
 *	Menu Definitions and Structures
 */
#define	DSKMENU	0		/* desktop menu number		*/
#define	WINMENU	1		/* window menu number		*/
#define NMENU	32		/* maximum number of menus	*/
#define NIMENU	16		/* max number of items per menu	*/
#define	MHFILL	16		/* space on each side of menu item */
#define	MAXIMENU 20		/* total number of items	*/

#define	LMARGIN	(1)		/* left margin on menus	*/
#define	RMARGIN	(5)		/* right menu margin	*/
#define	UMARGIN	(1)		/* top menu margin	*/
#define	DMARGIN	(5)		/* lower menu margin	*/

/*	Menu item structure.	*/
typedef struct
{
	char	 mi_clen;	/* character length of item	*/
	char	 mi_flag;	/* bit0 => active, bit1 => on	*/
	char	*mi_str;	/* pointer to the string	*/
	int	 mi_next;	/* menu id of next menu node	*/
	int	 mi_len;	/* pixel length of string	*/
} IMENU;

/*	Menu definition structure.	*/
typedef struct
{
	int	 mn_n;		/* number of menu items		*/
	int	 mn_width;	/* maximum pixel length		*/
	int	 mn_height;	/* maximum pixel height		*/
	int	 mn_fill;	/* horizontal fill factor	*/
	IMENU	*mn_item;	/* points to array of menu items*/
} MENU;

/*	Active menu structure.	*/
typedef struct
{
	MENU	*ma_menu;	/* menu pointer			*/
	int	ma_elt;		/* active element (or -1)	*/
	RECT	ma_rect;	/* physical rectangle of menu	*/
	RECT	ma_crect;	/* physical clipping rectangle	*/
	int	ma_heap;	/* top of old heap		*/
} AMENU;



/*
 *	process/layer state
 */
struct	dproc
{
	int		pid;	/* process id (-1 => unused)	*/
	RECT		prect;	/* physical rectangle		*/
	struct dproc	*pnext,	/* pointer to lower layer	*/
			*pprev;	/* pointer to higher layer	*/
};


extern	RECT	R_Intersection(),
		R_inset(),
		R_addp(),
		R_offset(),
		getRect();

extern	uint	*addptr(),
		*subptr();

extern	int	fstretch(),
		fmove(),
		ffront(),
		fback(),
		fupdate(),
		fquit(),
		fshell(),
		fgshell(),
		fclock(),
		fexit(),
		fupdall(),
		fnull();


extern	int	myfd;		/* desk mananger file descr	*/
extern	BITMAP	dskBitmap;	/* full screen bitmap		*/
extern	RECT	dskClip;	/* text drawing clipping rect	*/
extern	POINT	dskMpt;		/* previous mouse position	*/
extern	int	dskWin;		/* active window number		*/
extern	int	dskFntA;	/* desktop font ascent value	*/
extern	int	dskFntH;	/* desktop font height (leading)*/
extern	struct dproc dproc[],	/* desktop processes & windows	*/
		*dskTop,	/* topmost layer pointer	*/
		*dskBot;	/* bottommost layer pointer	*/
extern	struct	mouse mouse;	/* current mouse state		*/
extern	char	*shell[][2];	/* shells for the windows	*/


extern	int	mu_im;
extern	int	mu_flash;
extern	MENU	mu_menu[];
extern	AMENU	mu_am;
extern	IMENU	mu_imenu[];

extern	int	DSK_MOUSE[],
		MNU_MOUSE[],
		MOV_MOUSE[];

#define	ClearRect(r)	D_Rect(r, L_TRUE);
#define InvertRect(r)	D_Rect(r, L_NDST);