// Created by Newton Book Maker 1.1
// ‘‘ Note: This file may contain needed resources !! 
// Document
book := {
	version: 2,
	isbn: "ISBN5:12:20 PM",
	help: TRUE,
	contents: Array(24, NIL),
	styles: [],
	browsers: [], templates: [], rendering: []};

// The following two lines have been manually commented out...
// see the BookMaker 1.1 release notes.  (This is a VERY
// important thing to do to create help books!)
// output.book := book;
// output.help := TRUE;

// Shared Map Functions
func MakePage(aTemplate)
	{template: aTemplate, blocks: []};
func MakeBlock(aBounds, anItem)
	{bounds: aBounds, item: anItem};

// Shared Scripts
gotoDestScript := func() begin
	if (curRendering = 0) then :TurnToPage(destPage);
	else :TurnToPage(:FindPageByContent(kioskDest, 0, NIL));
end;

// Text Styles
s0 := {
	family: 'Geneva,
	face: 0,
	size: 9};
AddArraySlot(book.styles, s0);

s1 := {
	family: 'espy /* Monaco */,
	face: 0,
	size: 10};
AddArraySlot(book.styles, s1);

s2 := {
	family: 'Espy,
	face: 1,
	size: 10};
AddArraySlot(book.styles, s2);

s3 := {
	family: 'Espy,
	face: 0,
	size: 10};
AddArraySlot(book.styles, s3);

s4 := {
	family: 'Geneva,
	face: 0,
	size: 9};
AddArraySlot(book.styles, s4);

s5 := {
	family: 'Geneva,
	face: 0,
	size: 10};
AddArraySlot(book.styles, s5);

s6 := {
	family: 'espy /* Avant Garde */,
	face: 0,
	size: 10};
AddArraySlot(book.styles, s6);


// Contents
c1 := {
	data: "About Beyond Help",
	viewFont: s2,
	layout: 32
};
book.contents[0] := c1;

c2 := {
	data: "
This is a sample help book, written to demonstrate how to add help to your application.  The app has two buttons, both of which open the manual, but the 2nd opens the manual so that the Llamas topic is open.

Sample app and help book by Bob Ebert.

Many thanks to the Scott Shwarts and David Dunham for help creating this sample.",
	viewFont: s3
};
book.contents[1] := c2;

c3 := {
	data: "Help Book Overview",
	viewFont: s2,
	layout: 32
};
book.contents[2] := c3;

c4 := {
	data: "
The help book is organized into two main levels, a \"topics\" level and a \"page\" level.  The book always opens to the  topics level, and each line in the topics level can either have subtopics or a single page.

Each page is meant to describe a specific topic.  The content for a topic cannot be larger than a page, as no scrolling is supported.  The only navigation available from a page is to return to the topics.",
	viewFont: s3
};
book.contents[3] := c4;

c5 := {
	data: "Help Book Usage",
	styles: [15, s2, 1, s3],
	layout: 32
};
book.contents[4] := c5;

c6 := {
	data: "
Help books are intended to provide \"How Do I\" type help to an application.  It should list step by step instructions to get a user on the right track.

The main rule for help books is KISS:
	Keep It Simple, Stupid

The help book should tells users what they need to know to perform some task with an application, and not much else.
",
	styles: [185, s3, 4, s2, 145, s3],
	tabs: [18]
};
book.contents[5] := c6;

c7 := {
	data: "Things to avoid",
	styles: [15, s2, 1, s3],
	layout: 32
};
book.contents[6] := c7;

c8 := {
	data: "
Help books are not designed to present the entire users manual.  (You might consider using a separate electonic book for that.)

Application help books should not describe how to perform system-wide tasks, such as Faxing or Printing.  (The System Help Book already describes those.)  Only special tasks for your application need to be described.

This help book is a bad example.  :-)",
	styles: [382, s3, 4, s4]
};
book.contents[7] := c8;

c9 := {
	data: "Building a Help Book",
	styles: [20, s2, 1, s3],
	layout: 32
};
book.contents[8] := c9;

