// GINN.DF

// $$ N.B.
// $$ Given a 606 dot x 808 line display which is 8.5 inches x 11 inches
// $$ there are 73.454545 lines/vert inch and 71.294117 dot/horiz inch
// $$ and a line is 13.613861 thou-inch and a dot is 14.026402 thou-inch

manifest [
	paral = 128
	leftdelim = ${
	rightdelim = $}
	];

structure LIST[
	max word
	siz word
	]

manifest [ listbase = (size LIST + 15) / 16 ]

structure LOOK[
	bold bit 1
	italic bit 1
	menu bit 1
	remark bit 1
	serif bit 1
	ul bit 1
	vanish bit 1
	blank bit 9
	]
manifest [
	mlooks = #177000 // * * * * * sum of masks * * * * *

	fbold = offset LOOK.bold
	mbold = #100000 rshift fbold
	fitalic = offset LOOK.italic
	mitalic = #100000 rshift fitalic
	fmenu = offset LOOK.menu
	mmenu = #100000 rshift fmenu
	fremark = offset LOOK.remark
	mremark = #100000 rshift fremark
	fserif = offset LOOK.serif
	mserif = #100000 rshift fserif
	ful = offset LOOK.ul
	mul = #100000 rshift ful
	fvanish = offset LOOK.vanish
	mvanish = #100000 rshift fvanish
	]

manifest [
	fjust = 1
	fcenter = 2
	]

structure FORMAT[
	dent word // see "firstnumeric" below
	lmarg word
	rmarg word
	quad word // see "firstbinary" below
	look word = @LOOK
	]
manifest [ nnumerics = 4;
	  firstnumeric = (offset FORMAT.dent + 15)/16;
	  fdent = (offset FORMAT.dent + 15)/16;
	  flmarg = (offset FORMAT.lmarg + 15)/16;
	  frmarg = (offset FORMAT.rmarg + 15)/16;
	  fquad = (offset FORMAT.quad + 15)/16;
	  flook = (offset FORMAT.look + 15)/16;
	  firstbinary = flook
	  nbinaries = 1;
	]

manifest [ formatl = (size FORMAT + 15) / 16 ]
manifest [ changel = 2 * formatl ]

structure SPEC[
	@LIST
	link word
	trailerlength word
	dirty bit
	marker bit
	blank bit 6
	doc byte
	para word
	@FORMAT
	]

manifest [ specbase = (size SPEC + 15) / 16 ]
manifest [ firstformat = specbase - formatl ]
manifest [ abandon = 255 ] // doc = 255 means abandon spec

structure FCODE[
	kind bit 3
	wordn bit 3
	bitn bit 4
	un bit 1
	blank bit 5
	]

manifest [
	knormal = 0
	kdigit = 1
	kcr = 2
	klook = 3
	kquad = 4
	kmeasure = 5
	knone = #7 // three bits of a -1
	]

structure ST[
	blank word
	open word
	close word
	gets word
	puts word
	reset word
	putback word
	error word
	endof word
	stateof word
	blank word
	blank word
	blank word
	type word
	]

