
WidthTable	RECORD -4
fontID	ds.l  1
charWidth	ds.b  256
height	ds.w  1
ascent	ds.w  1
RecordSize
	ENDR



SuperHandle	RECORD 0
cachedHandle	ds.l  1	;handle to the block to start looking in
cachedTextOffset	ds.l  1	;the text offset for the cached item
cachedIndex	ds.w  1	;index into this block that points to the cached item
itemsPerBlock	ds.w  1	;number of items in each linked block
RecordSize
	ENDR



SuperBlock	RECORD 0
nextHandle	ds.l  1	;handle to the next block in the list
prevHandle	ds.l  1	;handle to the prev block in the list
textLength	ds.l  1	;number of characters represented by this block
reserved	ds.l  1
firstItem
RecordSize
	ENDR



TextList	RECORD 0
cachedHandle	ds.l  1	;handle to the block to start looking in
cachedTextOffset	ds.l  1	;the text offset for the cached block
RecordSize
	ENDR



TextBlock	RECORD 0
nextHandle	ds.l  1	;handle to the next block in the list
prevHandle	ds.l  1	;handle to the prev block in the list
textLength	ds.l  1	;number of characters represented by this block
flags	ds.w  1	;flag word indicating whether the block is in memory or not
reserved	ds.w  1
textStart
RecordSize
	ENDR


;---------------------------------------------------------------


TEColorTable	RECORD 0
content	ds.w  1
outline	ds.w  1
hilight	ds.w  1
caret	ds.w  1
vertBarVerb	ds.w  1		;this is in the same format as more flags
vertBarRef	ds.l  1
horzBarVerb	ds.w  1		;this is in the same format as more flags
horzBarRef	ds.l  1
growVerb	ds.w  1		;this is in the same format as more flags
growRef	ds.l  1
RecordSize
	ENDR



TEInfoRecord	RECORD 0
charCount	ds.l  1	;the number of characters in the record.
lineCount	ds.l  1	;the number of lines in the record
formatMemory	ds.l  1	;the amount of memory needed to contain the format info
totalMemory	ds.l  1	;the total amount of memory used.
styleCount	ds.l  1	;the number of unique styles in the record
rulerCount	ds.l  1	;the number of rulers in the record
RecordSize
	ENDR



TERuler	RECORD 0
leftMargin	ds.w  1
leftIndent	ds.w  1
rightMargin	ds.w  1
just	ds.w  1
extraLS	ds.w  1
flags	ds.w  1	;bit15 = equalLS, bit14 = showInvis
userData	ds.l  1
tabType	ds.w  1
numberOfTabs	ds.w  1
RecordSize
; tabKind	ds.w  1	;these are repeated for each tab. NOTE: these lines MUST be
; tabData	ds.w  1	;..commented out !!!
	ENDR



TEStyle	RECORD 0
fontID	ds.l  1
	ORG   fontID
fontFamily	ds.w  1
fontAttr	ds.b  1
fontSize	ds.b  1
foreColor	ds.w  1
backColor	ds.w  1
userData	ds.l  1	;0=no user data, 0=call the user style hook
RecordSize
	ENDR



TEStyleRecord	RECORD 0
version	ds.w  1
rulerListLength	ds.l  1
rulerList	ds    TERuler
RecordSize
	ENDR



KeyRecord	RECORD  0
theChar	ds.w  1
theModifiers	ds.w  1
theInputHandle	ds.l  1
cursorOffset	ds.l  1
theOpCode	ds.w  1
RecordSize
	ENDR



TERecord	RECORD  0
;---------------------- Generic Control Record -------------------
CtrlNext	ds.l  1	;*** RESERVED ***
inPort	ds.l  1	;window (grafport) that the record is in.
BoundsRect	ds    Rect	;bounding rectangle for the control (including all the scroll bars)
CtrlFlag	ds.b  1	;*** RESERVED ***
CtrlHilite	ds.b  1	;*** RESERVED ***
LastErrorCode	ds.w  1	;last error code that was generated
CtrlProc	ds.l  1	;this is always $8500 0000
CtrlAction	ds.l  1	;*** RESERVED ***
FilterProc	ds.l  1	;generic filter routine for adding user features to TextEdit
CtrlRefCon	ds.l  1	;*** RESERVED ***
ColorRef	ds.l  1	;reference to the color table
TextFlags	ds.l  1	;copy of the TextFlags passed to TENew
TextLength	ds.l  1	;total number of characters in the text
BlockList	ds    TextList	;handle and cached offset for the text itself
CtrlID	ds.l  1	;the ID number for the textedit control
CtrlMoreFlags	ds.w  1	;the control's generic more flags field
CtrlVersion	ds.w  1	;*** RESERVED ***
;-------------------- Extended Record for TextEdit ---------------
ViewRect	ds    Rect	;rectangle that contains just the text
TotalHeight	ds.l  1	;total height of the text in pixels
LineSuper	ds    SuperHandle	;handle, associated information for the line starts
StyleSuper	ds    SuperHandle	;handle, associated information for the style runs
StyleList	ds.l  1	;handle to the style list
RulerList	ds.l  1	;handle to the ruler list (there is only one ruler)
LineAtEndFlag	ds.w  1	;$FFFF means the last character was a line break (CR, FF)

