![]() |
StScrpRec |
Header: TextEdit.h |
struct StScrpRec { SInt16 scrpNStyles; ScrpSTTable scrpStyleTab; }; typedef StScrpRec StScrpPtr;
The number of style runs (sets of character attributes) used in the text. This determines the size of the style table. When character attribute information is written to the null scrap, this field is set to 1; when the character attribute information is removed, this field is set to 0.
The scrap style table containing an element for each style run (set of character attributes).
The style scrap structure, defined by the StScrpRec data type, is used by functions to store character attribute information temporarily. The scrap style table, defined by the scrpStyleTab data type, is contained in the style scrap structure. The scrap style element structure, defined by the ScrpSTElement data type, contains the character attribute information for an element in the scrap style table. One scrap style element structure exists for each sequential attribute change in the associated text.
The style scrap is used for storing character attribute information associated with the current text selection or insertion point, character attribute information to be applied to text, or multistyled text that is cut or copied. When multistyled text is cut or copied, the character attribute information is written to both the style scrap and the desk scrap.
In most cases, the style scrap is created dynamically as needed by functions. However, a style scrap structure can be created directly without using the TEGetStyleScrapHandle function; the character attribute information written to it can be applied to inserted text through TEStyleInsert or to existing text through TEUseStyleScrap.
The format of the style scrap is defined by a style scrap structure of type STScrpRec.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)