c10 := {
	data: "
	Build your book in the word processor.
	Drop the file on Newton BookMaker
	Choose Help Size in the Options menu.
	Click on the \"Do It\" button.
	Save the result.
	Add code to Project Data to read in the book. e.g., 
	ref := OpenResFileX(HOME&\"book.f\");
	load(HOME&\"book.f\");
	CloseResFileX(ref) ;
	The book is available to the app.",
	styles: [61, s3, 16, s5, 10, s3, 9, s5, 8, s3, 7, s5, 199, s3, 4, s5, 26, s3],
	tabs: [18]
};
book.contents[9] := c10;

c11 := {
	data: "User Interface for Opening",
	styles: [26, s2, 1, s3],
	layout: 32
};
book.contents[10] := c11;

c12 := {
	data: GetNamedResource("PICT", "16789", 'picture)
};
book.contents[11] := c12;

c13 := {
	data: "
The interface element you use for accessing help is the protoInfoButton, which is a system prototype included in Newton 2.0. 

There is a code sample 'infoButton' which includes a simple protoInfoButton proto, for use for pre-Newton 2.0 machines.  It will not do everything that the Newton 2.0 proto does, but it works.",
	viewFont: s3
};
book.contents[12] := c13;

c14 := {
	data: "Opening a Help Book",
	styles: [19, s2, 1, s3],
	layout: 32
};
book.contents[13] := c14;

c15 := {
	data: "
	Create a template frame like this:
	{_proto: GetRoot().TinyTim._proto,
	 bookRef: theBook}
	Build a view using BuildContext()
	Send the OpenManual message
	to the view.
	Or use OpenManualTo().

	Be sure to close the Help Book when
	the app closes.",
	styles: [38, s3, 56, s5, 21, s3, 14, s5, 54, s3, 14, s5, 58, s3],
	tabs: [18]
};
book.contents[14] := c15;

c16 := {
	data: "A Font Tip",
	styles: [10, s2, 1, s3],
	layout: 32
};
book.contents[15] := c16;

c17 := {
	data: "
You should consider using the system font (Espy Sans) for your help book.  A bitmap version Espy Sans comes with Newton ToolKit.

Or, just use any font besides New York or Geneva.  The Newton BookMaker turns all unknown fonts into Espy Sans.  (The source for this paragraph is in Avant Garde!)",
	styles: [131, s3, 163, s6, 1, s3]
};
book.contents[16] := c17;

c18 := {
	data: "Llamas (a topic with subtopics)",
	layout: 2048
};
book.contents[17] := c18;

c19 := {
	data: "Llama Basics",
	viewFont: s2,
	layout: 32, 
	name: "LlamaTopic"
};
book.contents[18] := c19;

c20 := {
	data: GetNamedResource("PICT", "22007", 'picture),
	layout: 4
};
book.contents[19] := c20;

c21 := {
	data: "	A llama is:
		Helpful
		Courteous
		Kind
		Obedient
		Cheerful
		Thrifty
		Brave
		Clean
		Reverent",
	viewFont: s3,
	tabs: [36, 54]
};
book.contents[20] := c21;

c22 := {
	data: "Llama don'ts",
	viewFont: s2,
	layout: 32
};
book.contents[21] := c22;

c23 := {
	data: GetNamedResource("PICT", "31160", 'picture),
	layout: 4
};
book.contents[22] := c23;

c24 := {
	data: "NEVER:
 Whack your llama.
 Taunt your llama.
 Mock your llama.
 Leave your llama out in the rain.
 Expose your llama to direct sunlight.
 Let your llama run heavy machinery.
 Mix your llama with alcohol or drugs.
 Fold, Spindle, or Mutilate your llama.
 Let your llama eat lupines.",
	styles: [7, s2, 284, s3]
};
book.contents[23] := c24;


// Kiosk (menu page) references

// Page Templates
NBMDefault := {
	nColumns: 1,
	column: [{
	width: 12,
	type: 0}]
};
AddArraySlot(book.templates, NBMDefault);

// Bounds List
bnd1 := [0,0,206,14];
bnd2 := [0,14,206,214];
bnd3 := [0,14,120,34];
bnd4 := [0,34,206,214];
bnd5 := [87,14,119,46];
bnd6 := [0,46,206,214];
bnd7 := [0,46,206,186];

// Pages
pageList := {pageSize: {left: 0, top: 0, right: 206, bottom: 214}, pages: []};

// Page 1
page := MakePage(NBMDefault);
AddArraySlot(page.blocks, MakeBlock(bnd1, c1));
AddArraySlot(page.blocks, MakeBlock(bnd2, c2));
AddArraySlot(pageList.pages, page);

// Page 2
page := MakePage(NBMDefault);
AddArraySlot(page.blocks, MakeBlock(bnd1, c3));
AddArraySlot(page.blocks, MakeBlock(bnd2, c4));
AddArraySlot(pageList.pages, page);

// Page 3
page := MakePage(NBMDefault);
AddArraySlot(page.blocks, MakeBlock(bnd1, c5));
AddArraySlot(page.blocks, MakeBlock(bnd2, c6));
AddArraySlot(pageList.pages, page);

// Page 4
page := MakePage(NBMDefault);
AddArraySlot(page.blocks, MakeBlock(bnd1, c7));
AddArraySlot(page.blocks, MakeBlock(bnd2, c8));
AddArraySlot(pageList.pages, page);

// Page 5
page := MakePage(NBMDefault);
AddArraySlot(page.blocks, MakeBlock(bnd1, c9));
AddArraySlot(page.blocks, MakeBlock(bnd2, c10));
AddArraySlot(pageList.pages, page);

// Page 6
page := MakePage(NBMDefault);
AddArraySlot(page.blocks, MakeBlock(bnd1, c11));
AddArraySlot(page.blocks, MakeBlock(bnd3, c12));
AddArraySlot(page.blocks, MakeBlock(bnd4, c13));
AddArraySlot(pageList.pages, page);

// Page 7
page := MakePage(NBMDefault);
AddArraySlot(page.blocks, MakeBlock(bnd1, c14));
AddArraySlot(page.blocks, MakeBlock(bnd2, c15));
AddArraySlot(pageList.pages, page);

// Page 8
page := MakePage(NBMDefault);
AddArraySlot(page.blocks, MakeBlock(bnd1, c16));
AddArraySlot(page.blocks, MakeBlock(bnd2, c17));
AddArraySlot(pageList.pages, page);

// Page 9
page := MakePage(NBMDefault);
AddArraySlot(page.blocks, MakeBlock(bnd1, c19));
AddArraySlot(page.blocks, MakeBlock(bnd5, c20));
AddArraySlot(page.blocks, MakeBlock(bnd6, c21));
AddArraySlot(pageList.pages, page);

// Page 10
page := MakePage(NBMDefault);
AddArraySlot(page.blocks, MakeBlock(bnd1, c22));
AddArraySlot(page.blocks, MakeBlock(bnd5, c23));
AddArraySlot(page.blocks, MakeBlock(bnd7, c24));
AddArraySlot(pageList.pages, page);

AddArraySlot(book.rendering, pageList);

// Browsers & Page Hints
b1 := {
	name: "Contents",  list: []
};


AddArraySlot(b1.list, {	// 0
	item: c1
});
AddArraySlot(b1.list, {	// 1
	item: c3
});
AddArraySlot(b1.list, {	// 2
	item: c5
});
AddArraySlot(b1.list, {	// 3
	item: c7
});
AddArraySlot(b1.list, {	// 4
	item: c9
});
AddArraySlot(b1.list, {	// 5
	item: c11
});
AddArraySlot(b1.list, {	// 6
	item: c14
});
AddArraySlot(b1.list, {	// 7
	item: c16
});
AddArraySlot(b1.list, {	// 8
	item: c18
});
AddArraySlot(b1.list, {	// 9
	level: 2,
	item: c19
});
AddArraySlot(b1.list, {	// 10
	level: 2,
	item: c22
});
AddArraySlot(book.browsers, b1);

// Indices and Sub-Indices