SelectionStart	ds.l  1	;starting text offset of the selection
SelectionEnd	ds.l  1	;ending text offset of the selection
SelectionActive	ds.w  1	;$0000 = active, $FFFF = inactive
SelectionState	ds.w  1	;$0000 = offscreen, $FFFF = onscreen
CaretTime	ds.l  1	;when the tickcount reaches this number, invert the caret

NullStyleActive	ds.w  1	;$0000 = don't use the null style, $FFFF = use the null style
NullStyle	ds    TEStyle	;the style for the null selection

TopTextOffset	ds.l  1	;the TextOffset of the topmost line in the box
TopTextVPos	ds.w  1	;the difference between the topmost scroll pos and the top of the topmost line

VertScrollBar	ds.l  1	;handle to the vertical scroll bar
VertScrollPos	ds.l  1	;current position of the vertical scroll bar
VertScrollMax	ds.l  1	;maximum position of the vertical scroll bar
VertScrollAmount	ds.w  1	;number of pixels to scroll with each arrow click

HorzScrollBar	ds.l  1	;handle to the horizontal scroll bar
HorzScrollPos	ds.l  1	;number of pixels scrolled offscreen 
HorzScrollMax	ds.l  1	;maximum position of the horizontal scroll bar
HorzScrollAmount	ds.w  1	;number of pixels to scroll with each arrow click

GrowBoxHandle	ds.l  1	;handle to the grow box control

MaximumChars	ds.l  1	;maximum number of characters in the text
MaximumLines	ds.l  1	;maximum number of lines in the text
MaximumCharsPerLine	ds.w  1	;maximum number of characters in a line
MaximumHeight	ds.w  1	;maximum height of the text in pixels

TextDrawMode	ds.w  1	;drawing mode for the text

WordBreakHook	ds.l  1	;this routine is called to determine word breaks
WordWrapHook	ds.l  1	;this routine is called to determine word wraps
KeyFilter	ds.l  1	;this routine is called to filter keys

theFilterRect	ds    Rect	;this rect is passed to the generic filter proc
theBufferVPos	ds.w  1	;these two fields specify the buffer position in the record
theBufferHPos	ds.w  1	;..for the generic filter proc
theKeyRecord	ds    KeyRecord	;this is the parameter block for the KeyFilter

CachedSelcOffset	ds.l  1	;this is for a caret. This is the cached selection offset
CachedSelcVPos	ds.w  1	;..for these vertical and horizontal positions.
CachedSelcHPos	ds.w  1

MouseRect	ds    Rect	;the enclosing rectangle to determine double clicks
MouseTime	ds.l  1	;the tick count of when the mouse was last let up
MouseKind	ds.w  1	;the kind of the last click. (0=single, 1=double, 2=triple)
LastClick	ds    Point	;the last point that the mouse was clicked on
SavedHPos	ds.w  1	;the saved horizontal position for up/down arrows
AnchorPoint	ds.l  1	;this is the anchor point for selections
;---------------------- Data block for temp variables -------------
theFontStats	ds.w  1	;this is the font stat bits
theFontToRelease	ds.l  1	;this is the font to release
theEvent	ds    EventRecord
;---------------------------------------------------------------
RecordSize
	ENDR



TEParam	RECORD 0
count	ds.w  1
id	ds.l  1
boundsRect	ds    Rect
defProc	ds.l  1
ctlFlags	ds.w  1
ctlMoreFlags	ds.w  1
refCon	ds.l  1
textFlags	ds.l  1

indentRect	ds    Rect

vertBar	ds.l  1
vertAmount	ds.w  1
horzBar	ds.l  1
horzAmount	ds.w  1

styleRef	ds.l  1
textVerb	ds.w  1
textRef	ds.l  1
textLength	ds.l  1

maxChars	ds.l  1
maxLines	ds.l  1
maxCharsPerLine	ds.w  1
maxHeight	ds.w  1

colorRef	ds.l  1
textDrawMode	ds.w  1

filterProc	ds.l  1

RecordSize
	ENDR
;---------------------------------------------------------------
