Home » Archimedes archive » Archimedes World » AW-1994-06-Disc2.adf » Disk2Jun94 » !AWJune94/Goodies/Zap/!Zap/Docs/E-Windows

!AWJune94/Goodies/Zap/!Zap/Docs/E-Windows

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Archimedes World » AW-1994-06-Disc2.adf » Disk2Jun94
Filename: !AWJune94/Goodies/Zap/!Zap/Docs/E-Windows
Read OK:
File size: 26AA bytes
Load address: 0000
Exec address: 0000
File contents
*************************************************************************
* >E-Windows	Documents a zap window block format.			*
*************************************************************************

By convention, window blocks are pointed to by R8. However, as with files,
the pointer address may change whenever a window is created. Thus, as for
files, block pointers should be changed to window offsets for storing. Use
the calls Zap_GetWindOff, Zap_ConvWindOff. The first two paragraphs of E-File
hold if you replace 'file block' by 'window block' and R9 by R8. Please read
the E-File file first.

Window block offsets have names beginning 'w_'. See E-Library for a complete
list. Each window determines uniquely a file via the offset w_file.

As far as Zap and the extension modes are concerned, a Zap text window
consists of a rectangle of characters. Coordinates are usually given in terms
of row and column in R2,R3. Ie, by convention,

	R2=column offset from left hand edge, in characters.
	R3=offset in lines from the top of the display, in lines.
	
R2 includes the margin which may contain the line numbers. The line numbers
are handled automatically by zap. Thus a window looks like:

			0	w_margin	w_width
		      0 -------------------------
			|	|		|
			|	|		|
			|	|		|
			|	|		|
			|	|		|
	       w_height	-------------------------

The quantity w_width-w_margin is usually stored in the mode dependent byte
w_bpl (bytes per line). However for byte/word modes this is not true, and the
number of bytes in the file that the line represents is stored in w_bpl. It
is up to the mode concerned to fill in w_bpl.