manifest
	[

	lookspmask	= #1
	lookcrmask	= #2
	looktabmask	= #4
	looktrailermask	= #10
	lookmarkermask	= #20
	lookremarkmask	= #40 // $$

	farcp		= 350 // cpseeable // $$ was 700
	fardl		= 10 // scan -- max scroll // $$ was 20
 
	xcursorloc	= #426 ;
	ycursorloc	= #427 ;
// $$[

	widthspmin	= 4
	widthspave	= 8
	tabchstd	= 64
	minline		= 15

	devalto		= 0
	devdp		= 1

	altolmarg	= 30
	altormarg	= 565

	dplmarg		= 180
	dprmarg	= 540
	dpwidthcc	= 6
	dpspmin		= 3
	dpspave		= 6
	dptabch		= 6
	dptabwidth	= 48
	dppitch		= 6
	dpheight	= 8

	marglevel	= 5
// $$]
	ywwtop		= 48 ;// $$ 
	ywwsys		= ywwtop+16
	ywwmenu1	= ywwtop+32
	ywwmenu2	= ywwtop+48
	ywwscr1	= ywwtop+448 ; // $$ 
	ywwscr2	= ywwscr1-96 ; // $$

	xlstripe		= 15; // $$ was 24
	xrstripe	= 580;
	ytstripe		= 10;

	pagebarxfirst	= 30 // $$ was something ridiculous
	pagebarxlast	= 600 // $$ was something ridiculous
	tabwidthmin	= 8 // currently same as tabwidthstd 

	lfmenu		= 2
	idmenu1		= 1
	idmenu2		= 2
	idmenu3		= 3
	idmenu4		= 4
	idmenu5		= 5
	idbanner1	= 1
	idbanner2	= 2
	idbanner3	= 3

	swindow		= 2 ; // 0=snone 1=sline
	sbound		= 3 ;
	snew		= 4 ;
	ssplit		= 5 ; // 6=schar
	snoline		= 7 ;
	smchar		= 8 ;
	smline		= 9 ;
	smenu		= 10 ;
	spage		= 11 ;

	sinvert		= -10 ;

	topblk		= #36 // also listed in GKBD.SR
	midblk		= #34
	botblk		= #31
	
	shtopblk	= #37
	shmidblk	= #35
	shbotblk	= #32
	
	sh		= #24
	shsh		= #26
	shesc		= #23
	shdel		= #27
	shbs		= #20
	
	shlf		= #22
	shtab		= #21
	shcr		= #25
	shsp		= #30

	skeyboard	= #0  ; // 000-377 except 0
	skeyset		= #400; // 400-437 except 400
	smouse		= #440; // 440-507 except 440,450,460,470,500
	sstripe		= #510; // 510-514
	maxcode	= #515

	sinchar		= 1 ;
	scoleft		= 2 ;
	scoright		= 3 ;
	smapchar	= 4 ;

	spaste		= 5 ;
	scut		= 6 ;
	sreadf		= 7 ;
	swritef		= 8 ;
	squit		= 9 ;

	spointchar	= 10 ;

	scoleftword	= 11 ;

	sstripeline	= 12 ; // these 5 must be consecutive
	sstripenone	= 13 ;
	sstripewindow	= 14 ;
	sstripefly	= 15 ;
	sstripemenu	= 16 ;

	sjumpup	= 17 ;
	sjumpfar	= 18 ;
	sjumpdown	= 19 ;

	srollup		= 20 ;
	srolldown	= 21 ;
	srollover	= 22 ;

	sdirectory	= 23 ;

	sdivwindow	= 24 ;
	smodwindow	= 25 ;

	splaceright	= 26 ;
	splaceleft	= 27 ;

	srollupfast	= 28 ;
	srolldownfast	= 29 ;
	srollupfar	= 30 ;
	srolldownfar	= 31 ;

	smove		= 32 ;
	snewwindow	= 33 ;

	soverwrite	= 34 ;
	sprintfile	= 35 ;

	slookey		= 36 ;

	sjustifyww	= 38 ;
	smark		= 39 ;

	scutpaste	= 40 ;
	sroll		= 41 ;
	sexchange	= 42 ;

	sdelwindow	= 43 ;

	sthing		= 44 ;

	sparagraph	= 45 ;
	scarrier		= 46 ;

	sflyaway	= 47 ;
	sbugmenu	= 48 ;

	stabulator	= 49 ;

	spageto		= 50 ; // $$

	slevel		= 51 ; // $$

	maxsig		= 52 ; // insert sig codes before this line


	mquit		= 0
	mdirectory	= 1
	mcancel		= 2
	mfile		= 3
	mall		= 4
	mprint		= 5
	mfetch		= 6
	mscan		= 8
	msubstitute	= 9
	mdocument	= 10
	mturnto		= 11
	madd		= 12
	mcreate		= 13
	mmake		= 14
// $$[
	mdouble		= 15
	mheadings	= 16
	mpagenums	= 17
	mrepaginate	= 18
	mstart		= 19
	mstop		= 20
	mcassette	= 21
	mwrite		= 22
	mput		= 23
	mdrawer	= 24 // %%
	maxmitems	= 25 // insert menu codes before this line
				// and recompile GMENU
// $$]
	mmdir		= 0
	mmclean		= 1
	mmdirty		= 2
	mmnull		= 3
	mmnodoc	= 4
// $$[
	mmprint		= 5
	mmstop		= 6
	mmcassette	= 7
	mmdirnocab	= 8 // %%
	mmnodocnocab	= 9 // %%
	maxmenumessages = 10 // insert menu message codes above
// $$]

	maxtrailerl	= 100	// characters

	chtrailer	= $Z-#100

	chmod		= #376 //used for italicizing etc
	extrafont	= 30 // words needed by chmod // $$

	worthcompact	= 2000 // if regainable by overlay

	fnopsys = 4;	// moved here and changed from BRAVO.DF
	fnfont = 5;

	fnfilebb = 6;
	fneditbb = 7;
	fnwwbb = 8
	fnmenubb = 9
	fndevbb = 10;

// **	IF MORE BB FILES ARE ADDED ABOVE:
//	INCREASE lastfnbb AND MAYBE minuserfn BELOW, 
//	ADD "---module" MANIFEST TO LIST BELOW AND TO QINITCOMT.SR,
//	AND ADD FILE NAME TO GOVERLAY.SR (openoverlay).

//	WHEN minuserfn IS CHANGED, RECOMPILE GFILE.SR TOO

	minuserfn = 12; // 1 or 2 bigger than last bb but ls maxfn

	firstfnbb = 6 ;	// !!!!!
	lastfnbb = 10 ;	// !!!!!

	nomodule	= 0;
	resmodule	= 1;
	initmodule	= 2;
	menumodule	= fnmenubb // $$
	editmodule	= fneditbb;
	wwmodule	= fnwwbb;
	lookmodule	= fneditbb; // shared now
	mousemodule	= resmodule; // shared now
	dirtymodule	= fnfilebb // $$
	devicemodule	= fndevbb // $$
	];