TextEdit hooks
All the TextEdit hooks are register-based, and no standard glue exists. You should preserve all registers not used for return values. The
description of each follows:
intEOLHook (0)
This function should test to see if a character is the EOL "End Of Line
character. The default action is to compare the character to 0x0D (carriage
return) and return.
Entry: DO (byte) character to compare
A3 (long) pointer to a TERec A4 (long) Handle leading to a TERec Exit: z flag clear is end of line character
set otherwise
intDrawHook (1)
This function should draw some text. The current grafPort is already set
with the correct font, size, face, etc. The default action is to call DrawText and return.
Entry: D0 (word) offset into text to start drawing
D1 (word) length, in bytes, of text to draw
A0 (long) pointer to text to draw
A3 (long) pointer to a TERec A4 (long) Handle leading to a TERec Exit: (none)
intWidthHook (2)
This function should measure some text. The current grafPort is already
set with the correct font, size, face, etc. The default action is to call
Entry: DO (word) length, in bytes, of text to measure
D1 (word) offset into text to start measuring
A0 (long) pointer to text to draw
A3 (long) pointer to a TERec A4 (long) Handle leading to a TERec Exit: D1 (word) with, in pixels, of measured text
intHitTestHook (2)
This function should determine which character is at a specific horizontal
coordinate. The current grafPort is already set with the correct font, size,
face, etc. The default action is to call Pixel2Char and return. Entry: D0 (word) length, in bytes, of text to hit test
D1 (word) pixel offset from start of text in line
A0 (long) pointer to start of text
A3 (long) pointer to a TERec A4 (long) Handle leading to a TERec Exit: D0 (lo word) pixel width to last offset
(hi word) Boolean: TRUE if a character offset corresponding to the pixel width was found.
D1 (lo word) offset of found character
D2 (word) Boolean: TRUE if the pixel offset falls within the left side of the character.
SetClikLoop. You may also want to refer to IM I-391 for information on DoText and DoRecal which can be intercepted or used for micro management