The are two ways of numbering lines in Zap. These are called PHYSICAL line
numbers and LOGICAL line numbers. The PHYSICAL line number of a file offset
is the line offset from the top of the file in the display. Ie, it is the 'y'
value of that character starting from 0 on the first line. All line counts
start from zero within zap, though the number w_stline is added before the
line number is printed on screen for the user. The LOGICAL line number of a
file offset is determined entirely by the extension mode and Zap doesn't care
what it is. For example, in text mode it is taken to be the number of
carriage returns before the offset (ie the physical line it would have been
on if the display hadn't been wrapped). In BASIC mode, it is taken to be the
actual number of the line as encoded in the program.

A further complication is that the window text display is cached. The start
of the cached area is used as a reference point for working out the file
offset of a given physical or logical line number. Thus it is not necessary
to start counting from the start of the file to find out where a line is. All
line references work locally from this value, which is the start of the
cached display, which is where the user is likely to be editing! The calls
Zap_FindOffset and Zap_OffLineCol use this fact. These calls use the mode
entry points 'e_cln*'. Thus these entry points should use this reference
point. Thus the mode will need a piece of code (usually called cln_backward)
for tracing lines backwards up the file. (See the docs on these entry
points).

The cache itself consists of a number of lines of width w_txtw. This width is
usually w_width rounded up to the next multiple of 8. An extension mode need
not usually concern itself with this cache unless it is drawing its own
display. See the mode entry point e_redrawline in which you are asked to fill
a line in the cache. I reserve the right to change the format of the cache,
so don't access it directly.

The window block offsets are described below. Use E-Library to set up the
definitions.

w_handle
Window handle for this window or -1 if the window has been deleted and this
block is now 'dead'. Dead blocks should be skipped if you are going through
the windows in sequence.

w_minx
w_miny
w_maxx
w_maxy
w_scrollx
w_scrolly
w_infront
w_windowflags
These are as for a wimp window block. See PRM if in doubt. You can use
the code MOV R1,R8:SYS "XOS_GetWindowState" to update these values.

w_file
Gives the file offset of the associated file. Use Zap_ConvFileOff to convert
this to a file pointer in R9. This is done automatically for you by
Zap_ConvWindOff.

w_format
Gives the display format flags and the mode the window is in. See E-Flags for
details.

w_width
Width of window in columns (including the margin).

w_height
Height of window in lines.

w_txt
Address of text cache.

w_txth
Number of lines claimed for txt cache. Each line consists of w_txtw number of
characters followed by a foreground mask (of length w_txtw) and then a
background mask (of length w_txtw). Thus the size of the cache is
w_txth*w_txtw*3. w_txtw*3, the 'actual length' of a cached line is stored in
the variable w_txtlen. See e_redraw line for more details.

w_txtw
Width of a text cache line in characters. Must be a multiple of 8.

w_txtn
Number of lines cached in the txt cache.

w_coff
Reference point giving the file offset of the start of the first cached
physical line.

w_cline
Reference point giving the physical line number (first line 0) of the start
of the first cached physical line.

w_clogl
As for w_cline but gives the logical line number.

w_tab
Gives the coltab width.

w_tabc
Gives the character code tab mask (x4) eg &09090909. Set this to the same as
w_cr if you want the tabs to be invisible.

w_cr
Gives the line terminator mask (x4) eg &0A0A0A0A.

w_flags
Gives the flags status for this window. See E-Flags. When a window is created
the default value is taken from opt_flags.

w_title
Points to the window title string.

w_bpl
Mode dependent word. Usually stores the width of the display in characters.
Byte mode stores the number of bytes shown on each line etc.

w_margin
Width of the left hand margin in characters (including any line numbers - so
this may be non zero even if the user has not set a margin).

w_rl
Height in pixels of each character including the line spacing.

w_rw
Width in pixels of each character.

w_rh
Height in pixels of each character excluding line spacing.

w_addr
Address to show in margin for file offset 0.

w_stline
Line number to show in margin for line offset 0.

w_titlelen
w_titbuf
w_titlen
Used internally for title update.

w_mwidth
User required margin width before space for line numbers added.

w_tabchar
User required tab character code x4 (eg &09090909) before tab visibility
taken into account. w_tabc contains the one actually being used.

w_linesp
User required line spacing in 1/8ths char.

w_savedo
Used internally by Zap_DoCommand to store the offset of the first shiftable
line after a command, and by Zap_SaveWinStatus to store the file offset of
the character whose position should remain fixed when the window is
recreated.

w_savedl
Used internally by Zap_DoCommand to store the physical line number of the
first shiftable line after a command, and by Zap_SaveWinStatus to store the y
offset from the top of the window in pixels of the character whose position
should remain fixed when the window is recreated.

w_savedc
Used internally by Zap_DoCommand to store the number of physical lines text
after the first shiftable line should be shifted down after a command
(signed).

w_savedh
Used internally by Zap_DoCommand to save the window height before a sequence
of commands was performed.

w_savedlc
Used internally by Zap_DoCommand and Zap_SaveWinStatus

w_wrapwidth
Wordwrap width.

w_togminx
w_togminy
w_togmaxx
w_togmaxy
These save the 'small' window position for the toggle size key (scG).

w_txtlen
Actual length of a cache line including the foreground and background masks.

w_palette
Pointer to current redraw palette. This consists of 32 words. The first 16
give the 24 bit colour translations (&BBGGRRxx) for Zap colours 0-15
(0/1=background 2=foreground etc) and is used by VDU mode redraws. The 16
words after that give the corresponding bitmap masks for poking into the
screen during a fast redraw.

w_pwind
w_pline
w_pcol
w_poff
w_ploff
w_pwidth
This is the 'cursor block' of the 'point' position. This is the file offset
of the current 'input' position in the file when the file does not contain
the cursor. It is updated when the cursor moves from one file to another.
This position is usually marked with an empty square cursor. See the file
E-Cursors for what the variables store - w_poff is the most useful giving the
file offset of the 'point'. w_pwind is set up as the window offset of this
current window. This in its self is not useful but enables you to call
cursor handling routines with R10=R8+w_pwind (provided the routine doesn't
use any of the 'old' offsets).

w_saveds
Used internally by Zap_DoCommand. Saves the first file offset to be updated
on screen after the command has finished.

w_modedata
This points to a block which stores the mode dependant data handled by Zap.
The block consists of blocks of the same format as in the Zap dependant bit
of the !Config file - see E-Vars, and is liable to change with different
versions. Use Zap calls (eg Zap_ModeColour) to read/write the contents of
this block.

w_res10-w_res16
Reserved words

w_mode0-w_mode15
Mode words. Each mode has one word in each in window in which to store the
options pertaining to that mode. If bit 10 of the flags in the modes e_mode
entry point is SET then instead of storing data, the mode word holds
a pointer to a block of data in Zap's heap (or 0 if the block has not been
created). In this case, the first word of the block MUST contain the length
of the block (including the first word). The block will be copied
automatically by Zap, for example, on a New View. The block will be freed
automatically when the window is closed. The block is created automatically
when a window is opened, and filled with the contents of the default block
stored in the !Config file and accessed via Zap_Read/Write Var - see E-Vars.
00000000  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000040  2a 2a 2a 2a 2a 2a 2a 2a  2a 0a 2a 20 3e 45 2d 57  |*********.* >E-W|
00000050  69 6e 64 6f 77 73 09 44  6f 63 75 6d 65 6e 74 73  |indows.Documents|
00000060  20 61 20 7a 61 70 20 77  69 6e 64 6f 77 20 62 6c  | a zap window bl|
00000070  6f 63 6b 20 66 6f 72 6d  61 74 2e 09 09 09 2a 0a  |ock format....*.|
00000080  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000000c0  2a 2a 2a 2a 2a 2a 2a 2a  2a 0a 0a 42 79 20 63 6f  |*********..By co|
000000d0  6e 76 65 6e 74 69 6f 6e  2c 20 77 69 6e 64 6f 77  |nvention, window|
000000e0  20 62 6c 6f 63 6b 73 20  61 72 65 20 70 6f 69 6e  | blocks are poin|
000000f0  74 65 64 20 74 6f 20 62  79 20 52 38 2e 20 48 6f  |ted to by R8. Ho|
00000100  77 65 76 65 72 2c 20 61  73 20 77 69 74 68 20 66  |wever, as with f|
00000110  69 6c 65 73 2c 0a 74 68  65 20 70 6f 69 6e 74 65  |iles,.the pointe|
00000120  72 20 61 64 64 72 65 73  73 20 6d 61 79 20 63 68  |r address may ch|
00000130  61 6e 67 65 20 77 68 65  6e 65 76 65 72 20 61 20  |ange whenever a |
00000140  77 69 6e 64 6f 77 20 69  73 20 63 72 65 61 74 65  |window is create|
00000150  64 2e 20 54 68 75 73 2c  20 61 73 20 66 6f 72 0a  |d. Thus, as for.|
00000160  66 69 6c 65 73 2c 20 62  6c 6f 63 6b 20 70 6f 69  |files, block poi|
00000170  6e 74 65 72 73 20 73 68  6f 75 6c 64 20 62 65 20  |nters should be |
00000180  63 68 61 6e 67 65 64 20  74 6f 20 77 69 6e 64 6f  |changed to windo|
00000190  77 20 6f 66 66 73 65 74  73 20 66 6f 72 20 73 74  |w offsets for st|
000001a0  6f 72 69 6e 67 2e 20 55  73 65 0a 74 68 65 20 63  |oring. Use.the c|
000001b0  61 6c 6c 73 20 5a 61 70  5f 47 65 74 57 69 6e 64  |alls Zap_GetWind|
000001c0  4f 66 66 2c 20 5a 61 70  5f 43 6f 6e 76 57 69 6e  |Off, Zap_ConvWin|
000001d0  64 4f 66 66 2e 20 54 68  65 20 66 69 72 73 74 20  |dOff. The first |
000001e0  74 77 6f 20 70 61 72 61  67 72 61 70 68 73 20 6f  |two paragraphs o|
000001f0  66 20 45 2d 46 69 6c 65  0a 68 6f 6c 64 20 69 66  |f E-File.hold if|
00000200  20 79 6f 75 20 72 65 70  6c 61 63 65 20 27 66 69  | you replace 'fi|
00000210  6c 65 20 62 6c 6f 63 6b  27 20 62 79 20 27 77 69  |le block' by 'wi|
00000220  6e 64 6f 77 20 62 6c 6f  63 6b 27 20 61 6e 64 20  |ndow block' and |
00000230  52 39 20 62 79 20 52 38  2e 20 50 6c 65 61 73 65  |R9 by R8. Please|
00000240  20 72 65 61 64 0a 74 68  65 20 45 2d 46 69 6c 65  | read.the E-File|
00000250  20 66 69 6c 65 20 66 69  72 73 74 2e 0a 0a 57 69  | file first...Wi|
00000260  6e 64 6f 77 20 62 6c 6f  63 6b 20 6f 66 66 73 65  |ndow block offse|
00000270  74 73 20 68 61 76 65 20  6e 61 6d 65 73 20 62 65  |ts have names be|
00000280  67 69 6e 6e 69 6e 67 20  27 77 5f 27 2e 20 53 65  |ginning 'w_'. Se|
00000290  65 20 45 2d 4c 69 62 72  61 72 79 20 66 6f 72 20  |e E-Library for |
000002a0  61 20 63 6f 6d 70 6c 65  74 65 0a 6c 69 73 74 2e  |a complete.list.|
000002b0  20 45 61 63 68 20 77 69  6e 64 6f 77 20 64 65 74  | Each window det|
000002c0  65 72 6d 69 6e 65 73 20  75 6e 69 71 75 65 6c 79  |ermines uniquely|
000002d0  20 61 20 66 69 6c 65 20  76 69 61 20 74 68 65 20  | a file via the |
000002e0  6f 66 66 73 65 74 20 77  5f 66 69 6c 65 2e 0a 0a  |offset w_file...|
000002f0  41 73 20 66 61 72 20 61  73 20 5a 61 70 20 61 6e  |As far as Zap an|
00000300  64 20 74 68 65 20 65 78  74 65 6e 73 69 6f 6e 20  |d the extension |
00000310  6d 6f 64 65 73 20 61 72  65 20 63 6f 6e 63 65 72  |modes are concer|
00000320  6e 65 64 2c 20 61 20 5a  61 70 20 74 65 78 74 20  |ned, a Zap text |
00000330  77 69 6e 64 6f 77 0a 63  6f 6e 73 69 73 74 73 20  |window.consists |
00000340  6f 66 20 61 20 72 65 63  74 61 6e 67 6c 65 20 6f  |of a rectangle o|
00000350  66 20 63 68 61 72 61 63  74 65 72 73 2e 20 43 6f  |f characters. Co|
00000360  6f 72 64 69 6e 61 74 65  73 20 61 72 65 20 75 73  |ordinates are us|
00000370  75 61 6c 6c 79 20 67 69  76 65 6e 20 69 6e 20 74  |ually given in t|
00000380  65 72 6d 73 0a 6f 66 20  72 6f 77 20 61 6e 64 20  |erms.of row and |
00000390  63 6f 6c 75 6d 6e 20 69  6e 20 52 32 2c 52 33 2e  |column in R2,R3.|
000003a0  20 49 65 2c 20 62 79 20  63 6f 6e 76 65 6e 74 69  | Ie, by conventi|
000003b0  6f 6e 2c 0a 0a 09 52 32  3d 63 6f 6c 75 6d 6e 20  |on,...R2=column |
000003c0  6f 66 66 73 65 74 20 66  72 6f 6d 20 6c 65 66 74  |offset from left|
000003d0  20 68 61 6e 64 20 65 64  67 65 2c 20 69 6e 20 63  | hand edge, in c|
000003e0  68 61 72 61 63 74 65 72  73 2e 0a 09 52 33 3d 6f  |haracters...R3=o|
000003f0  66 66 73 65 74 20 69 6e  20 6c 69 6e 65 73 20 66  |ffset in lines f|
00000400  72 6f 6d 20 74 68 65 20  74 6f 70 20 6f 66 20 74  |rom the top of t|
00000410  68 65 20 64 69 73 70 6c  61 79 2c 20 69 6e 20 6c  |he display, in l|
00000420  69 6e 65 73 2e 0a 09 0a  52 32 20 69 6e 63 6c 75  |ines....R2 inclu|
00000430  64 65 73 20 74 68 65 20  6d 61 72 67 69 6e 20 77  |des the margin w|
00000440  68 69 63 68 20 6d 61 79  20 63 6f 6e 74 61 69 6e  |hich may contain|
00000450  20 74 68 65 20 6c 69 6e  65 20 6e 75 6d 62 65 72  | the line number|
00000460  73 2e 20 54 68 65 20 6c  69 6e 65 20 6e 75 6d 62  |s. The line numb|
00000470  65 72 73 0a 61 72 65 20  68 61 6e 64 6c 65 64 20  |ers.are handled |
00000480  61 75 74 6f 6d 61 74 69  63 61 6c 6c 79 20 62 79  |automatically by|
00000490  20 7a 61 70 2e 20 54 68  75 73 20 61 20 77 69 6e  | zap. Thus a win|
000004a0  64 6f 77 20 6c 6f 6f 6b  73 20 6c 69 6b 65 3a 0a  |dow looks like:.|
000004b0  0a 09 09 09 30 09 77 5f  6d 61 72 67 69 6e 09 77  |....0.w_margin.w|
000004c0  5f 77 69 64 74 68 0a 09  09 20 20 20 20 20 20 30  |_width...      0|
000004d0  20 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  | ---------------|
000004e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0a 09 09 09 7c 09  |----------....|.|
000004f0  7c 09 09 7c 0a 09 09 09  7c 09 7c 09 09 7c 0a 09  ||..|....|.|..|..|
00000500  09 09 7c 09 7c 09 09 7c  0a 09 09 09 7c 09 7c 09  |..|.|..|....|.|.|
00000510  09 7c 0a 09 09 09 7c 09  7c 09 09 7c 0a 09 20 20  |.|....|.|..|..  |
00000520  20 20 20 20 20 77 5f 68  65 69 67 68 74 09 2d 2d  |     w_height.--|
00000530  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000540  2d 2d 2d 2d 2d 2d 2d 0a  0a 54 68 65 20 71 75 61  |-------..The qua|
00000550  6e 74 69 74 79 20 77 5f  77 69 64 74 68 2d 77 5f  |ntity w_width-w_|
00000560  6d 61 72 67 69 6e 20 69  73 20 75 73 75 61 6c 6c  |margin is usuall|
00000570  79 20 73 74 6f 72 65 64  20 69 6e 20 74 68 65 20  |y stored in the |
00000580  6d 6f 64 65 20 64 65 70  65 6e 64 65 6e 74 20 62  |mode dependent b|
00000590  79 74 65 0a 77 5f 62 70  6c 20 28 62 79 74 65 73  |yte.w_bpl (bytes|
000005a0  20 70 65 72 20 6c 69 6e  65 29 2e 20 48 6f 77 65  | per line). Howe|
000005b0  76 65 72 20 66 6f 72 20  62 79 74 65 2f 77 6f 72  |ver for byte/wor|
000005c0  64 20 6d 6f 64 65 73 20  74 68 69 73 20 69 73 20  |d modes this is |
000005d0  6e 6f 74 20 74 72 75 65  2c 20 61 6e 64 20 74 68  |not true, and th|
000005e0  65 0a 6e 75 6d 62 65 72  20 6f 66 20 62 79 74 65  |e.number of byte|
000005f0  73 20 69 6e 20 74 68 65  20 66 69 6c 65 20 74 68  |s in the file th|
00000600  61 74 20 74 68 65 20 6c  69 6e 65 20 72 65 70 72  |at the line repr|
00000610  65 73 65 6e 74 73 20 69  73 20 73 74 6f 72 65 64  |esents is stored|
00000620  20 69 6e 20 77 5f 62 70  6c 2e 20 49 74 0a 69 73  | in w_bpl. It.is|
00000630  20 75 70 20 74 6f 20 74  68 65 20 6d 6f 64 65 20  | up to the mode |
00000640  63 6f 6e 63 65 72 6e 65  64 20 74 6f 20 66 69 6c  |concerned to fil|
00000650  6c 20 69 6e 20 77 5f 62  70 6c 2e 0a 0a 54 68 65  |l in w_bpl...The|
00000660  20 61 72 65 20 74 77 6f  20 77 61 79 73 20 6f 66  | are two ways of|
00000670  20 6e 75 6d 62 65 72 69  6e 67 20 6c 69 6e 65 73  | numbering lines|
00000680  20 69 6e 20 5a 61 70 2e  20 54 68 65 73 65 20 61  | in Zap. These a|
00000690  72 65 20 63 61 6c 6c 65  64 20 50 48 59 53 49 43  |re called PHYSIC|
000006a0  41 4c 20 6c 69 6e 65 0a  6e 75 6d 62 65 72 73 20  |AL line.numbers |
000006b0  61 6e 64 20 4c 4f 47 49  43 41 4c 20 6c 69 6e 65  |and LOGICAL line|
000006c0  20 6e 75 6d 62 65 72 73  2e 20 54 68 65 20 50 48  | numbers. The PH|
000006d0  59 53 49 43 41 4c 20 6c  69 6e 65 20 6e 75 6d 62  |YSICAL line numb|
000006e0  65 72 20 6f 66 20 61 20  66 69 6c 65 20 6f 66 66  |er of a file off|
000006f0  73 65 74 0a 69 73 20 74  68 65 20 6c 69 6e 65 20  |set.is the line |
00000700  6f 66 66 73 65 74 20 66  72 6f 6d 20 74 68 65 20  |offset from the |
00000710  74 6f 70 20 6f 66 20 74  68 65 20 66 69 6c 65 20  |top of the file |
00000720  69 6e 20 74 68 65 20 64  69 73 70 6c 61 79 2e 20  |in the display. |
00000730  49 65 2c 20 69 74 20 69  73 20 74 68 65 20 27 79  |Ie, it is the 'y|
00000740  27 0a 76 61 6c 75 65 20  6f 66 20 74 68 61 74 20  |'.value of that |
00000750  63 68 61 72 61 63 74 65  72 20 73 74 61 72 74 69  |character starti|
00000760  6e 67 20 66 72 6f 6d 20  30 20 6f 6e 20 74 68 65  |ng from 0 on the|
00000770  20 66 69 72 73 74 20 6c  69 6e 65 2e 20 41 6c 6c  | first line. All|
00000780  20 6c 69 6e 65 20 63 6f  75 6e 74 73 0a 73 74 61  | line counts.sta|
00000790  72 74 20 66 72 6f 6d 20  7a 65 72 6f 20 77 69 74  |rt from zero wit|
000007a0  68 69 6e 20 7a 61 70 2c  20 74 68 6f 75 67 68 20  |hin zap, though |
000007b0  74 68 65 20 6e 75 6d 62  65 72 20 77 5f 73 74 6c  |the number w_stl|
000007c0  69 6e 65 20 69 73 20 61  64 64 65 64 20 62 65 66  |ine is added bef|
000007d0  6f 72 65 20 74 68 65 0a  6c 69 6e 65 20 6e 75 6d  |ore the.line num|
000007e0  62 65 72 20 69 73 20 70  72 69 6e 74 65 64 20 6f  |ber is printed o|
000007f0  6e 20 73 63 72 65 65 6e  20 66 6f 72 20 74 68 65  |n screen for the|
00000800  20 75 73 65 72 2e 20 54  68 65 20 4c 4f 47 49 43  | user. The LOGIC|
00000810  41 4c 20 6c 69 6e 65 20  6e 75 6d 62 65 72 20 6f  |AL line number o|
00000820  66 20 61 0a 66 69 6c 65  20 6f 66 66 73 65 74 20  |f a.file offset |
00000830  69 73 20 64 65 74 65 72  6d 69 6e 65 64 20 65 6e  |is determined en|
00000840  74 69 72 65 6c 79 20 62  79 20 74 68 65 20 65 78  |tirely by the ex|
00000850  74 65 6e 73 69 6f 6e 20  6d 6f 64 65 20 61 6e 64  |tension mode and|
00000860  20 5a 61 70 20 64 6f 65  73 6e 27 74 20 63 61 72  | Zap doesn't car|
00000870  65 0a 77 68 61 74 20 69  74 20 69 73 2e 20 46 6f  |e.what it is. Fo|
00000880  72 20 65 78 61 6d 70 6c  65 2c 20 69 6e 20 74 65  |r example, in te|
00000890  78 74 20 6d 6f 64 65 20  69 74 20 69 73 20 74 61  |xt mode it is ta|
000008a0  6b 65 6e 20 74 6f 20 62  65 20 74 68 65 20 6e 75  |ken to be the nu|
000008b0  6d 62 65 72 20 6f 66 0a  63 61 72 72 69 61 67 65  |mber of.carriage|
000008c0  20 72 65 74 75 72 6e 73  20 62 65 66 6f 72 65 20  | returns before |
000008d0  74 68 65 20 6f 66 66 73  65 74 20 28 69 65 20 74  |the offset (ie t|
000008e0  68 65 20 70 68 79 73 69  63 61 6c 20 6c 69 6e 65  |he physical line|
000008f0  20 69 74 20 77 6f 75 6c  64 20 68 61 76 65 20 62  | it would have b|
00000900  65 65 6e 0a 6f 6e 20 69  66 20 74 68 65 20 64 69  |een.on if the di|
00000910  73 70 6c 61 79 20 68 61  64 6e 27 74 20 62 65 65  |splay hadn't bee|
00000920  6e 20 77 72 61 70 70 65  64 29 2e 20 49 6e 20 42  |n wrapped). In B|
00000930  41 53 49 43 20 6d 6f 64  65 2c 20 69 74 20 69 73  |ASIC mode, it is|
00000940  20 74 61 6b 65 6e 20 74  6f 20 62 65 20 74 68 65  | taken to be the|
00000950  0a 61 63 74 75 61 6c 20  6e 75 6d 62 65 72 20 6f  |.actual number o|
00000960  66 20 74 68 65 20 6c 69  6e 65 20 61 73 20 65 6e  |f the line as en|
00000970  63 6f 64 65 64 20 69 6e  20 74 68 65 20 70 72 6f  |coded in the pro|
00000980  67 72 61 6d 2e 0a 0a 41  20 66 75 72 74 68 65 72  |gram...A further|
00000990  20 63 6f 6d 70 6c 69 63  61 74 69 6f 6e 20 69 73  | complication is|
000009a0  20 74 68 61 74 20 74 68  65 20 77 69 6e 64 6f 77  | that the window|
000009b0  20 74 65 78 74 20 64 69  73 70 6c 61 79 20 69 73  | text display is|
000009c0  20 63 61 63 68 65 64 2e  20 54 68 65 20 73 74 61  | cached. The sta|
000009d0  72 74 0a 6f 66 20 74 68  65 20 63 61 63 68 65 64  |rt.of the cached|
000009e0  20 61 72 65 61 20 69 73  20 75 73 65 64 20 61 73  | area is used as|
000009f0  20 61 20 72 65 66 65 72  65 6e 63 65 20 70 6f 69  | a reference poi|
00000a00  6e 74 20 66 6f 72 20 77  6f 72 6b 69 6e 67 20 6f  |nt for working o|
00000a10  75 74 20 74 68 65 20 66  69 6c 65 0a 6f 66 66 73  |ut the file.offs|
00000a20  65 74 20 6f 66 20 61 20  67 69 76 65 6e 20 70 68  |et of a given ph|
00000a30  79 73 69 63 61 6c 20 6f  72 20 6c 6f 67 69 63 61  |ysical or logica|
00000a40  6c 20 6c 69 6e 65 20 6e  75 6d 62 65 72 2e 20 54  |l line number. T|
00000a50  68 75 73 20 69 74 20 69  73 20 6e 6f 74 20 6e 65  |hus it is not ne|
00000a60  63 65 73 73 61 72 79 0a  74 6f 20 73 74 61 72 74  |cessary.to start|
00000a70  20 63 6f 75 6e 74 69 6e  67 20 66 72 6f 6d 20 74  | counting from t|
00000a80  68 65 20 73 74 61 72 74  20 6f 66 20 74 68 65 20  |he start of the |
00000a90  66 69 6c 65 20 74 6f 20  66 69 6e 64 20 6f 75 74  |file to find out|
00000aa0  20 77 68 65 72 65 20 61  20 6c 69 6e 65 20 69 73  | where a line is|
00000ab0  2e 20 41 6c 6c 0a 6c 69  6e 65 20 72 65 66 65 72  |. All.line refer|
00000ac0  65 6e 63 65 73 20 77 6f  72 6b 20 6c 6f 63 61 6c  |ences work local|
00000ad0  6c 79 20 66 72 6f 6d 20  74 68 69 73 20 76 61 6c  |ly from this val|
00000ae0  75 65 2c 20 77 68 69 63  68 20 69 73 20 74 68 65  |ue, which is the|
00000af0  20 73 74 61 72 74 20 6f  66 20 74 68 65 0a 63 61  | start of the.ca|
00000b00  63 68 65 64 20 64 69 73  70 6c 61 79 2c 20 77 68  |ched display, wh|
00000b10  69 63 68 20 69 73 20 77  68 65 72 65 20 74 68 65  |ich is where the|
00000b20  20 75 73 65 72 20 69 73  20 6c 69 6b 65 6c 79 20  | user is likely |
00000b30  74 6f 20 62 65 20 65 64  69 74 69 6e 67 21 20 54  |to be editing! T|
00000b40  68 65 20 63 61 6c 6c 73  0a 5a 61 70 5f 46 69 6e  |he calls.Zap_Fin|
00000b50  64 4f 66 66 73 65 74 20  61 6e 64 20 5a 61 70 5f  |dOffset and Zap_|
00000b60  4f 66 66 4c 69 6e 65 43  6f 6c 20 75 73 65 20 74  |OffLineCol use t|
00000b70  68 69 73 20 66 61 63 74  2e 20 54 68 65 73 65 20  |his fact. These |
00000b80  63 61 6c 6c 73 20 75 73  65 20 74 68 65 20 6d 6f  |calls use the mo|
00000b90  64 65 0a 65 6e 74 72 79  20 70 6f 69 6e 74 73 20  |de.entry points |
00000ba0  27 65 5f 63 6c 6e 2a 27  2e 20 54 68 75 73 20 74  |'e_cln*'. Thus t|
00000bb0  68 65 73 65 20 65 6e 74  72 79 20 70 6f 69 6e 74  |hese entry point|
00000bc0  73 20 73 68 6f 75 6c 64  20 75 73 65 20 74 68 69  |s should use thi|
00000bd0  73 20 72 65 66 65 72 65  6e 63 65 0a 70 6f 69 6e  |s reference.poin|
00000be0  74 2e 20 54 68 75 73 20  74 68 65 20 6d 6f 64 65  |t. Thus the mode|
00000bf0  20 77 69 6c 6c 20 6e 65  65 64 20 61 20 70 69 65  | will need a pie|
00000c00  63 65 20 6f 66 20 63 6f  64 65 20 28 75 73 75 61  |ce of code (usua|
00000c10  6c 6c 79 20 63 61 6c 6c  65 64 20 63 6c 6e 5f 62  |lly called cln_b|
00000c20  61 63 6b 77 61 72 64 29  0a 66 6f 72 20 74 72 61  |ackward).for tra|
00000c30  63 69 6e 67 20 6c 69 6e  65 73 20 62 61 63 6b 77  |cing lines backw|
00000c40  61 72 64 73 20 75 70 20  74 68 65 20 66 69 6c 65  |ards up the file|
00000c50  2e 20 28 53 65 65 20 74  68 65 20 64 6f 63 73 20  |. (See the docs |
00000c60  6f 6e 20 74 68 65 73 65  20 65 6e 74 72 79 0a 70  |on these entry.p|
00000c70  6f 69 6e 74 73 29 2e 0a  0a 54 68 65 20 63 61 63  |oints)...The cac|
00000c80  68 65 20 69 74 73 65 6c  66 20 63 6f 6e 73 69 73  |he itself consis|
00000c90  74 73 20 6f 66 20 61 20  6e 75 6d 62 65 72 20 6f  |ts of a number o|
00000ca0  66 20 6c 69 6e 65 73 20  6f 66 20 77 69 64 74 68  |f lines of width|
00000cb0  20 77 5f 74 78 74 77 2e  20 54 68 69 73 20 77 69  | w_txtw. This wi|
00000cc0  64 74 68 20 69 73 0a 75  73 75 61 6c 6c 79 20 77  |dth is.usually w|
00000cd0  5f 77 69 64 74 68 20 72  6f 75 6e 64 65 64 20 75  |_width rounded u|
00000ce0  70 20 74 6f 20 74 68 65  20 6e 65 78 74 20 6d 75  |p to the next mu|
00000cf0  6c 74 69 70 6c 65 20 6f  66 20 38 2e 20 41 6e 20  |ltiple of 8. An |
00000d00  65 78 74 65 6e 73 69 6f  6e 20 6d 6f 64 65 20 6e  |extension mode n|
00000d10  65 65 64 0a 6e 6f 74 20  75 73 75 61 6c 6c 79 20  |eed.not usually |
00000d20  63 6f 6e 63 65 72 6e 20  69 74 73 65 6c 66 20 77  |concern itself w|
00000d30  69 74 68 20 74 68 69 73  20 63 61 63 68 65 20 75  |ith this cache u|
00000d40  6e 6c 65 73 73 20 69 74  20 69 73 20 64 72 61 77  |nless it is draw|
00000d50  69 6e 67 20 69 74 73 20  6f 77 6e 0a 64 69 73 70  |ing its own.disp|
00000d60  6c 61 79 2e 20 53 65 65  20 74 68 65 20 6d 6f 64  |lay. See the mod|
00000d70  65 20 65 6e 74 72 79 20  70 6f 69 6e 74 20 65 5f  |e entry point e_|
00000d80  72 65 64 72 61 77 6c 69  6e 65 20 69 6e 20 77 68  |redrawline in wh|
00000d90  69 63 68 20 79 6f 75 20  61 72 65 20 61 73 6b 65  |ich you are aske|
00000da0  64 20 74 6f 20 66 69 6c  6c 0a 61 20 6c 69 6e 65  |d to fill.a line|
00000db0  20 69 6e 20 74 68 65 20  63 61 63 68 65 2e 20 49  | in the cache. I|
00000dc0  20 72 65 73 65 72 76 65  20 74 68 65 20 72 69 67  | reserve the rig|
00000dd0  68 74 20 74 6f 20 63 68  61 6e 67 65 20 74 68 65  |ht to change the|
00000de0  20 66 6f 72 6d 61 74 20  6f 66 20 74 68 65 20 63  | format of the c|
00000df0  61 63 68 65 2c 0a 73 6f  20 64 6f 6e 27 74 20 61  |ache,.so don't a|
00000e00  63 63 65 73 73 20 69 74  20 64 69 72 65 63 74 6c  |ccess it directl|
00000e10  79 2e 0a 0a 54 68 65 20  77 69 6e 64 6f 77 20 62  |y...The window b|
00000e20  6c 6f 63 6b 20 6f 66 66  73 65 74 73 20 61 72 65  |lock offsets are|
00000e30  20 64 65 73 63 72 69 62  65 64 20 62 65 6c 6f 77  | described below|
00000e40  2e 20 55 73 65 20 45 2d  4c 69 62 72 61 72 79 20  |. Use E-Library |
00000e50  74 6f 20 73 65 74 20 75  70 20 74 68 65 0a 64 65  |to set up the.de|
00000e60  66 69 6e 69 74 69 6f 6e  73 2e 0a 0a 77 5f 68 61  |finitions...w_ha|
00000e70  6e 64 6c 65 0a 57 69 6e  64 6f 77 20 68 61 6e 64  |ndle.Window hand|
00000e80  6c 65 20 66 6f 72 20 74  68 69 73 20 77 69 6e 64  |le for this wind|
00000e90  6f 77 20 6f 72 20 2d 31  20 69 66 20 74 68 65 20  |ow or -1 if the |
00000ea0  77 69 6e 64 6f 77 20 68  61 73 20 62 65 65 6e 20  |window has been |
00000eb0  64 65 6c 65 74 65 64 20  61 6e 64 20 74 68 69 73  |deleted and this|
00000ec0  0a 62 6c 6f 63 6b 20 69  73 20 6e 6f 77 20 27 64  |.block is now 'd|
00000ed0  65 61 64 27 2e 20 44 65  61 64 20 62 6c 6f 63 6b  |ead'. Dead block|
00000ee0  73 20 73 68 6f 75 6c 64  20 62 65 20 73 6b 69 70  |s should be skip|
00000ef0  70 65 64 20 69 66 20 79  6f 75 20 61 72 65 20 67  |ped if you are g|
00000f00  6f 69 6e 67 20 74 68 72  6f 75 67 68 0a 74 68 65  |oing through.the|
00000f10  20 77 69 6e 64 6f 77 73  20 69 6e 20 73 65 71 75  | windows in sequ|
00000f20  65 6e 63 65 2e 0a 0a 77  5f 6d 69 6e 78 0a 77 5f  |ence...w_minx.w_|
00000f30  6d 69 6e 79 0a 77 5f 6d  61 78 78 0a 77 5f 6d 61  |miny.w_maxx.w_ma|
00000f40  78 79 0a 77 5f 73 63 72  6f 6c 6c 78 0a 77 5f 73  |xy.w_scrollx.w_s|
00000f50  63 72 6f 6c 6c 79 0a 77  5f 69 6e 66 72 6f 6e 74  |crolly.w_infront|
00000f60  0a 77 5f 77 69 6e 64 6f  77 66 6c 61 67 73 0a 54  |.w_windowflags.T|
00000f70  68 65 73 65 20 61 72 65  20 61 73 20 66 6f 72 20  |hese are as for |
00000f80  61 20 77 69 6d 70 20 77  69 6e 64 6f 77 20 62 6c  |a wimp window bl|
00000f90  6f 63 6b 2e 20 53 65 65  20 50 52 4d 20 69 66 20  |ock. See PRM if |
00000fa0  69 6e 20 64 6f 75 62 74  2e 20 59 6f 75 20 63 61  |in doubt. You ca|
00000fb0  6e 20 75 73 65 0a 74 68  65 20 63 6f 64 65 20 4d  |n use.the code M|
00000fc0  4f 56 20 52 31 2c 52 38  3a 53 59 53 20 22 58 4f  |OV R1,R8:SYS "XO|
00000fd0  53 5f 47 65 74 57 69 6e  64 6f 77 53 74 61 74 65  |S_GetWindowState|
00000fe0  22 20 74 6f 20 75 70 64  61 74 65 20 74 68 65 73  |" to update thes|
00000ff0  65 20 76 61 6c 75 65 73  2e 0a 0a 77 5f 66 69 6c  |e values...w_fil|
00001000  65 0a 47 69 76 65 73 20  74 68 65 20 66 69 6c 65  |e.Gives the file|
00001010  20 6f 66 66 73 65 74 20  6f 66 20 74 68 65 20 61  | offset of the a|
00001020  73 73 6f 63 69 61 74 65  64 20 66 69 6c 65 2e 20  |ssociated file. |
00001030  55 73 65 20 5a 61 70 5f  43 6f 6e 76 46 69 6c 65  |Use Zap_ConvFile|
00001040  4f 66 66 20 74 6f 20 63  6f 6e 76 65 72 74 0a 74  |Off to convert.t|
00001050  68 69 73 20 74 6f 20 61  20 66 69 6c 65 20 70 6f  |his to a file po|
00001060  69 6e 74 65 72 20 69 6e  20 52 39 2e 20 54 68 69  |inter in R9. Thi|
00001070  73 20 69 73 20 64 6f 6e  65 20 61 75 74 6f 6d 61  |s is done automa|
00001080  74 69 63 61 6c 6c 79 20  66 6f 72 20 79 6f 75 20  |tically for you |
00001090  62 79 0a 5a 61 70 5f 43  6f 6e 76 57 69 6e 64 4f  |by.Zap_ConvWindO|
000010a0  66 66 2e 0a 0a 77 5f 66  6f 72 6d 61 74 0a 47 69  |ff...w_format.Gi|
000010b0  76 65 73 20 74 68 65 20  64 69 73 70 6c 61 79 20  |ves the display |
000010c0  66 6f 72 6d 61 74 20 66  6c 61 67 73 20 61 6e 64  |format flags and|
000010d0  20 74 68 65 20 6d 6f 64  65 20 74 68 65 20 77 69  | the mode the wi|
000010e0  6e 64 6f 77 20 69 73 20  69 6e 2e 20 53 65 65 20  |ndow is in. See |
000010f0  45 2d 46 6c 61 67 73 20  66 6f 72 0a 64 65 74 61  |E-Flags for.deta|
00001100  69 6c 73 2e 0a 0a 77 5f  77 69 64 74 68 0a 57 69  |ils...w_width.Wi|
00001110  64 74 68 20 6f 66 20 77  69 6e 64 6f 77 20 69 6e  |dth of window in|
00001120  20 63 6f 6c 75 6d 6e 73  20 28 69 6e 63 6c 75 64  | columns (includ|
00001130  69 6e 67 20 74 68 65 20  6d 61 72 67 69 6e 29 2e  |ing the margin).|
00001140  0a 0a 77 5f 68 65 69 67  68 74 0a 48 65 69 67 68  |..w_height.Heigh|
00001150  74 20 6f 66 20 77 69 6e  64 6f 77 20 69 6e 20 6c  |t of window in l|
00001160  69 6e 65 73 2e 0a 0a 77  5f 74 78 74 0a 41 64 64  |ines...w_txt.Add|
00001170  72 65 73 73 20 6f 66 20  74 65 78 74 20 63 61 63  |ress of text cac|
00001180  68 65 2e 0a 0a 77 5f 74  78 74 68 0a 4e 75 6d 62  |he...w_txth.Numb|
00001190  65 72 20 6f 66 20 6c 69  6e 65 73 20 63 6c 61 69  |er of lines clai|
000011a0  6d 65 64 20 66 6f 72 20  74 78 74 20 63 61 63 68  |med for txt cach|
000011b0  65 2e 20 45 61 63 68 20  6c 69 6e 65 20 63 6f 6e  |e. Each line con|
000011c0  73 69 73 74 73 20 6f 66  20 77 5f 74 78 74 77 20  |sists of w_txtw |
000011d0  6e 75 6d 62 65 72 20 6f  66 0a 63 68 61 72 61 63  |number of.charac|
000011e0  74 65 72 73 20 66 6f 6c  6c 6f 77 65 64 20 62 79  |ters followed by|
000011f0  20 61 20 66 6f 72 65 67  72 6f 75 6e 64 20 6d 61  | a foreground ma|
00001200  73 6b 20 28 6f 66 20 6c  65 6e 67 74 68 20 77 5f  |sk (of length w_|
00001210  74 78 74 77 29 20 61 6e  64 20 74 68 65 6e 20 61  |txtw) and then a|
00001220  0a 62 61 63 6b 67 72 6f  75 6e 64 20 6d 61 73 6b  |.background mask|
00001230  20 28 6f 66 20 6c 65 6e  67 74 68 20 77 5f 74 78  | (of length w_tx|
00001240  74 77 29 2e 20 54 68 75  73 20 74 68 65 20 73 69  |tw). Thus the si|
00001250  7a 65 20 6f 66 20 74 68  65 20 63 61 63 68 65 20  |ze of the cache |
00001260  69 73 0a 77 5f 74 78 74  68 2a 77 5f 74 78 74 77  |is.w_txth*w_txtw|
00001270  2a 33 2e 20 77 5f 74 78  74 77 2a 33 2c 20 74 68  |*3. w_txtw*3, th|
00001280  65 20 27 61 63 74 75 61  6c 20 6c 65 6e 67 74 68  |e 'actual length|
00001290  27 20 6f 66 20 61 20 63  61 63 68 65 64 20 6c 69  |' of a cached li|
000012a0  6e 65 20 69 73 20 73 74  6f 72 65 64 20 69 6e 0a  |ne is stored in.|
000012b0  74 68 65 20 76 61 72 69  61 62 6c 65 20 77 5f 74  |the variable w_t|
000012c0  78 74 6c 65 6e 2e 20 53  65 65 20 65 5f 72 65 64  |xtlen. See e_red|
000012d0  72 61 77 20 6c 69 6e 65  20 66 6f 72 20 6d 6f 72  |raw line for mor|
000012e0  65 20 64 65 74 61 69 6c  73 2e 0a 0a 77 5f 74 78  |e details...w_tx|
000012f0  74 77 0a 57 69 64 74 68  20 6f 66 20 61 20 74 65  |tw.Width of a te|
00001300  78 74 20 63 61 63 68 65  20 6c 69 6e 65 20 69 6e  |xt cache line in|
00001310  20 63 68 61 72 61 63 74  65 72 73 2e 20 4d 75 73  | characters. Mus|
00001320  74 20 62 65 20 61 20 6d  75 6c 74 69 70 6c 65 20  |t be a multiple |
00001330  6f 66 20 38 2e 0a 0a 77  5f 74 78 74 6e 0a 4e 75  |of 8...w_txtn.Nu|
00001340  6d 62 65 72 20 6f 66 20  6c 69 6e 65 73 20 63 61  |mber of lines ca|
00001350  63 68 65 64 20 69 6e 20  74 68 65 20 74 78 74 20  |ched in the txt |
00001360  63 61 63 68 65 2e 0a 0a  77 5f 63 6f 66 66 0a 52  |cache...w_coff.R|
00001370  65 66 65 72 65 6e 63 65  20 70 6f 69 6e 74 20 67  |eference point g|
00001380  69 76 69 6e 67 20 74 68  65 20 66 69 6c 65 20 6f  |iving the file o|
00001390  66 66 73 65 74 20 6f 66  20 74 68 65 20 73 74 61  |ffset of the sta|
000013a0  72 74 20 6f 66 20 74 68  65 20 66 69 72 73 74 20  |rt of the first |
000013b0  63 61 63 68 65 64 0a 70  68 79 73 69 63 61 6c 20  |cached.physical |
000013c0  6c 69 6e 65 2e 0a 0a 77  5f 63 6c 69 6e 65 0a 52  |line...w_cline.R|
000013d0  65 66 65 72 65 6e 63 65  20 70 6f 69 6e 74 20 67  |eference point g|
000013e0  69 76 69 6e 67 20 74 68  65 20 70 68 79 73 69 63  |iving the physic|
000013f0  61 6c 20 6c 69 6e 65 20  6e 75 6d 62 65 72 20 28  |al line number (|
00001400  66 69 72 73 74 20 6c 69  6e 65 20 30 29 20 6f 66  |first line 0) of|
00001410  20 74 68 65 20 73 74 61  72 74 0a 6f 66 20 74 68  | the start.of th|
00001420  65 20 66 69 72 73 74 20  63 61 63 68 65 64 20 70  |e first cached p|
00001430  68 79 73 69 63 61 6c 20  6c 69 6e 65 2e 0a 0a 77  |hysical line...w|
00001440  5f 63 6c 6f 67 6c 0a 41  73 20 66 6f 72 20 77 5f  |_clogl.As for w_|
00001450  63 6c 69 6e 65 20 62 75  74 20 67 69 76 65 73 20  |cline but gives |
00001460  74 68 65 20 6c 6f 67 69  63 61 6c 20 6c 69 6e 65  |the logical line|
00001470  20 6e 75 6d 62 65 72 2e  0a 0a 77 5f 74 61 62 0a  | number...w_tab.|
00001480  47 69 76 65 73 20 74 68  65 20 63 6f 6c 74 61 62  |Gives the coltab|
00001490  20 77 69 64 74 68 2e 0a  0a 77 5f 74 61 62 63 0a  | width...w_tabc.|
000014a0  47 69 76 65 73 20 74 68  65 20 63 68 61 72 61 63  |Gives the charac|
000014b0  74 65 72 20 63 6f 64 65  20 74 61 62 20 6d 61 73  |ter code tab mas|
000014c0  6b 20 28 78 34 29 20 65  67 20 26 30 39 30 39 30  |k (x4) eg &09090|
000014d0  39 30 39 2e 20 53 65 74  20 74 68 69 73 20 74 6f  |909. Set this to|
000014e0  20 74 68 65 20 73 61 6d  65 20 61 73 0a 77 5f 63  | the same as.w_c|
000014f0  72 20 69 66 20 79 6f 75  20 77 61 6e 74 20 74 68  |r if you want th|
00001500  65 20 74 61 62 73 20 74  6f 20 62 65 20 69 6e 76  |e tabs to be inv|
00001510  69 73 69 62 6c 65 2e 0a  0a 77 5f 63 72 0a 47 69  |isible...w_cr.Gi|
00001520  76 65 73 20 74 68 65 20  6c 69 6e 65 20 74 65 72  |ves the line ter|
00001530  6d 69 6e 61 74 6f 72 20  6d 61 73 6b 20 28 78 34  |minator mask (x4|
00001540  29 20 65 67 20 26 30 41  30 41 30 41 30 41 2e 0a  |) eg &0A0A0A0A..|
00001550  0a 77 5f 66 6c 61 67 73  0a 47 69 76 65 73 20 74  |.w_flags.Gives t|
00001560  68 65 20 66 6c 61 67 73  20 73 74 61 74 75 73 20  |he flags status |
00001570  66 6f 72 20 74 68 69 73  20 77 69 6e 64 6f 77 2e  |for this window.|
00001580  20 53 65 65 20 45 2d 46  6c 61 67 73 2e 20 57 68  | See E-Flags. Wh|
00001590  65 6e 20 61 20 77 69 6e  64 6f 77 20 69 73 20 63  |en a window is c|
000015a0  72 65 61 74 65 64 0a 74  68 65 20 64 65 66 61 75  |reated.the defau|
000015b0  6c 74 20 76 61 6c 75 65  20 69 73 20 74 61 6b 65  |lt value is take|
000015c0  6e 20 66 72 6f 6d 20 6f  70 74 5f 66 6c 61 67 73  |n from opt_flags|
000015d0  2e 0a 0a 77 5f 74 69 74  6c 65 0a 50 6f 69 6e 74  |...w_title.Point|
000015e0  73 20 74 6f 20 74 68 65  20 77 69 6e 64 6f 77 20  |s to the window |
000015f0  74 69 74 6c 65 20 73 74  72 69 6e 67 2e 0a 0a 77  |title string...w|
00001600  5f 62 70 6c 0a 4d 6f 64  65 20 64 65 70 65 6e 64  |_bpl.Mode depend|
00001610  65 6e 74 20 77 6f 72 64  2e 20 55 73 75 61 6c 6c  |ent word. Usuall|
00001620  79 20 73 74 6f 72 65 73  20 74 68 65 20 77 69 64  |y stores the wid|
00001630  74 68 20 6f 66 20 74 68  65 20 64 69 73 70 6c 61  |th of the displa|
00001640  79 20 69 6e 20 63 68 61  72 61 63 74 65 72 73 2e  |y in characters.|
00001650  0a 42 79 74 65 20 6d 6f  64 65 20 73 74 6f 72 65  |.Byte mode store|
00001660  73 20 74 68 65 20 6e 75  6d 62 65 72 20 6f 66 20  |s the number of |
00001670  62 79 74 65 73 20 73 68  6f 77 6e 20 6f 6e 20 65  |bytes shown on e|
00001680  61 63 68 20 6c 69 6e 65  20 65 74 63 2e 0a 0a 77  |ach line etc...w|
00001690  5f 6d 61 72 67 69 6e 0a  57 69 64 74 68 20 6f 66  |_margin.Width of|
000016a0  20 74 68 65 20 6c 65 66  74 20 68 61 6e 64 20 6d  | the left hand m|
000016b0  61 72 67 69 6e 20 69 6e  20 63 68 61 72 61 63 74  |argin in charact|
000016c0  65 72 73 20 28 69 6e 63  6c 75 64 69 6e 67 20 61  |ers (including a|
000016d0  6e 79 20 6c 69 6e 65 20  6e 75 6d 62 65 72 73 20  |ny line numbers |
000016e0  2d 20 73 6f 0a 74 68 69  73 20 6d 61 79 20 62 65  |- so.this may be|
000016f0  20 6e 6f 6e 20 7a 65 72  6f 20 65 76 65 6e 20 69  | non zero even i|
00001700  66 20 74 68 65 20 75 73  65 72 20 68 61 73 20 6e  |f the user has n|
00001710  6f 74 20 73 65 74 20 61  20 6d 61 72 67 69 6e 29  |ot set a margin)|
00001720  2e 0a 0a 77 5f 72 6c 0a  48 65 69 67 68 74 20 69  |...w_rl.Height i|
00001730  6e 20 70 69 78 65 6c 73  20 6f 66 20 65 61 63 68  |n pixels of each|
00001740  20 63 68 61 72 61 63 74  65 72 20 69 6e 63 6c 75  | character inclu|
00001750  64 69 6e 67 20 74 68 65  20 6c 69 6e 65 20 73 70  |ding the line sp|
00001760  61 63 69 6e 67 2e 0a 0a  77 5f 72 77 0a 57 69 64  |acing...w_rw.Wid|
00001770  74 68 20 69 6e 20 70 69  78 65 6c 73 20 6f 66 20  |th in pixels of |
00001780  65 61 63 68 20 63 68 61  72 61 63 74 65 72 2e 0a  |each character..|
00001790  0a 77 5f 72 68 0a 48 65  69 67 68 74 20 69 6e 20  |.w_rh.Height in |
000017a0  70 69 78 65 6c 73 20 6f  66 20 65 61 63 68 20 63  |pixels of each c|
000017b0  68 61 72 61 63 74 65 72  20 65 78 63 6c 75 64 69  |haracter excludi|
000017c0  6e 67 20 6c 69 6e 65 20  73 70 61 63 69 6e 67 2e  |ng line spacing.|
000017d0  0a 0a 77 5f 61 64 64 72  0a 41 64 64 72 65 73 73  |..w_addr.Address|
000017e0  20 74 6f 20 73 68 6f 77  20 69 6e 20 6d 61 72 67  | to show in marg|
000017f0  69 6e 20 66 6f 72 20 66  69 6c 65 20 6f 66 66 73  |in for file offs|
00001800  65 74 20 30 2e 0a 0a 77  5f 73 74 6c 69 6e 65 0a  |et 0...w_stline.|
00001810  4c 69 6e 65 20 6e 75 6d  62 65 72 20 74 6f 20 73  |Line number to s|
00001820  68 6f 77 20 69 6e 20 6d  61 72 67 69 6e 20 66 6f  |how in margin fo|
00001830  72 20 6c 69 6e 65 20 6f  66 66 73 65 74 20 30 2e  |r line offset 0.|
00001840  0a 0a 77 5f 74 69 74 6c  65 6c 65 6e 0a 77 5f 74  |..w_titlelen.w_t|
00001850  69 74 62 75 66 0a 77 5f  74 69 74 6c 65 6e 0a 55  |itbuf.w_titlen.U|
00001860  73 65 64 20 69 6e 74 65  72 6e 61 6c 6c 79 20 66  |sed internally f|
00001870  6f 72 20 74 69 74 6c 65  20 75 70 64 61 74 65 2e  |or title update.|
00001880  0a 0a 77 5f 6d 77 69 64  74 68 0a 55 73 65 72 20  |..w_mwidth.User |
00001890  72 65 71 75 69 72 65 64  20 6d 61 72 67 69 6e 20  |required margin |
000018a0  77 69 64 74 68 20 62 65  66 6f 72 65 20 73 70 61  |width before spa|
000018b0  63 65 20 66 6f 72 20 6c  69 6e 65 20 6e 75 6d 62  |ce for line numb|
000018c0  65 72 73 20 61 64 64 65  64 2e 0a 0a 77 5f 74 61  |ers added...w_ta|
000018d0  62 63 68 61 72 0a 55 73  65 72 20 72 65 71 75 69  |bchar.User requi|
000018e0  72 65 64 20 74 61 62 20  63 68 61 72 61 63 74 65  |red tab characte|
000018f0  72 20 63 6f 64 65 20 78  34 20 28 65 67 20 26 30  |r code x4 (eg &0|
00001900  39 30 39 30 39 30 39 29  20 62 65 66 6f 72 65 20  |9090909) before |
00001910  74 61 62 20 76 69 73 69  62 69 6c 69 74 79 0a 74  |tab visibility.t|
00001920  61 6b 65 6e 20 69 6e 74  6f 20 61 63 63 6f 75 6e  |aken into accoun|
00001930  74 2e 20 77 5f 74 61 62  63 20 63 6f 6e 74 61 69  |t. w_tabc contai|
00001940  6e 73 20 74 68 65 20 6f  6e 65 20 61 63 74 75 61  |ns the one actua|
00001950  6c 6c 79 20 62 65 69 6e  67 20 75 73 65 64 2e 0a  |lly being used..|
00001960  0a 77 5f 6c 69 6e 65 73  70 0a 55 73 65 72 20 72  |.w_linesp.User r|
00001970  65 71 75 69 72 65 64 20  6c 69 6e 65 20 73 70 61  |equired line spa|
00001980  63 69 6e 67 20 69 6e 20  31 2f 38 74 68 73 20 63  |cing in 1/8ths c|
00001990  68 61 72 2e 0a 0a 77 5f  73 61 76 65 64 6f 0a 55  |har...w_savedo.U|
000019a0  73 65 64 20 69 6e 74 65  72 6e 61 6c 6c 79 20 62  |sed internally b|
000019b0  79 20 5a 61 70 5f 44 6f  43 6f 6d 6d 61 6e 64 20  |y Zap_DoCommand |
000019c0  74 6f 20 73 74 6f 72 65  20 74 68 65 20 6f 66 66  |to store the off|
000019d0  73 65 74 20 6f 66 20 74  68 65 20 66 69 72 73 74  |set of the first|
000019e0  20 73 68 69 66 74 61 62  6c 65 0a 6c 69 6e 65 20  | shiftable.line |
000019f0  61 66 74 65 72 20 61 20  63 6f 6d 6d 61 6e 64 2c  |after a command,|
00001a00  20 61 6e 64 20 62 79 20  5a 61 70 5f 53 61 76 65  | and by Zap_Save|
00001a10  57 69 6e 53 74 61 74 75  73 20 74 6f 20 73 74 6f  |WinStatus to sto|
00001a20  72 65 20 74 68 65 20 66  69 6c 65 20 6f 66 66 73  |re the file offs|
00001a30  65 74 20 6f 66 0a 74 68  65 20 63 68 61 72 61 63  |et of.the charac|
00001a40  74 65 72 20 77 68 6f 73  65 20 70 6f 73 69 74 69  |ter whose positi|
00001a50  6f 6e 20 73 68 6f 75 6c  64 20 72 65 6d 61 69 6e  |on should remain|
00001a60  20 66 69 78 65 64 20 77  68 65 6e 20 74 68 65 20  | fixed when the |
00001a70  77 69 6e 64 6f 77 20 69  73 0a 72 65 63 72 65 61  |window is.recrea|
00001a80  74 65 64 2e 0a 0a 77 5f  73 61 76 65 64 6c 0a 55  |ted...w_savedl.U|
00001a90  73 65 64 20 69 6e 74 65  72 6e 61 6c 6c 79 20 62  |sed internally b|
00001aa0  79 20 5a 61 70 5f 44 6f  43 6f 6d 6d 61 6e 64 20  |y Zap_DoCommand |
00001ab0  74 6f 20 73 74 6f 72 65  20 74 68 65 20 70 68 79  |to store the phy|
00001ac0  73 69 63 61 6c 20 6c 69  6e 65 20 6e 75 6d 62 65  |sical line numbe|
00001ad0  72 20 6f 66 20 74 68 65  0a 66 69 72 73 74 20 73  |r of the.first s|
00001ae0  68 69 66 74 61 62 6c 65  20 6c 69 6e 65 20 61 66  |hiftable line af|
00001af0  74 65 72 20 61 20 63 6f  6d 6d 61 6e 64 2c 20 61  |ter a command, a|
00001b00  6e 64 20 62 79 20 5a 61  70 5f 53 61 76 65 57 69  |nd by Zap_SaveWi|
00001b10  6e 53 74 61 74 75 73 20  74 6f 20 73 74 6f 72 65  |nStatus to store|
00001b20  20 74 68 65 20 79 0a 6f  66 66 73 65 74 20 66 72  | the y.offset fr|
00001b30  6f 6d 20 74 68 65 20 74  6f 70 20 6f 66 20 74 68  |om the top of th|
00001b40  65 20 77 69 6e 64 6f 77  20 69 6e 20 70 69 78 65  |e window in pixe|
00001b50  6c 73 20 6f 66 20 74 68  65 20 63 68 61 72 61 63  |ls of the charac|
00001b60  74 65 72 20 77 68 6f 73  65 20 70 6f 73 69 74 69  |ter whose positi|
00001b70  6f 6e 0a 73 68 6f 75 6c  64 20 72 65 6d 61 69 6e  |on.should remain|
00001b80  20 66 69 78 65 64 20 77  68 65 6e 20 74 68 65 20  | fixed when the |
00001b90  77 69 6e 64 6f 77 20 69  73 20 72 65 63 72 65 61  |window is recrea|
00001ba0  74 65 64 2e 0a 0a 77 5f  73 61 76 65 64 63 0a 55  |ted...w_savedc.U|
00001bb0  73 65 64 20 69 6e 74 65  72 6e 61 6c 6c 79 20 62  |sed internally b|
00001bc0  79 20 5a 61 70 5f 44 6f  43 6f 6d 6d 61 6e 64 20  |y Zap_DoCommand |
00001bd0  74 6f 20 73 74 6f 72 65  20 74 68 65 20 6e 75 6d  |to store the num|
00001be0  62 65 72 20 6f 66 20 70  68 79 73 69 63 61 6c 20  |ber of physical |
00001bf0  6c 69 6e 65 73 20 74 65  78 74 0a 61 66 74 65 72  |lines text.after|
00001c00  20 74 68 65 20 66 69 72  73 74 20 73 68 69 66 74  | the first shift|
00001c10  61 62 6c 65 20 6c 69 6e  65 20 73 68 6f 75 6c 64  |able line should|
00001c20  20 62 65 20 73 68 69 66  74 65 64 20 64 6f 77 6e  | be shifted down|
00001c30  20 61 66 74 65 72 20 61  20 63 6f 6d 6d 61 6e 64  | after a command|
00001c40  0a 28 73 69 67 6e 65 64  29 2e 0a 0a 77 5f 73 61  |.(signed)...w_sa|
00001c50  76 65 64 68 0a 55 73 65  64 20 69 6e 74 65 72 6e  |vedh.Used intern|
00001c60  61 6c 6c 79 20 62 79 20  5a 61 70 5f 44 6f 43 6f  |ally by Zap_DoCo|
00001c70  6d 6d 61 6e 64 20 74 6f  20 73 61 76 65 20 74 68  |mmand to save th|
00001c80  65 20 77 69 6e 64 6f 77  20 68 65 69 67 68 74 20  |e window height |
00001c90  62 65 66 6f 72 65 20 61  20 73 65 71 75 65 6e 63  |before a sequenc|
00001ca0  65 0a 6f 66 20 63 6f 6d  6d 61 6e 64 73 20 77 61  |e.of commands wa|
00001cb0  73 20 70 65 72 66 6f 72  6d 65 64 2e 0a 0a 77 5f  |s performed...w_|
00001cc0  73 61 76 65 64 6c 63 0a  55 73 65 64 20 69 6e 74  |savedlc.Used int|
00001cd0  65 72 6e 61 6c 6c 79 20  62 79 20 5a 61 70 5f 44  |ernally by Zap_D|
00001ce0  6f 43 6f 6d 6d 61 6e 64  20 61 6e 64 20 5a 61 70  |oCommand and Zap|
00001cf0  5f 53 61 76 65 57 69 6e  53 74 61 74 75 73 0a 0a  |_SaveWinStatus..|
00001d00  77 5f 77 72 61 70 77 69  64 74 68 0a 57 6f 72 64  |w_wrapwidth.Word|
00001d10  77 72 61 70 20 77 69 64  74 68 2e 0a 0a 77 5f 74  |wrap width...w_t|
00001d20  6f 67 6d 69 6e 78 0a 77  5f 74 6f 67 6d 69 6e 79  |ogminx.w_togminy|
00001d30  0a 77 5f 74 6f 67 6d 61  78 78 0a 77 5f 74 6f 67  |.w_togmaxx.w_tog|
00001d40  6d 61 78 79 0a 54 68 65  73 65 20 73 61 76 65 20  |maxy.These save |
00001d50  74 68 65 20 27 73 6d 61  6c 6c 27 20 77 69 6e 64  |the 'small' wind|
00001d60  6f 77 20 70 6f 73 69 74  69 6f 6e 20 66 6f 72 20  |ow position for |
00001d70  74 68 65 20 74 6f 67 67  6c 65 20 73 69 7a 65 20  |the toggle size |
00001d80  6b 65 79 20 28 73 63 47  29 2e 0a 0a 77 5f 74 78  |key (scG)...w_tx|
00001d90  74 6c 65 6e 0a 41 63 74  75 61 6c 20 6c 65 6e 67  |tlen.Actual leng|
00001da0  74 68 20 6f 66 20 61 20  63 61 63 68 65 20 6c 69  |th of a cache li|
00001db0  6e 65 20 69 6e 63 6c 75  64 69 6e 67 20 74 68 65  |ne including the|
00001dc0  20 66 6f 72 65 67 72 6f  75 6e 64 20 61 6e 64 20  | foreground and |
00001dd0  62 61 63 6b 67 72 6f 75  6e 64 20 6d 61 73 6b 73  |background masks|
00001de0  2e 0a 0a 77 5f 70 61 6c  65 74 74 65 0a 50 6f 69  |...w_palette.Poi|
00001df0  6e 74 65 72 20 74 6f 20  63 75 72 72 65 6e 74 20  |nter to current |
00001e00  72 65 64 72 61 77 20 70  61 6c 65 74 74 65 2e 20  |redraw palette. |
00001e10  54 68 69 73 20 63 6f 6e  73 69 73 74 73 20 6f 66  |This consists of|
00001e20  20 33 32 20 77 6f 72 64  73 2e 20 54 68 65 20 66  | 32 words. The f|
00001e30  69 72 73 74 20 31 36 0a  67 69 76 65 20 74 68 65  |irst 16.give the|
00001e40  20 32 34 20 62 69 74 20  63 6f 6c 6f 75 72 20 74  | 24 bit colour t|
00001e50  72 61 6e 73 6c 61 74 69  6f 6e 73 20 28 26 42 42  |ranslations (&BB|
00001e60  47 47 52 52 78 78 29 20  66 6f 72 20 5a 61 70 20  |GGRRxx) for Zap |
00001e70  63 6f 6c 6f 75 72 73 20  30 2d 31 35 0a 28 30 2f  |colours 0-15.(0/|
00001e80  31 3d 62 61 63 6b 67 72  6f 75 6e 64 20 32 3d 66  |1=background 2=f|
00001e90  6f 72 65 67 72 6f 75 6e  64 20 65 74 63 29 20 61  |oreground etc) a|
00001ea0  6e 64 20 69 73 20 75 73  65 64 20 62 79 20 56 44  |nd is used by VD|
00001eb0  55 20 6d 6f 64 65 20 72  65 64 72 61 77 73 2e 20  |U mode redraws. |
00001ec0  54 68 65 20 31 36 0a 77  6f 72 64 73 20 61 66 74  |The 16.words aft|
00001ed0  65 72 20 74 68 61 74 20  67 69 76 65 20 74 68 65  |er that give the|
00001ee0  20 63 6f 72 72 65 73 70  6f 6e 64 69 6e 67 20 62  | corresponding b|
00001ef0  69 74 6d 61 70 20 6d 61  73 6b 73 20 66 6f 72 20  |itmap masks for |
00001f00  70 6f 6b 69 6e 67 20 69  6e 74 6f 20 74 68 65 0a  |poking into the.|
00001f10  73 63 72 65 65 6e 20 64  75 72 69 6e 67 20 61 20  |screen during a |
00001f20  66 61 73 74 20 72 65 64  72 61 77 2e 0a 0a 77 5f  |fast redraw...w_|
00001f30  70 77 69 6e 64 0a 77 5f  70 6c 69 6e 65 0a 77 5f  |pwind.w_pline.w_|
00001f40  70 63 6f 6c 0a 77 5f 70  6f 66 66 0a 77 5f 70 6c  |pcol.w_poff.w_pl|
00001f50  6f 66 66 0a 77 5f 70 77  69 64 74 68 0a 54 68 69  |off.w_pwidth.Thi|
00001f60  73 20 69 73 20 74 68 65  20 27 63 75 72 73 6f 72  |s is the 'cursor|
00001f70  20 62 6c 6f 63 6b 27 20  6f 66 20 74 68 65 20 27  | block' of the '|
00001f80  70 6f 69 6e 74 27 20 70  6f 73 69 74 69 6f 6e 2e  |point' position.|
00001f90  20 54 68 69 73 20 69 73  20 74 68 65 20 66 69 6c  | This is the fil|
00001fa0  65 20 6f 66 66 73 65 74  0a 6f 66 20 74 68 65 20  |e offset.of the |
00001fb0  63 75 72 72 65 6e 74 20  27 69 6e 70 75 74 27 20  |current 'input' |
00001fc0  70 6f 73 69 74 69 6f 6e  20 69 6e 20 74 68 65 20  |position in the |
00001fd0  66 69 6c 65 20 77 68 65  6e 20 74 68 65 20 66 69  |file when the fi|
00001fe0  6c 65 20 64 6f 65 73 20  6e 6f 74 20 63 6f 6e 74  |le does not cont|
00001ff0  61 69 6e 0a 74 68 65 20  63 75 72 73 6f 72 2e 20  |ain.the cursor. |
00002000  49 74 20 69 73 20 75 70  64 61 74 65 64 20 77 68  |It is updated wh|
00002010  65 6e 20 74 68 65 20 63  75 72 73 6f 72 20 6d 6f  |en the cursor mo|
00002020  76 65 73 20 66 72 6f 6d  20 6f 6e 65 20 66 69 6c  |ves from one fil|
00002030  65 20 74 6f 20 61 6e 6f  74 68 65 72 2e 0a 54 68  |e to another..Th|
00002040  69 73 20 70 6f 73 69 74  69 6f 6e 20 69 73 20 75  |is position is u|
00002050  73 75 61 6c 6c 79 20 6d  61 72 6b 65 64 20 77 69  |sually marked wi|
00002060  74 68 20 61 6e 20 65 6d  70 74 79 20 73 71 75 61  |th an empty squa|
00002070  72 65 20 63 75 72 73 6f  72 2e 20 53 65 65 20 74  |re cursor. See t|
00002080  68 65 20 66 69 6c 65 0a  45 2d 43 75 72 73 6f 72  |he file.E-Cursor|
00002090  73 20 66 6f 72 20 77 68  61 74 20 74 68 65 20 76  |s for what the v|
000020a0  61 72 69 61 62 6c 65 73  20 73 74 6f 72 65 20 2d  |ariables store -|
000020b0  20 77 5f 70 6f 66 66 20  69 73 20 74 68 65 20 6d  | w_poff is the m|
000020c0  6f 73 74 20 75 73 65 66  75 6c 20 67 69 76 69 6e  |ost useful givin|
000020d0  67 20 74 68 65 0a 66 69  6c 65 20 6f 66 66 73 65  |g the.file offse|
000020e0  74 20 6f 66 20 74 68 65  20 27 70 6f 69 6e 74 27  |t of the 'point'|
000020f0  2e 20 77 5f 70 77 69 6e  64 20 69 73 20 73 65 74  |. w_pwind is set|
00002100  20 75 70 20 61 73 20 74  68 65 20 77 69 6e 64 6f  | up as the windo|
00002110  77 20 6f 66 66 73 65 74  20 6f 66 20 74 68 69 73  |w offset of this|
00002120  0a 63 75 72 72 65 6e 74  20 77 69 6e 64 6f 77 2e  |.current window.|
00002130  20 54 68 69 73 20 69 6e  20 69 74 73 20 73 65 6c  | This in its sel|
00002140  66 20 69 73 20 6e 6f 74  20 75 73 65 66 75 6c 20  |f is not useful |
00002150  62 75 74 20 65 6e 61 62  6c 65 73 20 79 6f 75 20  |but enables you |
00002160  74 6f 20 63 61 6c 6c 0a  63 75 72 73 6f 72 20 68  |to call.cursor h|
00002170  61 6e 64 6c 69 6e 67 20  72 6f 75 74 69 6e 65 73  |andling routines|
00002180  20 77 69 74 68 20 52 31  30 3d 52 38 2b 77 5f 70  | with R10=R8+w_p|
00002190  77 69 6e 64 20 28 70 72  6f 76 69 64 65 64 20 74  |wind (provided t|
000021a0  68 65 20 72 6f 75 74 69  6e 65 20 64 6f 65 73 6e  |he routine doesn|
000021b0  27 74 0a 75 73 65 20 61  6e 79 20 6f 66 20 74 68  |'t.use any of th|
000021c0  65 20 27 6f 6c 64 27 20  6f 66 66 73 65 74 73 29  |e 'old' offsets)|
000021d0  2e 0a 0a 77 5f 73 61 76  65 64 73 0a 55 73 65 64  |...w_saveds.Used|
000021e0  20 69 6e 74 65 72 6e 61  6c 6c 79 20 62 79 20 5a  | internally by Z|
000021f0  61 70 5f 44 6f 43 6f 6d  6d 61 6e 64 2e 20 53 61  |ap_DoCommand. Sa|
00002200  76 65 73 20 74 68 65 20  66 69 72 73 74 20 66 69  |ves the first fi|
00002210  6c 65 20 6f 66 66 73 65  74 20 74 6f 20 62 65 20  |le offset to be |
00002220  75 70 64 61 74 65 64 0a  6f 6e 20 73 63 72 65 65  |updated.on scree|
00002230  6e 20 61 66 74 65 72 20  74 68 65 20 63 6f 6d 6d  |n after the comm|
00002240  61 6e 64 20 68 61 73 20  66 69 6e 69 73 68 65 64  |and has finished|
00002250  2e 0a 0a 77 5f 6d 6f 64  65 64 61 74 61 0a 54 68  |...w_modedata.Th|
00002260  69 73 20 70 6f 69 6e 74  73 20 74 6f 20 61 20 62  |is points to a b|
00002270  6c 6f 63 6b 20 77 68 69  63 68 20 73 74 6f 72 65  |lock which store|
00002280  73 20 74 68 65 20 6d 6f  64 65 20 64 65 70 65 6e  |s the mode depen|
00002290  64 61 6e 74 20 64 61 74  61 20 68 61 6e 64 6c 65  |dant data handle|
000022a0  64 20 62 79 20 5a 61 70  2e 0a 54 68 65 20 62 6c  |d by Zap..The bl|
000022b0  6f 63 6b 20 63 6f 6e 73  69 73 74 73 20 6f 66 20  |ock consists of |
000022c0  62 6c 6f 63 6b 73 20 6f  66 20 74 68 65 20 73 61  |blocks of the sa|
000022d0  6d 65 20 66 6f 72 6d 61  74 20 61 73 20 69 6e 20  |me format as in |
000022e0  74 68 65 20 5a 61 70 20  64 65 70 65 6e 64 61 6e  |the Zap dependan|
000022f0  74 20 62 69 74 0a 6f 66  20 74 68 65 20 21 43 6f  |t bit.of the !Co|
00002300  6e 66 69 67 20 66 69 6c  65 20 2d 20 73 65 65 20  |nfig file - see |
00002310  45 2d 56 61 72 73 2c 20  61 6e 64 20 69 73 20 6c  |E-Vars, and is l|
00002320  69 61 62 6c 65 20 74 6f  20 63 68 61 6e 67 65 20  |iable to change |
00002330  77 69 74 68 20 64 69 66  66 65 72 65 6e 74 0a 76  |with different.v|
00002340  65 72 73 69 6f 6e 73 2e  20 55 73 65 20 5a 61 70  |ersions. Use Zap|
00002350  20 63 61 6c 6c 73 20 28  65 67 20 5a 61 70 5f 4d  | calls (eg Zap_M|
00002360  6f 64 65 43 6f 6c 6f 75  72 29 20 74 6f 20 72 65  |odeColour) to re|
00002370  61 64 2f 77 72 69 74 65  20 74 68 65 20 63 6f 6e  |ad/write the con|
00002380  74 65 6e 74 73 20 6f 66  0a 74 68 69 73 20 62 6c  |tents of.this bl|
00002390  6f 63 6b 2e 0a 0a 77 5f  72 65 73 31 30 2d 77 5f  |ock...w_res10-w_|
000023a0  72 65 73 31 36 0a 52 65  73 65 72 76 65 64 20 77  |res16.Reserved w|
000023b0  6f 72 64 73 0a 0a 77 5f  6d 6f 64 65 30 2d 77 5f  |ords..w_mode0-w_|
000023c0  6d 6f 64 65 31 35 0a 4d  6f 64 65 20 77 6f 72 64  |mode15.Mode word|
000023d0  73 2e 20 45 61 63 68 20  6d 6f 64 65 20 68 61 73  |s. Each mode has|
000023e0  20 6f 6e 65 20 77 6f 72  64 20 69 6e 20 65 61 63  | one word in eac|
000023f0  68 20 69 6e 20 77 69 6e  64 6f 77 20 69 6e 20 77  |h in window in w|
00002400  68 69 63 68 20 74 6f 20  73 74 6f 72 65 20 74 68  |hich to store th|
00002410  65 0a 6f 70 74 69 6f 6e  73 20 70 65 72 74 61 69  |e.options pertai|
00002420  6e 69 6e 67 20 74 6f 20  74 68 61 74 20 6d 6f 64  |ning to that mod|
00002430  65 2e 20 49 66 20 62 69  74 20 31 30 20 6f 66 20  |e. If bit 10 of |
00002440  74 68 65 20 66 6c 61 67  73 20 69 6e 20 74 68 65  |the flags in the|
00002450  20 6d 6f 64 65 73 20 65  5f 6d 6f 64 65 0a 65 6e  | modes e_mode.en|
00002460  74 72 79 20 70 6f 69 6e  74 20 69 73 20 53 45 54  |try point is SET|
00002470  20 74 68 65 6e 20 69 6e  73 74 65 61 64 20 6f 66  | then instead of|
00002480  20 73 74 6f 72 69 6e 67  20 64 61 74 61 2c 20 74  | storing data, t|
00002490  68 65 20 6d 6f 64 65 20  77 6f 72 64 20 68 6f 6c  |he mode word hol|
000024a0  64 73 0a 61 20 70 6f 69  6e 74 65 72 20 74 6f 20  |ds.a pointer to |
000024b0  61 20 62 6c 6f 63 6b 20  6f 66 20 64 61 74 61 20  |a block of data |
000024c0  69 6e 20 5a 61 70 27 73  20 68 65 61 70 20 28 6f  |in Zap's heap (o|
000024d0  72 20 30 20 69 66 20 74  68 65 20 62 6c 6f 63 6b  |r 0 if the block|
000024e0  20 68 61 73 20 6e 6f 74  20 62 65 65 6e 0a 63 72  | has not been.cr|
000024f0  65 61 74 65 64 29 2e 20  49 6e 20 74 68 69 73 20  |eated). In this |
00002500  63 61 73 65 2c 20 74 68  65 20 66 69 72 73 74 20  |case, the first |
00002510  77 6f 72 64 20 6f 66 20  74 68 65 20 62 6c 6f 63  |word of the bloc|
00002520  6b 20 4d 55 53 54 20 63  6f 6e 74 61 69 6e 20 74  |k MUST contain t|
00002530  68 65 20 6c 65 6e 67 74  68 0a 6f 66 20 74 68 65  |he length.of the|
00002540  20 62 6c 6f 63 6b 20 28  69 6e 63 6c 75 64 69 6e  | block (includin|
00002550  67 20 74 68 65 20 66 69  72 73 74 20 77 6f 72 64  |g the first word|
00002560  29 2e 20 54 68 65 20 62  6c 6f 63 6b 20 77 69 6c  |). The block wil|
00002570  6c 20 62 65 20 63 6f 70  69 65 64 0a 61 75 74 6f  |l be copied.auto|
00002580  6d 61 74 69 63 61 6c 6c  79 20 62 79 20 5a 61 70  |matically by Zap|
00002590  2c 20 66 6f 72 20 65 78  61 6d 70 6c 65 2c 20 6f  |, for example, o|
000025a0  6e 20 61 20 4e 65 77 20  56 69 65 77 2e 20 54 68  |n a New View. Th|
000025b0  65 20 62 6c 6f 63 6b 20  77 69 6c 6c 20 62 65 20  |e block will be |
000025c0  66 72 65 65 64 0a 61 75  74 6f 6d 61 74 69 63 61  |freed.automatica|
000025d0  6c 6c 79 20 77 68 65 6e  20 74 68 65 20 77 69 6e  |lly when the win|
000025e0  64 6f 77 20 69 73 20 63  6c 6f 73 65 64 2e 20 54  |dow is closed. T|
000025f0  68 65 20 62 6c 6f 63 6b  20 69 73 20 63 72 65 61  |he block is crea|
00002600  74 65 64 20 61 75 74 6f  6d 61 74 69 63 61 6c 6c  |ted automaticall|
00002610  79 0a 77 68 65 6e 20 61  20 77 69 6e 64 6f 77 20  |y.when a window |
00002620  69 73 20 6f 70 65 6e 65  64 2c 20 61 6e 64 20 66  |is opened, and f|
00002630  69 6c 6c 65 64 20 77 69  74 68 20 74 68 65 20 63  |illed with the c|
00002640  6f 6e 74 65 6e 74 73 20  6f 66 20 74 68 65 20 64  |ontents of the d|
00002650  65 66 61 75 6c 74 20 62  6c 6f 63 6b 0a 73 74 6f  |efault block.sto|
00002660  72 65 64 20 69 6e 20 74  68 65 20 21 43 6f 6e 66  |red in the !Conf|
00002670  69 67 20 66 69 6c 65 20  61 6e 64 20 61 63 63 65  |ig file and acce|
00002680  73 73 65 64 20 76 69 61  20 5a 61 70 5f 52 65 61  |ssed via Zap_Rea|
00002690  64 2f 57 72 69 74 65 20  56 61 72 20 2d 20 73 65  |d/Write Var - se|
000026a0  65 20 45 2d 56 61 72 73  2e 0a                    |e E-Vars..|
000026aa